Content extraction method, apparatus, terminal and storage medium

By determining the control class name of the target control and generating corresponding extraction rules, including arithmetic expressions and content extraction paths, the problem of incomplete control content extraction in existing technologies is solved, achieving more efficient content extraction.

CN108762842BActive Publication Date: 2026-01-06BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN201810522900.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-05-28
Publication Date
2026-01-06
Estimated Expiration
2038-05-28

AI Technical Summary

Technical Problem

In existing technologies, the operating system only extracts one type of content from the control, which fails to meet the user's need to extract different types of content. Furthermore, it cannot extract content when the control does not contain that type of content, resulting in a limited amount of effective content.

Method used

The target control's class name is determined by receiving a selection operation, and corresponding extraction rules are generated based on the control class name, including arithmetic expressions and content extraction paths, to achieve accurate extraction of the target content.

Benefits of technology

This enables more targeted extraction of target content from target controls, avoiding insufficient effective content due to extraction of a single type, and improving the effectiveness of extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN108762842B_ABST
    Figure CN108762842B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a content extraction method and device, a terminal and a storage medium, and relate to the technical field of computers. The method comprises: receiving a selection operation on a target control; determining a control class name of the target control according to the selection operation; determining an extraction rule corresponding to the control class name as an extraction rule of the target control, the extraction rule being used to determine an extraction manner of the target content; and extracting the target content in the target control according to the extraction rule. The content in the target control is extracted by the extraction rule. Since the extraction rule corresponds to the control class name of the target control, that is, the extraction rule is adaptively set for the control class name of the target control, the target content in the target control can be extracted more targetedly, and the problem of less effective content extracted due to the extraction of a single type of content is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a content extraction method, apparatus, terminal, and storage medium. Background Technology

[0002] When using mobile devices, it's often necessary to retrieve content from the user interface to achieve other functions. For example, this could involve retrieving text content and performing automatic searches, or retrieving geolocation information and using it as a destination for navigation. Typically, an application's user interface can display various types of controls, each displaying different content. For instance, a text display control might show text content, a location display control might show geolocation information, and a music sharing control might show music information.

[0003] Typically, when extracting content from a control, the operating system only extracts the text content within that control. For example, in an instant messaging application, when a user receives music shared by a friend and long-presses the music, the operating system extracts text information such as the song title, artist name, and album name from the control containing the music.

[0004] However, since there are many types of content in the control, extracting only the content of type A in the control will not meet the user's need to extract the target content of type B when the target content is type B. Furthermore, extracting only the content of type A in the control will not be possible if the control does not contain content of type A, resulting in a small amount of effective content being extracted. Here, effective content refers to the target content that the user needs the operating system to extract. Summary of the Invention

[0005] This disclosure provides a content extraction method, apparatus, terminal, and storage medium, which can solve the problem of limited extracted effective content. The technical solution is as follows:

[0006] According to a first aspect of this disclosure, a content extraction method is provided, applied in the operating system of a terminal, the method comprising:

[0007] Receive a selection operation on a target control, the selection operation being used to instruct the operating system to extract target content from the target control;

[0008] The control class name of the target control is determined based on the selection operation;

[0009] The extraction rule corresponding to the control class name is determined as the extraction rule for the target control, and the extraction rule is used to determine the extraction method of the target content;

[0010] The target content is extracted from the target control according to the extraction rules.

[0011] In an optional embodiment, the extraction rule includes an arithmetic expression used to select and extract control content from the target control, wherein the control content includes the target content.

[0012] The step of extracting the target content from the target control according to the extraction rules includes:

[0013] Retrieve the content of the target control;

[0014] Determine the control content that conforms to the arithmetic expression;

[0015] The target content is determined based on the arithmetic expression and the control content that conforms to the arithmetic expression.

[0016] In an optional embodiment, the extraction rule includes a content extraction path, which is a path used to extract control content from the target control, wherein the control content includes the target content;

[0017] The step of extracting the target content from the target control according to the extraction rules includes:

[0018] Extract the target content from the target control according to the content extraction path.

[0019] In an optional embodiment, the target control is a control in a target application, the target application has a version number, and the content extraction path is the path in the extraction path table that corresponds to the version number;

[0020] Before extracting the target content from the target control according to the content extraction path, the method further includes:

[0021] Determine the version number of the target application;

[0022] Based on the version number, the path corresponding to the version number is queried in the extraction path table as the content extraction path.

[0023] In an optional embodiment, the target control is the topmost control corresponding to the selection operation;

[0024] The step of extracting the target content from the target control according to the content extraction path further includes:

[0025] The content extraction path is recursively performed starting from the topmost control and proceeding downwards layer by layer. The recursion is used to obtain the content in the target control and the content in controls located below the target control.

[0026] In an optional embodiment, before determining the extraction rule corresponding to the control class name as the extraction rule for the target control, the method further includes:

[0027] The server receives the extraction rules sent by the server, which is used to receive the configuration operation corresponding to the control class name and generate the extraction rules according to the configuration operation.

[0028] According to a second aspect of this disclosure, a content extraction method is provided, applied in a server, the method comprising:

[0029] Receive configuration operations corresponding to the target control class name, wherein the target control class name is the control class name corresponding to the target application;

[0030] The configuration operation generates an extraction rule corresponding to the target control class name. The extraction rule is used to extract the target content in the target control. The control class name of the target control is the target control class name.

[0031] The extraction rules are sent to the terminal that has the target application installed.

[0032] In an optional embodiment, the extraction rule includes an arithmetic expression used to select and extract control content in the target control, the control content including the target content, and the configuration operation includes a formula configuration operation;

[0033] The step of generating extraction rules corresponding to the target control class name based on the configuration operation includes:

[0034] The arithmetic expression is generated based on the formula configuration operation;

[0035] Extraction rules corresponding to the target control class name are generated based on the arithmetic expression.

[0036] In an optional embodiment, the extraction rule includes a content extraction path, which is a path used to extract control content from the target control, the control content including the target content, and the configuration operation includes a path configuration operation;

[0037] The step of generating extraction rules corresponding to the target control class name based on the configuration operation includes:

[0038] The content extraction path is generated based on the path configuration operation;

[0039] Extraction rules corresponding to the target control class name are generated based on the content extraction path.

[0040] In an optional embodiment, the target application has a version number, and the content extraction path is one of the paths in the extraction path table;

[0041] The extraction rules generated based on the content extraction path and corresponding to the target control class name include:

[0042] Determine the version number of the target application;

[0043] The correspondence between the content extraction path and the version number is stored in the extraction path table;

[0044] Extraction rules corresponding to the target control class name are generated based on the extraction path table.

[0045] According to a third aspect of this disclosure, a content extraction apparatus is provided, the apparatus comprising:

[0046] The first receiving module is configured to receive a selection operation on a target control, the selection operation being used to instruct the operating system to extract target content from the target control;

[0047] The determination module is configured to determine the control class name of the target control based on the selection operation;

[0048] The determining module is further configured to determine the extraction rule corresponding to the control class name as the extraction rule for the target control, and the extraction rule is used to determine the extraction method of the target content;

[0049] The extraction module is configured to extract the target content from the target control according to the extraction rules.

[0050] In an optional embodiment, the extraction rule includes an arithmetic expression used to select and extract control content from the target control, wherein the control content includes the target content.

[0051] The extraction module includes:

[0052] The acquisition submodule is configured to acquire the content of the control in the target control;

[0053] The determination submodule is configured to determine the control content that conforms to the arithmetic expression within the control content;

[0054] The determining submodule is further configured to determine the target content based on the arithmetic expression and the control content that conforms to the arithmetic expression.

[0055] In an optional embodiment, the extraction rule includes a content extraction path, which is a path used to extract control content from the target control, wherein the control content includes the target content;

[0056] The extraction module is further configured to extract the target content from the target control based on the content extraction path.

[0057] In an optional embodiment, the target control is a control in a target application, the target application has a version number, and the content extraction path is the path in the extraction path table that corresponds to the version number;

[0058] The determining module is also configured to determine the version number of the target application;

[0059] The device further includes:

[0060] The query module is configured to query the extraction path table based on the version number and use the path corresponding to the version number as the content extraction path.

[0061] In an optional embodiment, the target control is the topmost control corresponding to the selection operation;

[0062] The extraction module is further configured to recursively extract content from the topmost control and downwards layer by layer according to the content extraction path. The recursion is used to obtain the content in the target control and the content in the controls below the target control.

[0063] In an optional embodiment, the first receiving module is further configured to receive the extraction rules sent by the server, the server being used to receive configuration operations corresponding to the control class name and generate the extraction rules according to the configuration operations.

[0064] According to a fourth aspect of this disclosure, a content extraction apparatus is provided, the apparatus comprising:

[0065] The second receiving module is configured to receive a configuration operation corresponding to a target control class name, wherein the target control class name is a control class name corresponding to the target application.

[0066] The generation module is configured to generate extraction rules corresponding to the target control class name according to the configuration operation. The extraction rules are used to extract target content in the target control, and the control class name of the target control is the target control class name.

[0067] The sending module is configured to send the extraction rules to a terminal on which the target application is installed.

[0068] In an optional embodiment, the extraction rule includes an arithmetic expression used to select and extract control content in the target control, the control content including the target content, and the configuration operation includes a formula configuration operation;

[0069] The generation module is further configured to generate the arithmetic expression based on the formula configuration operation; and to generate extraction rules corresponding to the target control class name based on the arithmetic expression.

[0070] In an optional embodiment, the extraction rule includes a content extraction path, which is a path used to extract control content from the target control, the control content including the target content, and the configuration operation includes a path configuration operation;

[0071] The generation module is further configured to generate the content extraction path based on the path configuration operation; and to generate extraction rules corresponding to the target control class name based on the content extraction path.

[0072] In an optional embodiment, the target application has a version number, and the content extraction path is one of the paths in the extraction path table;

[0073] The generation module is further configured to determine the version number of the target application; store the correspondence between the content extraction path and the version number in the extraction path table; and generate extraction rules corresponding to the target control class name based on the extraction path table.

[0074] According to a fifth aspect of this disclosure, a terminal is provided, the terminal including a processor and a memory, the memory storing at least one instruction, the instruction being loaded and executed by the processor to implement the content extraction method as described in the first aspect of the embodiments of this disclosure and any of its optional embodiments.

[0075] According to a sixth aspect of this disclosure, a server is provided, the server including a processor and a memory, the memory storing at least one instruction, the instruction being loaded and executed by the processor to implement the content extraction method as described in the second aspect of the embodiments of this disclosure above and any of its alternative embodiments.

[0076] According to a seventh aspect of this disclosure, a computer-readable storage medium is provided, the storage medium storing at least one instruction that is loaded and executed by a processor to implement the content extraction method as described in the first aspect of the embodiments of this disclosure and any of its alternative embodiments.

[0077] The beneficial effects of the technical solutions provided in this disclosure include at least the following:

[0078] The content in the target control is extracted by extracting rules. Since the extraction rules are corresponding to the control class name of the target control, that is, the extraction rules are adaptively set for the control class name of the target control. This enables more targeted extraction of the target content in the target control, avoiding the problem of less effective content being extracted due to extracting only one type of content. Attached Figure Description

[0079] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0080] Figure 1 This is a schematic diagram illustrating the implementation environment of a content extraction method provided in an exemplary embodiment of this disclosure;

[0081] Figure 2 This is a flowchart of a content extraction method provided in an exemplary embodiment of this disclosure;

[0082] Figure 3 This is a flowchart of a content extraction method provided in another exemplary embodiment of this disclosure;

[0083] Figure 4 This is a flowchart of a content extraction method provided in another exemplary embodiment of this disclosure;

[0084] Figure 5 This is a structural block diagram of a content extraction apparatus provided in an exemplary embodiment of this disclosure;

[0085] Figure 6 This is a structural block diagram of a content extraction apparatus provided in another exemplary embodiment of this disclosure;

[0086] Figure 7 This is a structural block diagram of a terminal provided in an exemplary embodiment of this disclosure;

[0087] Figure 8 This is a structural block diagram of a server provided in an exemplary embodiment of this disclosure. Detailed Implementation

[0088] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0089] First, let me introduce the terms used in this disclosure:

[0090] Control Class Name: The control class name (English: class) is the class name of a control. Each control has a corresponding control class name, such as: the control class name of a button is button, the control class name of a text box is textview, and the control class name of a list is listview. Optionally, this control class name can also be customized by the application developer. For example, by debugging application A, the control class name of the text box in application A can be obtained as "com.tencent.mm.plugin.sns.ui.widget.SnsPostDescPreloadTextView".

[0091] Extraction Rules: These extraction rules refer to the rules for extracting content from the target control. Optionally, these extraction rules correspond to the control class name; that is, control class name A corresponds to extraction rule a, and control class name B corresponds to extraction rule b. Optionally, these extraction rules are used to determine how to extract the control content from the target control. Optionally, these extraction rules include at least one of an arithmetic expression and a content extraction path.

[0092] Arithmetic Expression: Arithmetic expressions are used to select and extract control content from a target control. For example, control content a, control content b, and control content c are obtained from a target control. This target control corresponds to control class name a. The extraction rule for control class name a includes the arithmetic expression: CE_c == null ? (a+b):c. That is, when control content c is not empty, control content c is used as the target content in the extracted target control; when control content c is empty, control content a + control content b is used as the target content in the extracted target control.

[0093] Content extraction path: This content extraction path is used to extract the content of the control in the target control.

[0094] Control content: Control content is used to represent the parameter content in the control, such as: text content, image content displayed in the control, or links, product information, information sources, etc. included in the control.

[0095] Figure 1 This is a schematic diagram illustrating the implementation environment of a content extraction method provided in an exemplary embodiment of this disclosure, such as... Figure 1 As shown, the implementation environment includes a terminal 11, a communication network 12, and a server 13. The terminal 11 and the server 13 are connected through the communication network 12.

[0096] Terminal 11 can be a smartphone, tablet, e-book reader, laptop, desktop computer, etc. Optionally, terminal 11 has a touchscreen, which can be a regular touchscreen, a touchscreen supporting hover touch, or a pressure-sensitive touchscreen. Terminal 11 has an operating system and at least one application installed. The operating system can be Android or iOS.

[0097] Terminal 11 and server 13 are connected via communication network 12, which can be a wired network or a wireless network. The wired network can be a metropolitan area network, a local area network, a fiber optic network, etc., and the wireless network can be a mobile communication network or a Wi-Fi network.

[0098] Server 13 is used to configure the above extraction rules and send the extraction rules to terminal 11 through communication network 12.

[0099] The content extraction method involved in the embodiments of this disclosure will be explained in conjunction with the above definitions. Please refer to [link / reference]. Figure 2 , Figure 2 This is a flowchart of a content extraction method provided in an exemplary embodiment of this disclosure, such as... Figure 2 As shown, taking the application of this content extraction method in the terminal's operating system as an example, the content extraction method includes:

[0100] Step 201: Receive the selection operation on the target control.

[0101] This selection action instructs the operating system to extract the target content from the target control.

[0102] Optionally, the target control is displayed in the user interface of the terminal, and the user can select the target control in the user interface. Optionally, when the terminal is a mobile terminal such as a mobile phone or tablet, the user can long-press the target control in the user interface to select the target control. When the terminal's display screen is a pressure-sensitive touch screen, the user can also use pressure touch to select the target control. When the terminal is a desktop computer or a portable laptop, the user can complete the selection operation of the target control through input from an external device, such as clicking the target control with a mouse or entering a shortcut key on the keyboard.

[0103] Step 202: Determine the control class name of the target control based on the selection operation.

[0104] Optionally, when the selection operation is a long press, pressure touch, or click operation to select a target control, the method for determining the control class name of the target control includes at least the following: after receiving the selection operation, the operating system obtains the coordinate position of the selection operation in the user interface, determines the selected target control based on the coordinate position, and obtains the control class name of the target control from the target application corresponding to the target control; when the selection operation is an operation completed by entering a keyboard shortcut, the method for determining the control class name of the target control includes at least the following: the operating system pre-stores the correspondence between the shortcut keys corresponding to the user interface where the target control is located and the triggered operations, searches the correspondence based on the received shortcut key to find the selection operation corresponding to the shortcut key as a selection operation of the target control, and obtains the control class name of the target control from the target application corresponding to the target control.

[0105] Step 203: Determine the extraction rule corresponding to the control class name as the extraction rule for the target control.

[0106] Optionally, this extraction rule is used to determine how the target content is extracted.

[0107] Optionally, the operating system pre-stores the correspondence between control class names and extraction rules. This correspondence is illustrated in a table below:

[0108] Table 1

[0109] Control Class Name Extraction rules Textview Rule a Button Rule b

[0110] As shown in Table 1, the control class name "Textview" corresponds to extraction rule "rule a", and the control class name "Button" corresponds to extraction rule "rule b".

[0111] Optionally, the extraction rule includes at least one of an arithmetic expression and a content extraction path.

[0112] Step 204: Extract the target content from the target control according to the extraction rules.

[0113] Optionally, after determining the extraction rule corresponding to the control class name by the control class name, the target content is extracted by the extraction rule.

[0114] In summary, the content extraction method provided in this embodiment extracts content from the target control through extraction rules. Since the extraction rules correspond to the control class name of the target control, that is, the extraction rules are adaptively set for the control class name of the target control, it can achieve more targeted extraction of target content from the target control, avoiding the problem of less effective content extracted due to extracting only one type of content.

[0115] In an optional embodiment, the extraction rule includes at least one of an arithmetic expression and a content extraction path, wherein the arithmetic expression is used to select and extract control content from the target control, and the content extraction path is a path used to extract control content from the target control, the control content including the target content. Please refer to... Figure 3 , Figure 3 This is a flowchart of a content extraction method provided by another exemplary embodiment of this disclosure, such as... Figure 3 As shown, taking the application of this content extraction method in the terminal's operating system as an example, the content extraction method includes:

[0116] Step 301: Receive the selection operation on the target control.

[0117] This selection action instructs the operating system to extract the target content from the target control.

[0118] Optionally, the target control is displayed in the terminal's user interface, where the user can select it.

[0119] Step 302: Determine the control class name of the target control based on the selection operation.

[0120] Optionally, when the selection operation is a long press, pressure touch, or click operation to select a target control, the method for determining the control class name of the target control includes at least the following: after receiving the selection operation, the operating system obtains the coordinate position of the selection operation in the user interface, determines the selected target control based on the coordinate position, and obtains the control class name of the target control from the target application corresponding to the target control; when the selection operation is an operation completed by entering a keyboard shortcut, the method for determining the control class name of the target control includes at least the following: the operating system pre-stores the correspondence between the shortcut keys corresponding to the user interface where the target control is located and the triggered operations, searches the correspondence based on the received shortcut key to find the selection operation corresponding to the shortcut key as a selection operation of the target control, and obtains the control class name of the target control from the target application corresponding to the target control.

[0121] Step 303: Determine the extraction rule corresponding to the control class name as the extraction rule for the target control.

[0122] Optionally, this extraction rule is used to determine how the target content is extracted.

[0123] Optionally, the extraction rule includes at least one of an arithmetic expression and a content extraction path; that is, the extraction rule may include one of an arithmetic expression and a content extraction path, or it may include both an arithmetic expression and a content extraction path.

[0124] Step 304: Obtain the control content in the target control.

[0125] Optionally, the operating system can obtain the control content from the target control through reflection calls, or it can extract the control content through the extraction path corresponding to the control class name of the target control.

[0126] Optionally, when extracting control content using the extraction path corresponding to the control class name, the extraction rule must include at least an arithmetic expression and an extraction path. This is illustrated by assuming the extraction rule includes both an arithmetic expression and a content extraction path. The operating system pre-stores the correspondence between control class names and extraction rules; please refer to Table 2 below.

[0127] Table 2

[0128]

[0129]

[0130] For illustrative purposes, the control class name is ListView, and the extracted control content A is shown below: www.xxxxx.com.xxxxIf we extract the content C of the control: "Shared by xxx", and extract the content D of the control: "This is a video from me, come and see", then when the link in the content A of the control is empty, the content C + the content D of the control will be used as the target content; when the link in the content A of the control is not empty, the link will be used as the target content.

[0131] Step 305: Determine the control content that matches the arithmetic expression.

[0132] The control content that conforms to the arithmetic expression is the control content that participates in the arithmetic logic of the arithmetic expression. For example, if the control content obtained from the target control includes control content A, control content B, and control content C, and the arithmetic expression is control content A + control content C, then control content A and control content C are the control content that conforms to the arithmetic expression.

[0133] Step 306: Determine the target content based on the arithmetic expression and the content of the control that conforms to the arithmetic expression.

[0134] Optionally, based on the arithmetic expression, the target content in the control content is determined after performing operations such as combining and selecting the control content that conforms to the arithmetic expression.

[0135] As illustrated in Table 2 above, for a control named Textview, the content extracted via extraction path a includes at least control content A and control content B. The arithmetic expression determines the final target content as control content A + control content B. For a control named Button, the content extracted via extraction path b includes at least control content C. The arithmetic expression determines the final target content as control content C. For a control named Listview, the content extracted via extraction path c includes at least control content A, control content C, and control content D. In the arithmetic expression, null indicates an empty parameter. According to the arithmetic expression, when control content A is not empty, control content A is determined as the final target content; when control content A is empty, control content C + control content D is determined as the final target content.

[0136] Step 307: Extract the target content from the target control based on the content extraction path.

[0137] Optionally, if the extraction rules do not include the above arithmetic expression, the content of the control is extracted from the target control according to the content extraction path, and the extracted control content is used as the target content.

[0138] Optionally, the content extraction path can also be a path for extracting specified target content, and the specified target content can be extracted from the target control according to the content extraction path.

[0139] Optionally, since applications typically have multiple versions, and each version may use different protocols, the same content extraction path may display different path content in different versions. Therefore, for the same content extraction path and different versions, an extraction path table is included, which includes the correspondence between content extraction paths and version numbers. Optionally, if the target control is a control in the target application, and the target application has a corresponding version number, and the content extraction path is the path corresponding to the version number in the extraction path table, then before extracting the target content from the target control based on the content extraction path, it is also necessary to determine the version number of the target application and look up the path corresponding to the version number in the extraction path table as the content extraction path.

[0140] For illustrative purposes, please refer to Table 3 below for the extraction path table:

[0141] Table 3

[0142]

[0143] Optionally, when the target control is the topmost control corresponding to the selection operation, the content extraction path is recursively performed starting from the topmost control and proceeding downwards layer by layer. This recursion is used to retrieve the content of the target control and the content of controls located below it.

[0144] It is worth noting that steps 304 to 306 and step 307 can be performed only, or only step 307 can be performed.

[0145] In summary, the content extraction method provided in this embodiment extracts content from the target control through extraction rules. Since the extraction rules correspond to the control class name of the target control, that is, the extraction rules are adaptively set for the control class name of the target control, it can achieve more targeted extraction of target content from the target control, avoiding the problem of less effective content extracted due to extracting only one type of content.

[0146] The content extraction method provided in this embodiment selects or combines the control content obtained from the target control through arithmetic expressions. This allows for the extraction of control content from the target control that better meets the user's requirements, resulting in target content that better meets the user's needs and increasing the proportion of effective content extracted.

[0147] In an optional embodiment, the extraction rules are sent from the server to the terminal. Please refer to [reference needed]. Figure 4 , Figure 4 This is a flowchart of a content extraction method provided by another exemplary embodiment of this disclosure, such as... Figure 4 As shown, the content extraction method includes:

[0148] Step 401: The server receives the configuration operation corresponding to the target control class name.

[0149] Optionally, the target control class name is the control class name corresponding to the target application.

[0150] Alternatively, the configuration operation that the server typically receives corresponding to the target control class name is an operation in which the administrator inputs code instructions through an external input device, which are used to configure the target control class name.

[0151] Optionally, the target control class name can be a generic class name, such as the generic class name of a text box being "textview", the generic class name of a list being "listview", and the generic class name of a button control being "button". Optionally, the target control class name can also be a custom class name defined by the application developer, which is different from the generic class name. For example, in an application, the class name of a text box is customized as "com.tencent.mm.plugin.sns.ui.widget.TextView". Then, the administrator can obtain the custom class name of the control in the application by debugging the application and perform corresponding configuration operations for the custom class name.

[0152] Step 402: The server generates extraction rules corresponding to the target control class name based on the configuration operation.

[0153] Optionally, the extraction rule is used to extract the target correspondence in the target control, and the control class name of the target control is the target control class name mentioned above.

[0154] Optionally, the extraction rule includes at least one of arithmetic expressions and content extraction paths. Optionally, the extraction rule generated based on the configuration operation includes at least one of the following:

[0155] First, the extraction rule includes an arithmetic expression, which is used to select and extract the content of the control in the target control. The content of the control includes the target content. The configuration operation includes a formula configuration operation, which generates an arithmetic expression based on the formula configuration operation, and generates an extraction rule corresponding to the class name of the target control based on the arithmetic expression.

[0156] Second, the extraction rule includes a content extraction path, which is a path used to extract the content of the control in the target control. The content of the control includes the target content. The configuration operation includes a path configuration operation, which generates a content extraction path based on the path configuration operation, and generates an extraction rule corresponding to the class name of the target control based on the content extraction path.

[0157] It is worth noting that when configuring the content extraction path, the version of the target application also needs to be considered. That is, the extraction path corresponding to the same control class name may be different for different version numbers. The content extraction path is one of the paths in the extraction path table. Therefore, when configuring the content extraction path, first determine the version number of the target application, store the correspondence between the content extraction path and the version number in the extraction path table, and generate the extraction rules corresponding to the target control class name based on the extraction path table.

[0158] Third, the extraction rule includes an arithmetic expression and a content extraction path. The extraction rule is generated based on the configuration methods for the arithmetic expression in the first case and the content extraction path in the second case. It is worth noting that when the content extraction path corresponds to different version numbers, the arithmetic expression also differs based on that version number, and the arithmetic expression corresponds to the content extraction path. For illustration, the expression for the target control class name A and its extraction rule is as follows:

[0159] A, [list] path, [list] content

[0160] Here,

list

list

[0161] As an illustration, the expression for the control class name and extraction rule is in the form of:

[0162] "com.tencent.mm.plugin.sns.ui.widget.SnsPostDescPreloadTextView","fZf / Text View / text / Object / vXw / CharSequence,"fYV / TextView / text / Object / vWU / CharSeque nce,miuiCE_fZf / TextView / text / Object / vXw / CharSequence+fYV / TextView / text / Ob ject / vWU / CharSequence, where "com.tencent.mm.plugin.sns.ui.widget.SnsPost DescPreloadTextView" is the control class name, "fZf / TextView / text / Object / vXw / CharSequence," fYV / TextView / text / Object / vWU / CharSequence, is the extraction path, miuiCE_fZf / Text View / text / Object / vXw / CharSequence+fYV / TextView / text / Object / vWU / CharSeque nce is an arithmetic expression.

[0163] The correspondence between extraction rules and control class names is shown in Table 4 below:

[0164] Table 4

[0165]

[0166] Step 403: The server sends the extraction rule to the terminal with the target application installed.

[0167] Optionally, after generating the extraction rules, the server sends the extraction rules to the terminal where the target application is installed.

[0168] Alternatively, the server may send the extraction rule to the terminal with the target application installed after the extraction rule has been regenerated due to a version update of the target application.

[0169] Optionally, the server can also send extraction rules to terminals of a specific brand.

[0170] Optionally, when the target control in the target application has a custom class name, the server can send the extraction rules only to the terminal where the target application is installed; when the target control in the target application has a generic class name, the server can send the extraction rules to any terminal.

[0171] Step 404: The terminal receives the extraction rules sent by the server.

[0172] The server is used to receive configuration operations corresponding to the control class name and generate the extraction rules based on the configuration operations.

[0173] Step 405: The terminal receives the selection operation on the target control.

[0174] This selection action instructs the operating system to extract the target content from the target control.

[0175] Optionally, the target control is displayed in the terminal's user interface, where the user can select it.

[0176] Step 406: The terminal determines the control class name of the target control based on the selected operation.

[0177] Optionally, when the selection operation is a long press, pressure touch, or click operation to select a target control, the method for determining the control class name of the target control includes at least the following: after receiving the selection operation, the operating system obtains the coordinate position of the selection operation in the user interface, determines the selected target control based on the coordinate position, and obtains the control class name of the target control from the target application corresponding to the target control; when the selection operation is an operation completed by entering a keyboard shortcut, the method for determining the control class name of the target control includes at least the following: the operating system pre-stores the correspondence between the shortcut keys corresponding to the user interface where the target control is located and the triggered operations, searches the correspondence based on the received shortcut key to find the selection operation corresponding to the shortcut key as a selection operation of the target control, and obtains the control class name of the target control from the target application corresponding to the target control.

[0178] Step 407: The terminal determines the extraction rule corresponding to the control class name as the extraction rule for the target control.

[0179] Optionally, this extraction rule is used to determine how the target content is extracted.

[0180] Optionally, the extraction rule includes at least one of an arithmetic expression and a content extraction path; that is, the extraction rule may include one of an arithmetic expression and a content extraction path, or it may include both an arithmetic expression and a content extraction path.

[0181] In this embodiment, the extraction rule includes an arithmetic expression and a content extraction path as an example for illustration.

[0182] Step 408: The terminal obtains the control content in the target control.

[0183] Optionally, the operating system can extract the content of the control by using the content extraction path corresponding to the control class name of the target control.

[0184] Optionally, the operating system pre-stores the correspondence between control class names and extraction rules. Please refer to Table 2 or Table 4 above for the correspondence.

[0185] Step 409: The terminal determines the control content that matches the arithmetic expression.

[0186] The control content that conforms to the arithmetic expression is the control content that participates in the arithmetic logic of the arithmetic expression. For example, if the control content obtained from the target control includes control content A, control content B, and control content C, and the arithmetic expression is control content A + control content C, then control content A and control content C are the control content that conforms to the arithmetic expression.

[0187] Step 410: The terminal determines the target content based on the arithmetic expression and the content of the control that conforms to the arithmetic expression.

[0188] Optionally, based on the arithmetic expression, the target content in the control content is determined after performing operations such as combining and selecting the control content that conforms to the arithmetic expression.

[0189] As illustrated in Table 2 above, for a control named Textview, the content extracted via extraction path a includes at least control content A and control content B. The arithmetic expression determines the final target content as control content A + control content B. For a control named Button, the content extracted via extraction path b includes at least control content C. The arithmetic expression determines the final target content as control content C. For a control named Listview, the content extracted via extraction path c includes at least control content A, control content C, and control content D. In the arithmetic expression, null indicates an empty parameter. According to the arithmetic expression, when control content A is not empty, control content A is determined as the final target content; when control content A is empty, control content C + control content D is determined as the final target content.

[0190] In summary, the content extraction method provided in this embodiment extracts content from the target control through extraction rules. Since the extraction rules correspond to the control class name of the target control, that is, the extraction rules are adaptively set for the control class name of the target control, it can achieve more targeted extraction of target content from the target control, avoiding the problem of less effective content extracted due to extracting only one type of content.

[0191] The content extraction method provided in this embodiment selects or combines the control content obtained from the target control using arithmetic expressions, thereby extracting control content from the target control that better meets the user's requirements and obtaining target content that better meets the user's requirements.

[0192] The content extraction method provided in this embodiment, when the target application includes different version numbers, lists the content extraction path and arithmetic expression for different version numbers, to avoid the inability to obtain control content in the new version of the target application due to version updates.

[0193] Figure 5 This is a structural block diagram of a content extraction device provided in an exemplary embodiment of the present disclosure. The device includes: a first receiving module 51, a determining module 52, and an extraction module 53.

[0194] The first receiving module 51 is configured to receive a selection operation on a target control, the selection operation being used to instruct the operating system to extract target content from the target control;

[0195] The determination module 52 is configured to determine the control class name of the target control based on the selection operation;

[0196] The determining module 52 is further configured to determine the extraction rule corresponding to the control class name as the extraction rule for the target control, and the extraction rule is used to determine the extraction method of the target content;

[0197] Extraction module 53 is configured to extract the target content from the target control according to the extraction rules.

[0198] In an optional embodiment, the extraction rule includes an arithmetic expression used to select and extract control content from the target control, wherein the control content includes the target content.

[0199] The extraction module 53 includes:

[0200] The acquisition submodule is configured to acquire the content of the control in the target control;

[0201] The determination submodule is configured to determine the control content that conforms to the arithmetic expression within the control content;

[0202] The determining submodule is further configured to determine the target content based on the arithmetic expression and the control content that conforms to the arithmetic expression.

[0203] In an optional embodiment, the extraction rule includes a content extraction path, which is a path used to extract control content from the target control, wherein the control content includes the target content;

[0204] The extraction module 53 is further configured to extract the target content from the target control according to the content extraction path.

[0205] In an optional embodiment, the target control is a control in a target application, the target application has a version number, and the content extraction path is the path in the extraction path table that corresponds to the version number;

[0206] The determining module 52 is also configured to determine the version number of the target application;

[0207] The device further includes:

[0208] The query module is configured to query the extraction path table based on the version number and use the path corresponding to the version number as the content extraction path.

[0209] In an optional embodiment, the target control is the topmost control corresponding to the selection operation;

[0210] The extraction module 53 is further configured to recursively extract content from the topmost control and downwards layer by layer according to the content extraction path. The recursion is used to obtain the content in the target control and the content in the controls below the target control.

[0211] In an optional embodiment, the first receiving module 51 is further configured to receive the extraction rules sent by the server, the server being used to receive the configuration operation corresponding to the control class name and generate the extraction rules according to the configuration operation.

[0212] In summary, the content extraction device provided in this embodiment extracts content from a target control through extraction rules. Since the extraction rules correspond to the control class name of the target control, that is, the extraction rules are adaptively set for the control class name of the target control, it can achieve more targeted extraction of target content from the target control, avoiding the problem of less effective content being extracted due to extracting only a certain type of content.

[0213] Figure 6 This is a structural block diagram of a content extraction apparatus provided in an exemplary embodiment of the present disclosure. The apparatus includes: a second receiving module 61, a generating module 62, and a sending module 63.

[0214] The second receiving module 61 is configured to receive a configuration operation corresponding to a target control class name, wherein the target control class name is a control class name corresponding to a target application.

[0215] The generation module 62 is configured to generate an extraction rule corresponding to the target control class name according to the configuration operation. The extraction rule is used to extract target content in the target control. The control class name of the target control is the target control class name.

[0216] Sending module 63 is configured to send the extraction rules to a terminal on which the target application is installed.

[0217] In an optional embodiment, the extraction rule includes an arithmetic expression used to select and extract control content in the target control, the control content including the target content, and the configuration operation includes a formula configuration operation;

[0218] The generation module 62 is further configured to generate the arithmetic expression according to the formula configuration operation; and to generate extraction rules corresponding to the target control class name according to the arithmetic expression.

[0219] In an optional embodiment, the extraction rule includes a content extraction path, which is a path used to extract control content from the target control, the control content including the target content, and the configuration operation includes a path configuration operation;

[0220] The generation module 62 is further configured to generate the content extraction path based on the path configuration operation; and to generate extraction rules corresponding to the target control class name based on the content extraction path.

[0221] In an optional embodiment, the target application has a version number, and the content extraction path is one of the paths in the extraction path table;

[0222] The generation module 62 is further configured to determine the version number of the target application; store the correspondence between the content extraction path and the version number in the extraction path table; and generate extraction rules corresponding to the target control class name based on the extraction path table.

[0223] In summary, the content extraction device provided in this embodiment extracts content from a target control through extraction rules. Since the extraction rules correspond to the control class name of the target control, that is, the extraction rules are adaptively set for the control class name of the target control, it can achieve more targeted extraction of target content from the target control, avoiding the problem of less effective content being extracted due to extracting only a certain type of content.

[0224] Figure 7 This is a structural block diagram of a terminal according to another exemplary embodiment. For example, the terminal 700 may be a mobile phone, tablet computer, desktop computer, or laptop computer.

[0225] Reference Figure 7 The terminal 700 may include one or more of the following components: a processing component 702, a memory 704, a power supply component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, and a communication component 716.

[0226] Processing component 702 typically controls the overall operation of terminal 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 702 may include one or more processors 718 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 702 may include one or more modules to facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.

[0227] Memory 704 is configured to store various types of data to support the operation of terminal 700. Examples of this data include instructions for any application or method operating on terminal 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0228] Power supply component 706 provides power to various components of terminal 700. Power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal 700.

[0229] Multimedia component 708 includes a screen that provides an output interface between the terminal 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When the terminal 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0230] Audio component 710 is configured to output and / or input audio signals. For example, audio component 710 includes a microphone (MIC) configured to receive external audio signals when terminal 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 704 or transmitted via communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.

[0231] I / O interface 412 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0232] Sensor assembly 714 includes one or more sensors for providing state assessments of various aspects of terminal 700. For example, sensor assembly 714 can detect the on / off state of terminal 700, the relative positioning of components such as the display and keypad of terminal 700, changes in the position of terminal 700 or a component of terminal 700, the presence or absence of user contact with terminal 700, the orientation or acceleration / deceleration of terminal 700, and temperature changes of terminal 700. Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 714 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0233] Communication component 716 is configured to facilitate wired or wireless communication between terminal 700 and other devices. Terminal 700 can access wireless networks based on communication standards, such as Wi-Fi, 2G, 3G, or 4G, or combinations thereof. In one exemplary embodiment, communication component 716 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 716 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0234] In an exemplary embodiment, terminal 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0235] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, which can be executed by a processor 718 of a terminal 700 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0236] A non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by the processor of terminal 700, terminal 700 is able to perform the above-described method.

[0237] Figure 8 This is a structural block diagram of a server according to an exemplary embodiment. For example, server 800 may be provided as a network-side device. (Refer to...) Figure 8 Server 800 includes processing component 802, which further includes one or more processors, and memory resources represented by memory 804 for storing instructions, such as applications, that can be executed by processing component 802. The applications stored in memory 804 may include one or more modules, each corresponding to a set of instructions. Furthermore, processing component 802 is configured to execute instructions to perform the aforementioned content extraction method.

[0238] Server 800 may also include a power supply component 806 configured to perform power management of server 800, a wired or wireless network interface 808 configured to connect server 800 to a network, and an input / output (I / O) interface 810. Server 800 may operate on an operating system stored in memory 804, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, or similar.

[0239] This disclosure also provides a computer-readable storage medium that stores at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the content extraction method described above. Optionally, the computer-readable storage medium includes a high-speed access memory or a non-volatile memory.

[0240] This disclosure also provides a computer program product containing instructions that, when run on a terminal, cause a processor to perform the methods described in the above aspects.

[0241] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0242] The sequence numbers of the embodiments disclosed above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0243] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0244] The above description is only a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.

Claims

1. A content extraction method characterized by, Applied to an operating system of a terminal, the method comprises: receiving a selection operation on a target control, the selection operation being used to instruct the operating system to extract target content in the target control, the target control being a control in a target application program, the target control comprising at least one of a button, a list and a custom control; obtaining a control class name of the target control from a target application program corresponding to the target control; determining an extraction rule corresponding to the control class name as an extraction rule of the target control, the extraction rule being used to determine an extraction manner of the target content, the extraction rule comprising a content extraction path; extracting control content in the target control according to the content extraction path, the control content comprising the target content, the content extraction path being determined according to a version number of the target application program, the control content comprising at least one of image content, commodity information, information source and a web link; when the control class name is implemented as a text box and / or a button control, determining the control content as the target content; when the control class name is implemented as a list, determining the target content from the control content according to a web state of the web link, the web state indicating whether the web link is empty.

2. The method of claim 1, wherein, the target control being an uppermost control corresponding to the selection operation; the method further comprising: recursively extracting content in the target control and content in a control under the target control according to the content extraction path from the uppermost control.

3. The method according to claim 1 or 2, characterized in that, before the determination of the extraction rule corresponding to the control class name as the extraction rule of the target control, the method further comprising: receiving the extraction rule sent by a server, the server being used to receive a configuration operation corresponding to the control class name and generate the extraction rule according to the configuration operation.

4. A content extraction method characterized by, applied to a server, the method comprising: receiving a configuration operation corresponding to a target control class name, the target control class name being a control class name corresponding to a target application program; generating an extraction rule corresponding to the target control class name according to the configuration operation, the extraction rule being used to extract target content in a target control, the extraction rule comprising a content extraction path, the control class name of the target control being the target control class name, the content extraction path being a path for extracting control content in the target control according to a version number of the target application program from an extraction path table, the control content comprising the target content, the control content comprising at least one of image content, commodity information, information source and a web link; generating the extraction rule corresponding to the target control class name according to the content extraction path; sending the extraction rule to a terminal in which the target application program is installed. The extraction rule comprises: when the control class name is realized as a text box and / or a button control, the control content is determined as the target content; and when the control class name is realized as a list, the target content is determined from the control content according to a web page state of the web page link, the web page state indicating whether the web page link is empty.

5. A content extraction apparatus characterized by comprising: The device comprises: The first receiving module is configured to receive a selection operation on a target control, the selection operation being used to instruct an operating system to extract target content in the target control, the target control comprising at least one of a button, a list and a custom control; The determining module is configured to acquire a control class name of the target control from a target application program corresponding to the target control; The determining module is further configured to determine an extraction rule corresponding to the control class name as an extraction rule of the target control, the extraction rule being used to determine an extraction manner of the target content, the extraction rule comprising a content extraction path; The acquiring submodule is configured to extract control content in the target control according to the content extraction path, the control content comprising the target content, the content extraction path being determined according to a version number of the target application program, and the control content comprising at least one of image content, commodity information, information source and a web page link; The determining submodule is configured to determine the control content as the target content when the control class name is realized as a text box and / or a button control, and to determine the target content from the control content according to a web page state of the web page link when the control class name is realized as a list, the web page state indicating whether the web page link is empty.

6. The apparatus of claim 5, wherein, The target control is an uppermost control corresponding to the selection operation; The extraction module is further configured to start from the uppermost control and recursively go down layer by layer according to the content extraction path, the recursion being used to acquire content in the target control and content in a control under the target control.

7. The apparatus of claim 5 or 6, wherein, The first receiving module is further configured to receive the extraction rule sent by a server, the server being used to receive a configuration operation corresponding to the control class name and generate the extraction rule according to the configuration operation.

8. A content extraction apparatus characterized by comprising: The device comprises: The second receiving module is configured to receive a configuration operation corresponding to a target control class name, the target control class name being a control class name corresponding to a target application program; The generating module is configured to generate an extraction rule corresponding to the target control class name according to the configuration operation, the extraction rule being used to extract target content in a target control, the extraction rule comprising a content extraction path, the control class name of the target control being the target control class name, the content extraction path being a path used to extract control content in the target control according to a version number of the target application program and determined from an extraction path table, the control content comprising the target content, and the control content comprising at least one of image content, commodity information, information source and a web page link; The generation module is further configured to generate an extraction rule corresponding to the target control class name according to the content extraction path; The sending module is configured to send the extraction rule to a terminal on which the target application program is installed; wherein the extraction rule comprises: when the control class name is implemented as a text box and / or a button control, determining the control content as the target content; and when the control class name is implemented as a list, determining the target content from the control content according to a web state of the web link, the web state indicating whether the web link is empty.

9. A terminal, characterized by comprising: The terminal comprises a processor and a memory, and the memory stores at least one instruction which is loaded and executed by the processor to implement the content extraction method according to any one of claims 1 to 3.

10. A server, characterized by The server comprises a processor and a memory, and the memory stores at least one instruction which is loaded and executed by the processor to implement the content extraction method according to claim 4.

11. A computer readable storage medium, characterized in that, The storage medium stores at least one instruction which is loaded and executed by the processor to implement the content extraction method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Password protection carrier generating method and device

    CN102799799A

  • Method, device and system for interface display

    CN105426448A

  • Method for achieving infinite circulating rolling selection based on UITableView in iOS

    CN105677366A

  • Incorporating media content into a 3D social platform

    US20110221745A1

  • Text information processing method and apparatus

    CN106293961A