Data acquisition method and device
By obtaining resource location information of the application interface and establishing storage entries, the problem of poor data browsing among different applications is solved, and unified data storage and convenient viewing across applications is achieved.
Patent Information
- Application Number
- CN202510577938.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, application interface content and its links can only be identified and displayed within the same application, resulting in poor convenience when users switch between different applications, making it difficult to view saved content in different applications in a convenient way.
By identifying the target display area, obtain resource location information of the target application interface, access the target page data, and establish target storage entries, support the unified storage of target data locally on electronic devices, and realize data browsing across applications.
Improves the convenience of users browsing and saving data between different applications, allowing viewing page content of different applications without switching applications.
Smart Images

Figure CN120407527A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data acquisition, and particularly to a data acquisition method and device. Background Art
[0002] Some applications have a favorite function. When a user browses the interface displayed by an application, the application can, in response to a specific operation of the user, save the content contained in the interface or the link to the content in the storage space of the application for the user to browse repeatedly.
[0003] The problem with the above solution is that the content and its links contained in the interface of an application can often only be correctly recognized and displayed by that application. Therefore, when a user needs to view the content saved in different applications, they need to switch between different applications, resulting in poor convenience. Summary of the Invention
[0004] To this end, this application discloses the following technical solutions:
[0005] A first aspect of this application provides a data acquisition method, including:
[0006] In response to an identification instruction for a target display area, obtain the resource location information of the target page included in the target application interface;
[0007] Access the resource location information to obtain the target data corresponding to the target page;
[0008] Establish a target storage entry for the target data;
[0009] Wherein, the target display area is the area used for display by the electronic device; the target application interface is the application interface currently displayed by the electronic device.
[0010] Optionally, it further includes:
[0011] In the case where the resource location information is not obtained, identify the content contained in the target application interface to obtain interface content data, so as to establish a target storage entry for the interface content data.
[0012] Optionally, establishing the target storage entry for the target data includes:
[0013] In the case where the target data matches the target application interface, establish a target storage entry for the target data.
[0014] Optionally, it further includes:
[0015] In response to a first instruction, display a target control in the target application interface;
[0016] In response to a second instruction for the target control, at least display the target storage entry.
[0017] Optionally, the responding to the recognition instruction for the target display area includes:
[0018] Responding to a recognition instruction for a target recognition area in the target display area;
[0019] Wherein, the recognition instruction is a sliding operation instruction acting on the target display area, and the target recognition area is determined according to the sliding trajectory of the sliding operation instruction.
[0020] Optionally, the obtaining the resource location information of the target page included in the target application interface includes:
[0021] Extracting the page view information of the target page included in the target application interface;
[0022] Reading the resource location information of the target page from the page view information based on the information interface corresponding to the page view information.
[0023] Optionally, the obtaining the resource location information of the target page included in the target application interface includes:
[0024] Extracting the page view information of the target page included in the target application interface;
[0025] Searching for a target method for obtaining resource location information in the page view information;
[0026] Loading and executing the executable instruction corresponding to the target method from the memory to obtain the resource location information of the target page.
[0027] Optionally, the obtaining the resource location information of the target page included in the target application interface includes:
[0028] Obtaining the request information of the target page included in the target application interface;
[0029] Reading the address association information from the request information;
[0030] Processing the address association information according to the processing rules corresponding to the target application program to obtain the resource location information of the target page, where the target application program is the application to which the target application interface belongs.
[0031] Optionally, the obtaining the resource location information of the target page included in the target application interface includes:
[0032] Determining the target process to which the target application interface belongs;
[0033] Determine an application instance of a target application according to the target process, where the target application is the application to which the target application interface belongs;
[0034] Obtain the resource location information of the target page included in the target application interface from the variables included in the application instance.
[0035] A second aspect of the present application provides a data acquisition device, including:
[0036] A resource acquisition unit, configured to obtain the resource location information of the target page included in the target application interface in response to an identification instruction for a target display area;
[0037] A data acquisition unit, configured to access the resource location information to obtain target data corresponding to the target page;
[0038] A storage unit, configured to establish a target storage entry for the target data;
[0039] Wherein, the target display area is the area used for display by the electronic device; the target application interface is the application interface currently displayed by the electronic device. Description of the Drawings
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.
[0041] Figure 1 It is a flowchart of a data acquisition method provided by an embodiment of the present application;
[0042] Figure 2 It is a schematic interface diagram of a data acquisition method provided by an embodiment of the present application;
[0043] Figure 3 It is a schematic display interface diagram of a storage entry provided by an embodiment of the present application;
[0044] Figure 4 It is a schematic structural diagram of a data acquisition device provided by an embodiment of the present application;
[0045] Figure 5 It is a schematic structural diagram of another data acquisition device provided by an embodiment of the present application. Detailed Embodiments
[0046] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts belong to the scope of protection of the present application.
[0047] This embodiment provides a data acquisition method. Please refer to Figure 1 , which is a flowchart of the method. The method may include the following steps.
[0048] S101, in response to an identification instruction for a target display area, obtain the resource location information of the target page included in the target application interface. The target display area is the area used for display by the electronic device, and the target application interface is the application interface currently displayed on the electronic device.
[0049] The execution subject of the data acquisition method in this embodiment may be any terminal electronic device with data processing capabilities, including but not limited to computers, smart phones, tablet computers, etc.
[0050] The target display area may be the entire display area of the screen of the electronic device, or a part of the display area on the screen. As an example, the target display area may be a part of the display area at the top of the screen, a part of the display area at the bottom of the screen, or a partial area near the left or right edge of the screen.
[0051] The target application interface is the application interface currently displayed on the screen by the target application program of the electronic device. The target application program may be any application program installed on the electronic device.
[0052] As an example, the target application program may be the "XX News Client" installed on the electronic device, and the target application interface may be Figure 2 the application interface shown in (1) of
[0053] The target page is the page included in the target application interface, and this page may be used to display text and / or image information.
[0054] During the operation of the target application program, based on the user's operation, the target data corresponding to the target page can be obtained from the server device, and then the target application interface including the target page can be displayed according to the target data. The server device is communicatively connected to the electronic device to which the target application program belongs.
[0055] The target data can be understood as all the data that constitutes the target page in a computer device (including server devices and terminal devices). The target data determines the content contained in the target page, such as the text and / or images contained in the target page, and also determines the style and position of this content when displayed in the target page.
[0056] The resource location information, which can also be referred to as the Uniform Resource Identifier (URL), can be understood as a string used to identify a specific resource in a server device. In this embodiment, the resource location information of the target page can be understood as a string used to uniquely identify the target data corresponding to the target page in the server device.
[0057] During the display of the target application interface by the target application, a large amount of information related to the target page will be generated, including but not limited to the page view information (WebView) corresponding to the target page, the request information (Intent), and the target variables related to the target page. The electronic device can analyze any one or more of this information to obtain the resource location information of the target page.
[0058] S102, access the resource location information to obtain the target data corresponding to the target page.
[0059] In step S102, the electronic device can parse the resource location information to determine the network address of the server device. Then, the electronic device can access this network address and send a target data request to the server device. The target data request can carry information parsed from the resource location information that can uniquely identify the target data, including but not limited to the storage path of the target data in the server device, the identifier (ID) of the target data in the server device, and other information.
[0060] Then, the electronic device can receive the target data fed back by the server device in response to the target data request.
[0061] When displaying the target application interface, the target data obtained by the target application is generally encrypted and stored in the private storage space of the target application. When the target application interface is not displayed, the target application will clear the target data. Therefore, generally, the target data can be obtained from the server device by accessing the resource location information, and it is impossible to directly read the target data that the target application has already obtained.
[0062] S103, establish a target storage entry for the target data.
[0063] In step S103, the electronic device may save the target data in the memory, and then establish a target storage entry corresponding to the target data. The target storage entry may include, but is not limited to, the title of the target page, the name of the target application, the timestamp when the target storage entry is established, the storage address of the target data in the memory, and other information.
[0064] The electronic device may save the target data in the memory in the form of a file corresponding to the target page. As an example, the target data may be saved as a corresponding file in a page file format, such as an xml file format or an html file format. In other words, what the electronic device finally saves may be an XX.xml file or an XX.html file containing the target data.
[0065] After establishing the target storage entry, the electronic device may find the target data in the memory based on the user's operation on the target storage entry, and then display the target page according to the target data.
[0066] The beneficial effect of this embodiment is as follows:
[0067] After obtaining the recognition instruction, the electronic device can obtain the resource location information of the target page contained in the application interface based on this solution, and then directly obtain the target data that constitutes the target page, and save the target data locally on the electronic device through the target storage entry for the target data. Thus, for any page displayed by any application, the electronic device can uniformly save the page in the form of the corresponding target data through the solution of this embodiment, and further support the user to browse the saved pages of different applications in the form of browsing the target data without switching the application, improving the convenience when browsing the saved data.
[0068] In this embodiment, the type of the recognition instruction is not limited. For example, the recognition instruction may be a double-click operation instruction acting on the target display area, a long-press operation instruction acting on the target display area, or a swipe operation instruction acting on the target display area.
[0069] When the recognition instruction is a swipe operation instruction, the recognition instruction may be a specific type of swipe operation instruction, such as a swipe operation instruction from the top of the screen downward, or a horizontal swipe operation instruction from the left or right edge of the screen to the center of the screen; the recognition instruction may also be an unspecified type of swipe operation instruction. That is to say, during the period when the target application displays the target application interface, as long as the user performs an arbitrary swipe operation within the target display area, the electronic device may determine the swipe operation instruction obtained based on this operation as the recognition instruction, and then trigger the aforementioned data acquisition method.
[0070] For the case where the recognition instruction is a sliding operation instruction of an unspecified type, the electronic device can determine a target recognition area according to the recognition instruction. The target recognition area can be determined according to the sliding trajectory of the sliding operation instruction. Correspondingly, the above-mentioned response to the recognition instruction for the target display area is equivalent to:
[0071] Responding to the recognition instruction for the target recognition area in the target display area.
[0072] The sliding trajectory corresponding to the sliding operation instruction can be a closed curve trajectory. In this case, the closed curve trajectory can be used as the contour of the target recognition area, and thus the target recognition area can be determined.
[0073] The sliding trajectory corresponding to the sliding operation instruction can be a non-closed curve trajectory. In this case, the starting point and the ending point of the non-closed curve trajectory can be connected to form a closed curve, and the formed closed curve is used as the contour of the target recognition area, and thus the target recognition area can be determined.
[0074] As an example, please refer to Figure 2 , the electronic device displays Figure 2 the target application interface shown in (1) of Figure 2 . The target display area is the entire display area of the screen. The user's finger slides on the screen to form Figure 2 the sliding trajectory shown by the dotted arrow in (1) of Figure 2 . At this time, the electronic device can determine the sliding operation instruction corresponding to this sliding operation as the recognition instruction to execute the foregoing method, and connect the head and tail of
[0075] the non-closed curve trajectory shown in (1) of
[0076] In the case of responding to the recognition instruction for the target recognition area, the electronic device can further perform the following steps after obtaining the target data:
[0077] Based on the target data for recognition to obtain the recognition result for the recognition instruction.
[0078] In the above steps, the electronic device can determine the content in the target page that is located within the target recognition area, then obtain the data related to this part of the content from the target data, and perform recognition on this part of the data to obtain the recognition result for the recognition instruction. Figure 2 As an example,
[0079] If the target recognition area contains a part of the image content of the target page, the electronic device can obtain data related to the image content within the target recognition area from the target data, and identify this part of the data to obtain an identification result.
[0080] The electronic device can use a pre-configured data processing model with recognition capabilities to process data related to text content or image content to obtain an identification result. The data processing model and related processing methods used can refer to the related art and will not be elaborated here.
[0081] When identifying data related to text content, the obtained identification result can be the string corresponding to this text content. For example, for the target recognition area shown in Figure 2 (2) of, the obtained identification result can be "warm", "recently", "flooded into each area of City A"; it can also be a specific keyword that appears in the string corresponding to this text content. For example, for the target recognition area shown in Figure 2 (2) of, the obtained identification result can be the keyword "City A".
[0082] When identifying data related to image content, the obtained identification result can be a string representing the image attributes. For example, it can be a string representing the types of objects in the image. As an example, when the target recognition area contains an image of an apple, the obtained identification result can be "apple". When the target recognition area contains an image of a tree, the obtained identification result can represent the category of the tree, such as "camphor tree".
[0083] When obtaining the identification result, the electronic device can add the identification result to the target storage entry when establishing the target storage entry, so that the user can conveniently obtain the identification result when viewing the target storage entry. The electronic device can also synchronously display the identification result on the target application interface.
[0084] Based on the method of the above embodiments, the electronic device can quickly identify the content contained in the target page according to the user's identification instruction during the display of the target application to obtain the identification result, meeting the user's need to analyze specific content in the target page in some scenarios.
[0085] In some optional embodiments, when the electronic device obtains the resource location information, there may be a situation where the acquisition fails. At this time, the electronic device can also perform the following steps:
[0086] In the case where the resource location information is not obtained, identify the content contained in the target application interface to obtain the interface content data, so as to establish a target storage entry for the interface content data.
[0087] In the above steps, the electronic device can use the screenshot function to capture the content currently displayed on the screen, thereby obtaining an interface screenshot corresponding to the target application interface. Then, the electronic device can use a data processing model with recognition capabilities to process the interface screenshot to obtain the interface content data output by the data processing model. Finally, the interface content data is saved in the memory of the electronic device, and a target storage entry is established based on the saved interface content data.
[0088] When establishing the target storage entry in the above manner, the target storage entry may include, but is not limited to, the title of the target page, the name of the target application, the timestamp for establishing the target storage entry, the storage address of the interface content data in the memory, and other information.
[0089] In the above embodiments, the electronic device can also combine the interface content data and the captured interface screenshot Figure 1 and save them for displaying the interface screenshot when the user needs it.
[0090] In the above embodiments, if the obtained recognition instruction is a recognition instruction for the target recognition area, the electronic device can also use the data processing model to process the part within the target recognition area in the interface screenshot to obtain the aforementioned recognition result and add the recognition result to the target storage entry.
[0091] In some alternative embodiments, before establishing the target storage entry for the target data, it is possible to first verify whether the target data matches the target application interface, and then save the target data and establish the corresponding target storage entry when it is determined that the two match.
[0092] In other words, step S103 can be equivalent to:
[0093] Establish a target storage entry for the target data when the target data matches the target application interface.
[0094] Correspondingly, if the target data does not match the target application interface, the following steps can be executed:
[0095] When the target data does not match the target application interface, obtain an interface screenshot of the target application interface to establish a target storage entry for the target data and the interface screenshot.
[0096] The target data matching the target application interface means that the content corresponding to the target data is the same as the content currently displayed on the target application interface; if the content corresponding to the target data is different from the content currently displayed on the target application interface, it can be determined that the target data does not match the target application interface.
[0097] The method for comparing whether the target data and the target application interface match can be as follows: obtain the interface content data corresponding to the target application interface according to the method for obtaining interface content data described above, extract the data in the target data that is related to the content of the target page, compare the two parts of data, and if they are consistent, determine that the target data and the target application interface match, and if they are inconsistent, determine that the target data and the target application interface do not match.
[0098] For example, if the target data contains the string data "May 10, 2024", while the text content at the corresponding position in the target application interface is "May 9, 2024", and the contents of the two are inconsistent, it can be determined that the target data and the target application interface do not match.
[0099] In the case where the target data and the target application interface do not match, the electronic device can obtain the interface screenshot corresponding to the target application interface based on the screenshot function, then save the target data and the interface screenshot in the memory, and then establish a target storage entry for the target data and the interface screenshot.
[0100] The target storage entry established in the above manner, in addition to including Figure 1 the information of the target storage entry in the corresponding embodiment, may also include the storage address of the above interface screenshot.
[0101] The advantage of establishing the target storage entry in the above manner is that:
[0102] In some cases, the server device may update the target data, and the updated target data may not be pushed to the target application in a timely manner, resulting in the inconsistency between the content of the target application interface and the content corresponding to the target data.
[0103] In response to this situation, the method of this embodiment can save only the target data when the target data and the target application interface match, saving the storage space of the electronic device. At the same time, when the two do not match, the content before and after the update is saved in the form of the target data and the interface screenshot, so as to meet the user's need to view the content before and after the update in some scenarios.
[0104] In some optional embodiments, after the electronic device establishes the target storage entry, it can default to display the target control corresponding to the storage entry in the target application interface. The target control can be a virtual button in any form. As an example, after the electronic device establishes the target storage entry, it can display the target control as shown in Figure 2 (2) below.
[0105] The target control can be used as an entry for the user to view the storage entry. The electronic device can display a display interface for viewing the storage entry after obtaining a specific operation instruction for the target control, and display the currently established storage entry in the display interface.
[0106] As an example, when the electronic device displays the target control shown in (1) of Figure 3 , if a click instruction for the target control is obtained, the electronic device can display Figure 3 the storage entry display interface shown in (2) of
[0107] and display the established storage entries in this display interface, which can at least include the established target storage entry. When displaying the storage entry, the electronic device can only display a part of the information contained in the storage entry. For example, it can only display the title of the target page corresponding to the storage entry, the name of the target application, and the timestamp for establishing the target storage entry.
[0108] After each establishment of the target storage entry, the electronic device can display the target control. If no operation instruction for the target control is obtained within the preset duration after the start of displaying the target control, the electronic device can cancel the display of the target control. The preset duration can be determined based on the user's configuration, such as set to 10 seconds, 16 seconds, etc., without limitation.
[0109] Optionally, during the display of the storage entry display interface by the electronic device, it can also respond to the operation instruction of the user for any one or more of the storage entries and edit the established storage entries, including but not limited to changing the title of the target page contained in the storage entry, the name of the target application, deleting the existing storage entry, etc.
[0110] In the case of deleting the storage entry, the electronic device can synchronously delete any one or more of the target data, interface content data, and interface screenshots corresponding to the storage entry saved in the memory.
[0111] In some alternative embodiments, after establishing the target storage entry, the electronic device may also default not to display the target control. In this case, the electronic device can also perform the following steps after establishing the target storage entry:
[0112] In response to the first instruction, display the target control in the target application interface;
[0113] In response to the second instruction for the target control, at least display the target storage entry.
[0114] The first instruction is an instruction for triggering the electronic device to display the target control. The form of the first instruction is not limited and can be changed according to the user's configuration. It can be a specific gesture operation instruction, such as a swipe operation instruction from the left or right edge of the screen to the middle of the screen, or a knuckle tap instruction, etc. It can also be an operation instruction for pressing a specific button, such as pressing the volume up key and the volume down key simultaneously, or long pressing the power key, etc.
[0115] After obtaining the first instruction, the electronic device can display the target control as shown in Figure 3 Figure (1). During the display of the target control, the electronic device can obtain a second instruction for the target control.
[0116] The second instruction is a preset instruction for triggering the electronic device to display stored entries, and its form can be a click instruction, a double-click instruction, or other operation instructions.
[0117] Taking the second instruction being a click instruction as an example, after obtaining the click instruction for the target control, the electronic device can display Figure 3 the stored entry display interface shown in Figure (2), so as to display multiple existing stored entries in this interface. For example, it can display Figure 3 Stored Entry 1, Stored Entry 2, and Stored Entry 3 in Figure (2).
[0118] Optionally, after obtaining the target data, it can further process the target data to obtain a data summary corresponding to the target data. This data summary can be related to the content corresponding to the target data. For example, the data summary can characterize the theme of the corresponding content.
[0119] In the case of obtaining the data summary, the data summary can also be added to the stored entry corresponding to the target data. When displaying the established stored entries, the data summary contained in the stored entry can be temporarily not displayed, and after obtaining the trigger instruction for any stored entry, the data summary contained in that stored entry is then displayed.
[0120] The electronic device can use a data processing model with the ability to generate a data summary to process the target data to obtain a data summary corresponding to the target data. This data processing model can be pre-configured in the electronic device, and its working principle can refer to related technologies and will not be elaborated here.
[0121] As an example, when obtaining Figure 2 the target data corresponding to the target page shown in Figure (1) and creating the corresponding Stored Entry 1, the data summary corresponding to this target data can be added to Stored Entry 1.
[0122] When Figure 3 displaying multiple stored entries in the interface shown in Figure (2), the electronic device responds to the trigger instruction for Stored Entry 1 (such as the click instruction for Stored Entry 1), and Figure 3 displays the data summary of Stored Entry 1 in the interface shown in Figure (3).
[0123] Optionally, when displaying multiple stored entries, the electronic device can also, based on the user's operation instruction, display the target data corresponding to any stored entry in the form of a target page again. As an example, when displaying Figure 3When in the interface shown in (2), the electronic device can respond to a double - click instruction for storage entry 1, read out the target data corresponding to storage entry 1 from the memory, and display based on these target data Figure 2 the target page shown in (1).
[0124] In the method provided in this embodiment, the resource location information of the target page can be obtained in various ways.
[0125] One way to obtain the resource location information of the target page can be:[[]]
[0126] Extract the page view information of the target page contained in the target application interface;
[0127] Read the resource location information of the target page from the page view information based on the information interface corresponding to the page view information.
[0128] In the view information of the target page, various attribute information of the target page and various program segments related to the target page can be included. These program segments can also be called methods. Among the attribute information, the resource location information of the target page can be included.
[0129] Some application programs may provide an information interface that can directly access the attribute information contained in the page view information. In this case, the resource location information can be obtained in the above - mentioned manner.
[0130] Taking the operating system of the electronic device being the Android system as an example, the electronic device (or the operating system of the electronic device) can obtain the interface activity component (i.e., Activity) corresponding to the target application interface, obtain the page view information of the target page from the interface activity component, and then can call the information interface provided by the target application for reading the resource location information to read the resource location information of the target page from this page view information.
[0131] The above - mentioned obtaining method has the advantages of high efficiency and less processing resources consumed, but it is only applicable when the target application program provides the corresponding information interface.
[0132] One way to obtain the resource location information of the target page can be:[[]]
[0133] Extract the page view information of the target page contained in the target application interface;
[0134] Find the target method for obtaining the resource location information in the page view information;
[0135] Load and execute the executable instructions corresponding to the target method from the memory to obtain the resource location information of the target page.
[0136] The way to extract the page view information refers to the previous obtaining method and will not be elaborated.
[0137] Generally, in order to facilitate editing resource location information and the internal use of resource location information by the target application, a program segment for accessing resource location information is generally provided in the page view information, that is, the target method in the above embodiments. However, this target method generally does not support direct invocation by the operating system of the electronic device.
[0138] The target methods of different applications usually have the same name. In the above acquisition method, the target method included in the page view information can be obtained based on the name of the target method, and then, according to the name of the target method and the page view information corresponding to the target page, the executable instructions corresponding to the target method in the page view information are loaded and executed from the memory of the electronic device. By executing these executable instructions, the restrictions of the target application are bypassed, so as to obtain the resource location information in the page view information.
[0139] Taking the operating system of the electronic device being the Android system as an example, in the above embodiments, the following instructions can be executed to obtain the target method.
[0140] Method method_1 = clazz.getDeclaredMethod("geturl")
[0141] Among them, geturl is an example of the name of the target method. After executing the above instructions, method_1 is equivalent to the target method.
[0142] Then, the following instructions can be further executed to obtain the resource location information corresponding to the target page.
[0143] method_1.invoke(sampleObject)
[0144] Among them, sampleObject represents the name of the page view information corresponding to the target page. Through the above instructions, the electronic device can load and execute the executable instructions corresponding to the target method from the memory to obtain the resource location information.
[0145] Optionally, for the Android operating system, the implementation principle of the above acquisition method can also partially refer to the related technologies of the reflection mechanism of the Android system.
[0146] The above acquisition method does not depend on the information interface provided by the target application, so it has a wider scope of application and can be used to obtain the resource location information corresponding to the target application interface of most applications. However, the overall time consumption is long, the efficiency is low, and it may consume more processing resources.
[0147] A way to obtain the resource location information of the target page can be:
[0148] Obtain the request information of the target page included in the target application interface;
[0149] Read the address association information from the request information;
[0150] Process the address association information according to the processing rule corresponding to the target application, and obtain the resource location information of the target page, where the target application is the application to which the target application interface belongs.
[0151] The request information of the target page can be provided as an input parameter by the target application to the program segment for creating the target application interface when the target application creates the target application interface. The request information can carry the information required for creating the target application interface, including the resource location information of the target page included in the target application interface.
[0152] Therefore, when the target application provides an interface for reading the request information, the request information can be read first through the interface provided by the target application.
[0153] Generally, the request information does not directly carry the resource location information, but carries the address association information related to the resource location information, and the address association information is obtained by the target application processing the resource location information according to certain rules.
[0154] Therefore, after obtaining the request information, the address association information carried therein can be read first, and then the address association information can be processed based on the processing rule corresponding to the target application to obtain the resource location information of the target page.
[0155] Among them, the processing rules corresponding to different application programs are different. This embodiment does not limit the processing rules of actual applications. The electronic device can obtain the processing rule corresponding to the application program before installing an application program through the relevant manufacturer that publishes the application program or through other means.
[0156] As an example, the address association information of some application programs can include the page address information of the target page and the data identifier of the target data corresponding to the target page.
[0157] Among them, the page address information can represent the network address of the server device storing the target data corresponding to the target page, and the data identifier of the target data can represent the storage path of the target data in the server device. The combination of the two can constitute the resource location information of the target page.
[0158] For the application in the above example, the corresponding processing rule can be to concatenate the page address information and the data identifier in the address association information in sequence. Correspondingly, the way for the electronic device to process the address association information based on the processing rule can be to extract the page address information and the data identifier contained in the address association information, concatenate the two in sequence, with the page address information first and the data identifier second. The information obtained after concatenation is the resource location information of the target page.
[0159] As some examples, when the operating system of the electronic device is the Android system, the target application can create the target application interface by calling the method for creating an interface activity component (Activity), such as by using the startActivity(intent) method. The request information can be the input parameter provided by the target application when calling such a method, such as the intent provided when calling the startActivity method.
[0160] The above acquisition method can obtain the resource location information with less resource overhead and in a shorter time, and does not depend on the information interface of the page view information, but is only applicable when the electronic device has previously obtained the corresponding processing rule of the target application.
[0161] A way to obtain the resource location information of the target page can be:
[0162] Determine the target process to which the target application interface belongs;
[0163] Determine the application instance of the target application according to the target process, where the target application is the application to which the target application interface belongs;
[0164] Obtain the resource location information of the target page contained in the target application interface from the variables contained in the application instance.
[0165] Among them, the way to obtain the resource location information of the target page contained in the target application interface from the variables contained in the application instance can be:
[0166] There is a target variable with the target variable name among the variables contained in the application instance;
[0167] Obtain the variable value of the target variable as the resource location information of the target page.
[0168] In the above acquisition method, the target process can be determined by calling the program segment provided by the operating system to query the process identifier (ID) according to the target application interface.
[0169] Taking the Android system of the electronic device as an example, the following instruction can be executed to determine the target process: Activity_1.myPid().
[0170] Among them, Activity_1 represents the name of the interface activity component corresponding to the target application interface, and myPid() is a method provided by the Android system to query the process identifier.
[0171] After executing the above instruction, myPid() will output the process identifier of the target process, and thus the target process can be determined among multiple processes of the electronic device.
[0172] An application instance can be regarded as the global representation of the target application when it runs in the system, and it can include all data variables and program segments required to support the operation of the target application.
[0173] Taking the example that the operating system of the electronic device is the Android system, the application instance of the target application can be an Application object corresponding to the target application.
[0174] Generally, the name of the application instance of the target application is the same as the names of the respective processes associated with the target application. For example, they are all the application package name of the target application. And the target process to which the target application interface belongs obviously belongs to the processes associated with the target application. Therefore, after determining the target process, the name of the target process can be obtained, and based on this name, the application instance with the same name can be found and used as the application instance of the target application.
[0175] The target variable refers to the variable in the application instance of the target application that is used to record the resource location information of the target page.
[0176] After finding the application instance of the target application, all variables contained in the application can be read, and the variable names of these variables are compared one by one with the preset target variable name, so as to find the target variable with the target variable name in the application instance, and then read the variable value of the target variable as the resource location information of the target page.
[0177] Optionally, in order to improve the success rate of finding the target variable, multiple possible target variable names can be preset in advance. As long as the variable name of one variable in the application instance of the target application is the same as any one of the target variable names, this variable can be determined as the target variable, and then the resource location information of the target page can be obtained.
[0178] Obtaining the resource location information in the above manner can obtain the resource location information with less resource overhead and shorter time without relying on the information interface of the page view information and the preset processing rules.
[0179] Optionally, the electronic device may also obtain the resource location information of the target page by using any of the above methods; alternatively, it may separately attempt to obtain the resource location information of the target page by using any combination of the above methods, without limitation. If the resource location information cannot be obtained by multiple methods, the interface content data may be obtained and the corresponding target storage entry may be established according to the situation where the resource location information is not obtained in the foregoing embodiments.
[0180] This embodiment also provides a data acquisition device. Please refer to Figure 4 which is a schematic structural diagram of the device. The device may include the following units.
[0181] A resource acquisition unit 401, configured to obtain the resource location information of a target page included in a target application interface in response to an identification instruction for a target display area;
[0182] A data acquisition unit 402, configured to access the resource location information to obtain target data corresponding to the target page;
[0183] A storage unit 403, configured to establish a target storage entry for the target data;
[0184] Among them, the target display area is the area used for display by the electronic device; the target application interface is the application interface displayed in the target display area.
[0185] Optionally, the data acquisition unit 402 may also be configured to:
[0186] [[ID=…]] In the case where the resource location information is not obtained, identify the content included in the target application interface to obtain interface content data, so as to establish a target storage entry for the interface content data.
[0187] Optionally, when establishing a target storage entry for the target data, the storage unit 403 may be configured to:
[0188] In the case where the target data matches the target application interface, establish a target storage entry for the target data.
[0189] Optionally, the resource acquisition unit 401's response to the identification instruction for the target display area includes:
[0190] Respond to an identification instruction for a target recognition area in the target display area;
[0191] Among them, the identification instruction is a sliding operation instruction acting on the target display area, and the target recognition area is determined according to the sliding trajectory of the sliding operation instruction.
[0192] Optionally, when obtaining the resource location information of the target page included in the target application interface, the resource acquisition unit 401 may be configured to:
[0193] Extract the page view information of the target page included in the target application interface;
[0194] Read the resource location information of the target page from the page view information based on the information interface corresponding to the page view information.
[0195] Optionally, when the resource acquisition unit 401 acquires the resource location information of the target page included in the target application interface, it can be used for:
[0196] Extract the page view information of the target page included in the target application interface;
[0197] Find the target method for obtaining the resource location information in the page view information;
[0198] Load and execute the executable instructions corresponding to the target method from the memory to obtain the resource location information of the target page.
[0199] Optionally, when the resource acquisition unit 401 acquires the resource location information of the target page included in the target application interface, it can be used for:
[0200] Obtain the request information of the target page included in the target application interface;
[0201] Read the address association information from the request information;
[0202] Process the address association information according to the processing rules corresponding to the target application to obtain the resource location information of the target page, where the target application is the application to which the target application interface belongs.
[0203] Optionally, when the resource acquisition unit 401 acquires the resource location information of the target page included in the target application interface, it can be used for:
[0204] Determine the target process to which the target application interface belongs;
[0205] Determine the application instance of the target application according to the target process, where the target application is the application to which the target application interface belongs;
[0206] Obtain the resource location information of the target page included in the target application interface from the variables included in the application instance.
[0207] Optionally, please refer to Figure 5 , which is a schematic diagram of another data acquisition device provided in this embodiment. The device may include Figure 4 each unit of the device shown, and may further include a display unit 501, which is used for:
[0208] In response to the first instruction, display the target control in the target application interface;
[0209] In response to a second instruction for a target control, at least display the target storage entry.
[0210] For the working principle of the above data acquisition device, reference may be made to the relevant steps in the data acquisition method of the foregoing embodiments, which will not be elaborated herein.
[0211] It should be noted that the various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference may be made to each other.
[0212] For the convenience of description, when describing the above system or device, it is divided into various modules or units according to functions for separate description. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0213] From the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present application.
[0214] Finally, it should also be noted that in this article, relational terms such as first, second, third, and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0215] The above are only the preferred embodiments of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A data acquisition method, comprising: In response to an identification instruction for a target display area, acquiring resource location information of a target page included in a target application interface; Accessing the resource location information to acquire target data corresponding to the target page; Establishing a target storage entry for the target data; Wherein, the target display area is an area used for display by an electronic device; the target application interface is the application interface currently displayed by the electronic device.
2. The method according to claim 1, further comprising: In the case where the resource location information is not acquired, identifying the content included in the target application interface to obtain interface content data, so as to establish a target storage entry for the interface content data.
3. The method according to claim 1, wherein establishing a target storage entry for the target data comprises: In the case where the target data matches the target application interface, establishing a target storage entry for the target data.
4. The method according to claim 1, further comprising: In response to a first instruction, displaying a target control in the target application interface; In response to a second instruction for the target control, at least displaying the target storage entry.
5. The method according to claim 1, wherein responding to an identification instruction for a target display area comprises: Responding to an identification instruction for a target identification area in the target display area; Wherein, the identification instruction is a sliding operation instruction acting on the target display area, and the target identification area is determined according to the sliding trajectory of the sliding operation instruction.
6. The method according to claim 1, wherein acquiring resource location information of a target page included in a target application interface comprises: Extracting page view information of the target page included in the target application interface; Reading the resource location information of the target page from the page view information based on an information interface corresponding to the page view information.
7. The method according to claim 1, wherein acquiring resource location information of a target page included in a target application interface comprises: Extracting page view information of the target page included in the target application interface; Searching for a target method for obtaining resource location information in the page view information; Loading and executing executable instructions corresponding to the target method from memory to obtain the resource location information of the target page.
8. The method according to claim 1, wherein acquiring resource location information of a target page included in a target application interface comprises: Obtaining request information of the target page included in the target application interface; Reading address association information from the request information; Processing the address association information according to a processing rule corresponding to a target application program to obtain the resource location information of the target page, where the target application program is the application to which the target application interface belongs.
9. The method according to claim 1, wherein acquiring resource location information of a target page included in a target application interface comprises: Determining a target process to which the target application interface belongs; Determining an application instance of a target application program according to the target process, where the target application program is the application to which the target application interface belongs; Obtain the resource location information of the target page included in the target application interface from the variables included in the application instance.
10. A data acquisition device, comprising: A resource acquisition unit, configured to obtain the resource location information of the target page included in the target application interface in response to an identification instruction for a target display area; A data acquisition unit, configured to access the resource location information to obtain target data corresponding to the target page; A storage unit, configured to establish a target storage entry for the target data; wherein the target display area is an area used for display by the electronic device; the target application interface is the application interface currently displayed by the electronic device.