Page content processing method and device, electronic equipment and readable storage medium
By defining page types and configuring key page content extraction rules, the problem of inconsistent user experience caused by differences in third-party page design styles was solved. This enabled the effective extraction of key page content and unified style conversion, thereby improving the consistency of user experience.
Patent Information
- Application Number
- CN202211255731.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-10-13
AI Technical Summary
In existing technologies, differences in the design styles of third-party pages lead to inconsistent user experiences, and it is difficult to effectively extract and convert them into a unified design style for the platform, resulting in inconsistent user experiences.
By determining the page type of the page to be processed, identifying key content blocks from the page content based on the key page content type, and configuring corresponding key page content extraction rules, the effective extraction and transformation of key page content can be achieved.
It enables the effective extraction of key page content from third-party pages, ensuring consistency in subsequent style conversions and improving user experience.
Smart Images

Figure CN115795194B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data processing, in particular to the technical field of application programs, and more particularly, the present disclosure relates to a page content processing method and device, an electronic device and a readable storage medium. BACKGROUND
[0002] With the rapid development of Internet technology, more and more application programs will be used as platforms to access third-party pages, so that the content displayed in the application program is enriched. Since the design styles of third-party pages may have many differences, the user experience is inconsistent.
[0003] If the page content can be extracted from the third-party page, and the extracted page content is converted into a unified design style of the platform for display, the consistency of the user experience can be ensured. Therefore, how to effectively extract the page content from the third-party page has become an important technical problem. SUMMARY
[0004] The present disclosure provides a page content processing method and device, an electronic device and a readable storage medium to solve at least one of the above problems.
[0005] According to a first aspect of the present disclosure, a page content processing method is provided, the method comprising:
[0006] determining at least one key page content type corresponding to a page type to which a to-be-processed page belongs;
[0007] determining a key content block from the page content of the to-be-processed page based on the key page content type, the key content block containing key page content corresponding to the key page content type;
[0008] extracting the key page content from the key content block.
[0009] According to a second aspect of the present disclosure, a page content processing device is provided, the device comprising:
[0010] a key page content type determination module configured to determine at least one key page content type corresponding to a page type to which a to-be-processed page belongs;
[0011] a key content block determination module configured to determine a key content block from the page content of the to-be-processed page based on the key page content type, the key content block containing key page content corresponding to the key page content type;
[0012] a key page content extraction module configured to extract the key page content from the key content block.
[0013] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0014] at least one processor; and
[0015] a memory connected with the at least one processor in communication; wherein,
[0016] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method for processing page content.
[0017] According to a fourth aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to perform the method for processing page content.
[0018] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method for processing page content.
[0019] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0020] The accompanying drawings are used to better understand the present scheme, and do not constitute a limitation on the present disclosure. Among them:
[0021] Figure 1 is a flowchart of a method for processing page content provided by an embodiment of the present disclosure;
[0022] Figure 2 is a structural diagram of a page conversion system provided by an embodiment of the present disclosure;
[0023] Figure 3 is a flowchart of another method for processing page content provided by an embodiment of the present disclosure;
[0024] Figure 4 is a structural diagram of a page content processing device provided by an embodiment of the present disclosure;
[0025] Figure 5 is a structural diagram of another page content processing device provided by an embodiment of the present disclosure;
[0026] Figure 6 is a block diagram of an electronic device for implementing the method for processing page content according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0028] In related technologies, platforms typically pre-configure some extraction rules to extract page content from third-party pages, and then convert the extracted page content into a unified design style for display. However, due to the diversity of content in third-party pages, the pre-configured extraction rules cannot meet the actual usage needs, which may lead to extraction errors when extracting content from third-party pages, and cannot effectively guarantee the consistency of user experience.
[0029] For example, for directory pages, the directory section of a third-party page may be implemented using various forms such as list tags, paragraph tags, and link tags. Due to the diversity of its content structure, it is difficult to extract directory information using extraction rules.
[0030] In addition, third-party pages may contain information that does not comply with the platform's requirements (such as advertising information). How to avoid displaying such information to users is a technical problem that urgently needs to be solved.
[0031] The page content processing method, apparatus, electronic device, and readable storage medium provided in this disclosure are intended to solve at least one of the above-mentioned technical problems of the prior art.
[0032] Figure 1 The diagram illustrates a flowchart of a page content processing method provided in an embodiment of this disclosure, as shown below. Figure 1 As shown, the method can mainly include:
[0033] Step S110: Determine at least one key page content type corresponding to the page type to which the page to be processed belongs;
[0034] Step S120: Based on the key page content type, determine the key content block from the page content of the page to be processed. The key content block contains key page content corresponding to the key page content type.
[0035] Step S130: Extract key page content from key content blocks.
[0036] In this embodiment, page types can be categorized based on their content. For example, in the context of online novels, page types can include detail pages, table of contents pages, and content pages. The content of a detail page can specifically include the book title, cover image, and a brief synopsis. The content of a table of contents page can include the novel's table of contents or chapter list. The content of a content page can include the main text of the novel. Similarly, in the context of online movies and TV shows, page types can include playback pages, whose content can include the video title, a brief synopsis, and the video playback window.
[0037] Key page content can be any valid page content within a page. Once extracted, key page content can be used for subsequent style transformations.
[0038] Different page types contain different page content, resulting in different page content types for the key page content extracted from them. Since there is a certain correlation between page type and key page content type, the correspondence between page type and key page content type can be configured.
[0039] As an example, the page type is a details page. Key content to be extracted from a details page typically includes the book title, cover image, and summary information. Therefore, the book title, cover image, and summary information can be used as key content types, and a corresponding relationship can be established between the book title, cover image, and summary information and the details page.
[0040] As an example, the page type is a directory page. Key page content that needs to be extracted from a directory page typically includes directory information. Therefore, directory information can be used as the key content type, and a correspondence can be established between directory information and directory pages.
[0041] As an example, the page type is a content page. The key page content to be extracted from a content page typically includes the main text and chapter information. Therefore, the main text and chapter information can be considered as key content types, and a corresponding relationship can be established between the main text and chapter information and the content page.
[0042] In this embodiment of the disclosure, the key content block is part of the page content. Generally, the key content block contains at least one page tag. Key page content is generally contained within the key content block. There is a certain correlation between the key content block and the key page content type; therefore, the key content block can be determined from the page content of the page to be processed based on the key page content type.
[0043] As an example, the page type is a details page, and the key page content type corresponding to the details page includes a cover image. The cover image is one of the images included in the page content of the details page. Therefore, the image tag containing the cover image can be identified, and it can be used as a key content block to extract the cover image.
[0044] As another example, the page type is a directory page. The key page content type corresponding to a directory page includes directory information, which is generally found in a series of consecutive page tags (such as paragraph tags). Therefore, we can identify the consecutive page tags containing directory information, treat them as key content blocks, and extract the directory information from them. In this example, consecutive arrangement of page tags means that the page tags are adjacent nodes in the Document Object Model (DOM) corresponding to the page. For example, when multiple paragraph tags correspond to child nodes under the same parent node in the DOM, these paragraph tags are consecutive.
[0045] In this embodiment of the disclosure, key page content extraction rules corresponding to key page content types can be pre-configured for extracting key page content from key content blocks.
[0046] As an example, if the key page content type is a cover image, the corresponding key page content extraction rule is: extract the image contained in the image tag (i.e., the key content block) containing the cover image as the key page content.
[0047] As an example, the key page content type includes table of contents information. The corresponding key page content extraction rule is to extract strings containing preset table of contents keywords from consecutive page tags (i.e., key content blocks) containing table of contents information. Since table of contents information is generally in the form of "Chapter xx" or "Section xx", the table of contents keywords can be configured as "Chapter xx" or "Section xx".
[0048] In this embodiment of the disclosure, the corresponding key page content type is determined based on the page type, and then the key content block containing the key page content is determined based on the key page content type, thereby extracting the key page content from the key content block, thus achieving effective extraction of key page content.
[0049] The method provided in this disclosure determines a key page content type corresponding to the page type to which the page to be processed belongs; based on the key page content type, it identifies key content blocks containing key page content corresponding to the key page content type from the page content of the page to be processed, and extracts key page content from the key content blocks. Based on this solution, key page content can be effectively extracted from the page, providing a foundation for subsequent page style conversion to ensure a consistent user experience.
[0050] In one optional approach of this disclosure, key content blocks are determined from the page content of the page to be processed based on key page content types, including:
[0051] Determine the content block extraction rules corresponding to the content types of key pages;
[0052] Extract at least one candidate content block from the page content of the page to be processed based on the content block extraction rules;
[0053] Key content blocks are identified based on candidate content blocks.
[0054] In this embodiment of the disclosure, the candidate content block is a portion of the content extracted from the page content, and the candidate content block can be used to determine the key content block.
[0055] Key page content of different types will exist in different parts of the page. Key page content types and content block extraction rules can be pre-configured so that candidate content blocks can be extracted according to the content block extraction rules. Candidate content blocks can be used to further determine key content blocks.
[0056] As an example, the key page content type corresponding to the details page includes a cover image. The cover image is one of the images included in the page content of the details page. Therefore, the content block extraction method corresponding to the cover image can be configured as follows: extract all image tags in the page content of the details page as candidate content blocks.
[0057] As an example, the key page content type corresponding to the directory page includes directory information, which generally exists within a series of consecutive page tags. Therefore, the content block extraction method corresponding to the directory information can be configured to extract at least a preset number of consecutive page tags from the directory page content as candidate content blocks. In this example, consecutive arrangement of page tags means that paragraph tags are adjacent nodes in the corresponding DOM. For example, when multiple paragraph tags correspond to child nodes under the same parent node in the DOM, these paragraph tags are consecutive.
[0058] In one optional approach of this disclosure, determining key content blocks based on candidate content blocks includes:
[0059] Determine the rules for identifying key content blocks corresponding to key page content types;
[0060] Key content blocks are determined from candidate content blocks based on key content block determination rules.
[0061] In this embodiment of the disclosure, the key content blocks corresponding to different key page content types will have certain content characteristics. The key content block determination rules can be configured according to these content characteristics, and the correspondence between key page content types and key content block determination rules can be established.
[0062] As an example, the page type is a details page. The key page content types for the details page include a cover image, and the candidate content blocks are the image tags extracted from the page content of the details page. Since cover images are generally located in the center of the page and occupy a large area, the rule for determining the key content blocks corresponding to the cover image can be defined as follows: the proportion of the image contained in the image tag on the page is greater than a preset proportion, and the center of the image is located in the central area of the page. Based on the rule for determining the key content blocks corresponding to the cover image, the image tag containing the cover image (i.e., the key content block) can be determined from the image tags contained in the details page.
[0063] As another example, the page type is a details page. The key page content types corresponding to the details page include a cover image, and the candidate content blocks are the various image tags extracted from the page content of the details page. Since the cover image is generally located in the center of the page and occupies a large area of the page, the determination rule for the key content block corresponding to the cover image can be determined as follows: the proportion of the image contained in the image tag on the page is greater than a preset proportion, and the center of the image is located in the central area of the page. Based on the determination rule for the key content block corresponding to the cover image, the image tag containing the cover image (i.e., the key content block) can be determined from the various image tags contained in the details page.
[0064] In one optional embodiment of this disclosure, the key content block determination rules include multiple rules, and the key content block is determined from candidate content blocks based on these rules, including:
[0065] Determine the target key content block determination rules that each candidate content block satisfies from the key content block determination rules;
[0066] Based on the weight values corresponding to the target key content block determination rules, determine the weight score corresponding to each candidate content block;
[0067] Based on weighted scoring, key content blocks are identified from candidate content blocks.
[0068] In this embodiment of the disclosure, to ensure accurate extraction of key content blocks, multiple key content block determination rules can be configured based on the content characteristics of the key content blocks, and corresponding weight values can be configured according to the importance of each key content block determination rule. For example, a larger weight value can be configured for key content block determination rules with higher importance, and a smaller weight value can be configured for key content block determination rules with lower importance.
[0069] After determining the target key content block judgment rules that the candidate content blocks meet, a weight score can be determined for each candidate content block based on the weight value corresponding to each target key content block judgment rule. The weight score reflects the probability that a candidate content block is a key content block.
[0070] As an example, a weight score can be obtained by summing the weight values corresponding to the judgment rules for the target content block. The higher the weight score, the greater the likelihood that the candidate content block is a key content block.
[0071] As an example, the key page content type corresponding to the directory page includes directory information. The key content block judgment rules corresponding to the directory information include: (1) the candidate content block contains multiple consecutively arranged page tags; (2) the number of characters in the page tags of the candidate content block is greater than a first preset value and less than a second preset value, where the first preset value is 10 and the second preset value is 100; (3) the content in the page tags of the candidate content block contains key characters, such as the key characters being "chapter" or "section". Weights can be configured for the above key content block judgment rules respectively. For example, the weight values corresponding to the above three key content block judgment rules can be configured as 1, 2, and 3 respectively.
[0072] In this example, the consecutive arrangement of page tags means that the paragraph tags are adjacent nodes in the DOM corresponding to the page. For example, when multiple paragraph tags correspond to child nodes under the same parent node in the DOM, these paragraph tags are consecutive.
[0073] The consecutively arranged page tags in the directory page may also be image tags for multiple recommended novels. For example, if two candidate content blocks are extracted from the directory page, the first candidate content block includes multiple consecutively arranged paragraph tags, and the second candidate content block includes multiple consecutively arranged image tags. The first candidate content block satisfies the key content block determination rules (1), (2), and (3) corresponding to the directory information in the example above, and its weight value can be calculated as 6. The second candidate content block satisfies the key content block determination rule (1) corresponding to the directory information in the example above, and its weight value can be calculated as 2. Therefore, it can be determined that the first candidate content block in this example is a key content block.
[0074] In one optional approach of this disclosure, key content blocks are determined from candidate content blocks based on weighted scoring, including:
[0075] The candidate content block with the highest corresponding weight score is identified as the key content block.
[0076] In this embodiment of the disclosure, key content blocks can be determined from candidate content blocks based on weight scores. When a candidate content block has the highest weight score among all candidate content blocks, it indicates that the candidate content block is most likely to be a key content block, and the candidate content block can be determined as a key content block.
[0077] In one alternative approach disclosed herein, the key page content type is a cover image, and the content block extraction rule corresponding to the cover image includes extracting each image tag from the page content of the page to be processed as a candidate content block.
[0078] In this embodiment, when the key page content type is a cover image, since the cover image is one of the images included in the page content of the details page, the content block extraction method corresponding to the cover image can be configured as follows: extract all image tags in the page content of the details page as candidate content blocks.
[0079] Since cover images are typically located in the center of the page and occupy a large area, the rule for determining the key content block corresponding to the cover image can be defined as follows: the image tag containing the cover image has a proportion greater than a preset proportion on the page, and the center of the image is located in the central area of the page. Based on this rule, the image tag containing the cover image (i.e., the key content block) can be determined from the image tags included on the details page.
[0080] In one alternative approach disclosed herein, extracting key page content from key content blocks includes:
[0081] Images contained in the image tags corresponding to key content blocks are identified as key page content.
[0082] In this embodiment of the disclosure, key page content extraction rules corresponding to key page content types can be pre-configured for extracting key page content from key content blocks.
[0083] When the key page content type is a cover image, the corresponding key page content extraction rule is: extract the image contained in the image tag (i.e., the key content block) containing the cover image as the key page content.
[0084] In one optional embodiment of this disclosure, before determining at least one key page content type corresponding to the page type to which the page to be processed belongs, the method further includes:
[0085] The page type of the page to be detected is determined based on the page tags contained in the page to be detected;
[0086] Pages belonging to the specified page type are identified as pages to be processed.
[0087] In this embodiment of the disclosure, the page to be tested can be a page provided by a third party, and there may be cases in the page to be tested that do not conform to the design style specified by the platform.
[0088] In actual use, there may be many pages to be detected. To avoid excessive processing pressure, the key page content can be extracted only from the pages of a specified page type.
[0089] The pages to be tested can include various page types. Some important page types (such as frequently occurring page types) can be identified as pages to be processed. Then, the key page content is extracted from the pages to be processed for subsequent style conversion.
[0090] As an example, for the application scenario of online novels, page types can include detail pages, table of contents pages, content pages, activity pages, ranking pages, user profile pages, etc. Among them, detail pages, table of contents pages, and content pages are the most frequently occurring pages. These can be identified as the specified page types, and the pages to be detected that belong to these categories can be identified as the pages to be processed.
[0091] As an example, for the application scenario of online video, page types can include playback pages, event pages, ranking pages, user profile pages, etc. Among them, playback pages are frequently encountered pages, so they can be identified as the specified page type, and pages belonging to the playback page category can be identified as pages to be processed.
[0092] In this embodiment of the disclosure, the specific details of the page tags contained in pages of different page types are different, so the page type of the page to be detected can be determined based on the page tags.
[0093] In one optional approach of this disclosure, the page type of the page to be detected is determined based on the page tags contained in the page to be detected, including:
[0094] Based on the pre-defined relationship between page types and page tag conditions, and based on the page tag conditions satisfied by the page tags contained in the page to be detected, the page type of the page to be detected is determined.
[0095] In this embodiment of the disclosure, page tag conditions can be configured according to the tag characteristics of page tags contained in pages of different page types, and an association relationship between page types and page tag conditions can be established.
[0096] The page type can be determined based on the relationship between page type and page tag conditions, and based on the page tag conditions satisfied by the page to be detected.
[0097] In one alternative embodiment of this disclosure, the page tag conditions include at least one of the following:
[0098] The number of page tags of the first specified tag type satisfies the tag condition of the first subpage;
[0099] The number of characters contained in the content of the page tag satisfies the conditions for the second subpage tag;
[0100] The condition for a third subpage tag is met if the content of the page tag contains the specified characters.
[0101] In this embodiment of the disclosure, a page type may correspond to one or more page tag conditions. When a page type corresponds to multiple page tag conditions, that is, the page to be detected needs to meet the multiple page tag conditions corresponding to that page type, then it can be determined that the page to be detected belongs to that page type.
[0102] As an example, page tag conditions may include the number of page tags of a first specified tag type that satisfy the first subpage tag condition.
[0103] The first subpage tag condition is used to limit the number of page tags of the first specified tag type. For example, if the first specified tag type is a paragraph tag, the first subpage tag condition is that the number of paragraph tags is greater than a preset value. When the page to be detected meets the first subpage tag condition, it can be considered that the page type of the page to be detected is more likely to be a content page or a directory page.
[0104] As an example, the number of characters contained in the content of the page tag satisfies the condition of the second subpage tag.
[0105] The second subpage tag condition is used to limit the number of characters contained in the tag content of a page tag. For example, the second subpage tag condition is that the number of characters in the tag content of a page tag is greater than a first preset value. The first preset value can be a large number. When the number of characters in the tag content is greater than the first preset value, the tag content of the page tag can be considered to contain a large number of characters. Generally, content pages contain paragraph tags with a large number of characters (i.e., used to display a passage from a novel). Therefore, when the page to be detected meets this second subpage tag condition, it can be considered that the page type of the page to be detected is more likely to be a content page.
[0106] For example, the second subpage tag condition is that the number of characters in the tag content of the page tag is greater than a second preset value and less than a third preset value. This limits the range of characters that can be contained in the tag content. Generally, the table of contents information in a directory page may contain specific chapter information and chapter titles, and the number of characters will usually fall within a certain range, for example, the second preset value is 10 and the third preset value is 100. Therefore, when the page to be tested meets this second subpage tag condition, it can be considered that the page type of the page to be tested is highly likely to be a directory page.
[0107] As an example, the condition for a third subpage tag is met if the content of the page tag contains the specified character.
[0108] The third subpage tag condition is used to limit the content of page tags to include specific characters. For example, if the specified character is "《》", the third subpage tag condition can be that the content of a page tag contains the specified character "《》". When the content of a page tag contains "《》", this tag is a paragraph tag used to display the book title, and this tag is generally found in detail pages. Therefore, when the page to be tested meets this third subpage tag condition, it can be considered that the page type of the page to be tested is more likely to be a detail page.
[0109] For example, if the specified characters are "chapter" and "section", the third subpage tag condition can be that the content of the page tag contains the specified characters "chapter" and "section". When the content of the page tag contains "chapter" and "section", the tag is used to display directory information. This tag usually exists in directory pages. Therefore, when the page to be tested meets this third subpage tag condition, it can be considered that the page type of the page to be tested is more likely to be a directory page.
[0110] As an example, page tag conditions may include the arrangement of preset characters contained in the tag content of each page tag under the second specified tag type satisfying the fourth subpage tag condition.
[0111] The fourth subpage tag condition is used to restrict the order in which preset characters are included in the tag content of page tags of the second specified tag type. The second instruction tag type can be a paragraph tag, the preset characters can be the chapter numbers in the paragraph tags, and the second page tag condition can be that the chapter numbers in the paragraph tags are arranged in ascending order of the chapter numbers.
[0112] Specifically, the paragraph tags of a table of contents page contain chapter information, such as "Chapter 1, Section 1," from which the chapter number can be extracted: Chapter 1, Section 1. When the chapter numbers in the paragraph tags of the page to be tested are sequentially: Chapter 1, Section 1, Chapter 1, Section 2, and Chapter 1, Section 3, etc., it can be assumed that they are arranged in ascending order of chapter numbers, and the page type is more likely to be a table of contents page.
[0113] In practical use, multiple page tag conditions can be configured for a page type. That is, the page to be detected needs to meet multiple page tag conditions corresponding to that page type. This allows us to determine that the page to be detected belongs to that page type. Following the example above, when the page to be detected simultaneously meets the second, third, and fourth subpage tag conditions, it can be determined that the page to be detected is a directory page.
[0114] In one alternative embodiment of this disclosure, after extracting the key page content from the key content block, the method further includes:
[0115] Based on the location of the key page content within the page to be processed, determine the key page content extraction rules for the page to be processed.
[0116] In this embodiment of the disclosure, after extracting the key page content, the key page content extraction rules of the page to be processed can be determined based on the position of the key page content in the page to be processed.
[0117] When a page to be processed contains multiple key content blocks corresponding to the same key content type, or when a key content block contains multiple key page contents, a key page content extraction rule can be generated based on one of the key page contents, and then the other key page contents can be quickly extracted based on the page content extraction rule.
[0118] When there are pages related to the page to be processed, such as pages with the same layout provided by the same third party, one of these pages can be selected as the page to be processed, key page content can be extracted from it, key page content extraction rules can be generated, and then key page content in other pages can be quickly extracted according to the key page content extraction rules.
[0119] As an example, the page type is a details page. The key page content extracted from the details page includes the book title and cover image. The book title is usually located within a paragraph tag on the page. We can record the tag position of the paragraph containing the book title, as well as the specific content position of the book title within the paragraph tag, to generate key page content extraction rules. Based on these rules, the book title can be quickly extracted from the page. The cover image is usually located within an image tag on the page. The tag content of this image tag typically records the image file path of the cover image. We can record the image file path to generate key page content extraction rules, which can then be used to quickly retrieve the cover image from the image file path.
[0120] In this embodiment of the disclosure, since the key page content in the page to be processed is extracted, and then the key page content extraction rules of the page to be processed are determined based on the position of the key page content in the page to be processed, the key page content extraction rules are dynamically configured, which can adapt to the diversity of content in third-party pages and effectively extract page content.
[0121] In one optional embodiment of this disclosure, after determining the key page content extraction rules for the page to be processed based on the position of the key page content within the page to be processed, the method further includes:
[0122] In response to the existence of related pages associated with the page to be processed, content is extracted from the related pages based on the key page content extraction rules. The similarity between the Uniform Resource Identifier (URI) of the related page and the URI of the page to be processed meets the preset similarity conditions.
[0123] In this embodiment, the associated page is a page that is related to the page to be processed, such as a page with the same layout provided by the same third party. The associated page can be extracted using the key page content extraction rules corresponding to the page to be processed, enabling rapid extraction of key page content.
[0124] In this embodiment of the disclosure, the similarity between the URI of the page and the URI of the page to be processed can be used to determine whether a page is a related page. When the string corresponding to the URI of the page and the string corresponding to the URI of the page to be processed differ only in the last few characters, it indicates that the page and the page to be processed may exist under the same path, and the page is a related page.
[0125] In this embodiment of the disclosure, URI similarity can also be calculated based on the string corresponding to the URI, and pages whose URI similarity with the page to be processed is higher than a preset similarity threshold can be identified as associated pages.
[0126] In one alternative embodiment of this disclosure, the page content of the page to be processed contains external links. Before determining key content blocks from the page content of the page to be processed based on key page content types, the method further includes:
[0127] Retrieve the content of the external link page corresponding to the external link;
[0128] Add the content of the external link page to the page content of the page to be processed.
[0129] In this embodiment of the disclosure, the page to be processed may contain external links. When a user clicks on an external link, they will be redirected to the external link page, and the content of the external link page is the page content contained in the external link page.
[0130] As an example, a product detail page typically displays a brief introduction. However, if this introduction is lengthy, only a portion is usually shown, along with an external link. Clicking this link displays the full introduction. The content of the linked page is the complete introduction. Key page content extracted from the detail page includes the introduction; this example demonstrates how to extract the entire introduction as key page content.
[0131] In this embodiment of the disclosure, the content of the external link page corresponding to the external link can be obtained, and the content of the external link page can be added to the page content of the page to be processed, so that the page content of the page to be processed is completed, which facilitates the subsequent processing of the page to be processed.
[0132] In one alternative embodiment of this disclosure, after extracting the key page content from the key content block, the method further includes:
[0133] Based on the key page content and preset styles, generate the transformed page.
[0134] In this embodiment of the disclosure, after extracting the key page content, a converted page can be generated based on a preset style. The preset style can pre-specify the borders, layout, fonts, etc. of the converted page, so that the converted page can have a platform-unified design style.
[0135] In this embodiment of the disclosure, by extracting key page content and then generating a converted page with a unified design style based on a preset style, the consistency of user experience can be guaranteed when browsing the converted page.
[0136] In this embodiment of the disclosure, since the key page content is extracted and then displayed after style conversion, the key page content can be specified according to actual needs to ensure that it does not contain information that does not meet the platform's requirements (such as some advertising information), thereby avoiding the display of such information that does not meet the platform's requirements to users.
[0137] Figure 2 The diagram shows a schematic representation of a page conversion system provided in an embodiment of this disclosure.
[0138] like Figure 2 As shown, the system includes: a page to be detected module 210, a preset rule module 220, a page type judgment module 230, a key page content extraction module 240, a page conversion module 250, a page tag condition module 260, an external link content acquisition module 270, a key content block judgment rule module 280, and a content extraction rule module 290.
[0139] The page to be detected module 210 is used to provide the page to be detected for subsequent processing.
[0140] The preset rule module 220 is used to determine whether the page to be tested is developed according to the pre-agreed style. If the page to be tested is developed according to the pre-agreed style, the key page content can be directly extracted from the page to be tested according to the preset rules and provided to the page conversion module 250.
[0141] As an example, the domain names of pages developed according to a pre-agreed style can be recorded. When the page to be detected belongs to a website under that domain, the key page content can be extracted directly from the page to be detected according to the pre-defined rules.
[0142] Pages that cannot be directly extracted for key page content based on preset rules can be input into the page type judgment module.
[0143] The page type determination module 230 is used to determine the page type of the page to be detected and identify the page to be detected with the specified page type as the page to be processed.
[0144] The page tag condition module 260 is used to provide page tag conditions to the page type judgment module, so that the page type judgment module can determine the page type of the page to be detected based on the page tags and page tag conditions of the page to be detected.
[0145] The key page content extraction module 240 is used to extract key page content from the page to be processed.
[0146] The external link content acquisition module 270 is used to acquire the content of the external link page corresponding to the external link when the page to be processed contains an external link, and to supplement the page content of the page to be processed for subsequent processing.
[0147] The content block extraction rule module 280 is used to provide content block extraction rules, enabling the key page content extraction module to extract candidate content blocks from the page content of the page to be processed according to the content block extraction rules.
[0148] The key content block determination rule module provides key content block determination rules, enabling the key page content extraction module to identify key content blocks from candidate content blocks based on these rules.
[0149] After identifying the key content blocks, the key page content extraction module extracts the key page content from the key content blocks and provides the key page content to the page conversion module 250.
[0150] The page conversion module 250 is used to generate a converted page based on a predefined style and key page content, thereby realizing the style conversion of the page to be processed.
[0151] Figure 3 A flowchart illustrating another page content processing method provided in an embodiment of this disclosure is shown, such as... Figure 3 As shown, the method can mainly include:
[0152] Step S310: Determine the page type of the page to be detected based on the page tags contained in the page to be detected.
[0153] Step S320: Identify the pages to be detected that belong to the specified page type as pages to be processed.
[0154] Step S330: Determine at least one key page content type corresponding to the page type to which the page to be processed belongs.
[0155] Step S340: Determine the content block extraction rules corresponding to the content type of the key page.
[0156] Step S350: Extract at least one candidate content block from the page content of the page to be processed based on the content block extraction rules.
[0157] Step S360: Determine the key content block judgment rules corresponding to the key page content type.
[0158] Step S370: Determine the key content blocks from the candidate content blocks based on the key content block determination rules.
[0159] Step S380: Extract key page content from key content blocks.
[0160] Step S390: Generate the converted page based on the key page content and preset styles.
[0161] In this embodiment of the disclosure, the page to be tested can be a page provided by a third party, and there may be cases in the page to be tested that do not conform to the design style specified by the platform.
[0162] In actual use, there may be many pages to be detected. To avoid excessive processing pressure, the key page content can be extracted only from the pages of a specified page type.
[0163] The pages to be tested can include various page types. Some important page types (such as frequently occurring page types) can be identified as pages to be processed. Then, the key page content is extracted from the pages to be processed for subsequent style conversion.
[0164] As an example, for the application scenario of online novels, page types can include detail pages, table of contents pages, content pages, activity pages, ranking pages, user profile pages, etc. Among them, detail pages, table of contents pages, and content pages are the most frequently occurring pages. These can be identified as the specified page types, and the pages to be detected that belong to these categories can be identified as the pages to be processed.
[0165] As an example, for the application scenario of online video, page types can include playback pages, event pages, ranking pages, user profile pages, etc. Among them, playback pages are frequently encountered pages, so they can be identified as the specified page type, and pages belonging to the playback page category can be identified as pages to be processed.
[0166] In this embodiment of the disclosure, the specific details of the page tags contained in pages of different page types are different, so the page type of the page to be detected can be determined based on the page tags.
[0167] In this embodiment, page types can be categorized based on their content. For example, in the context of online novels, page types can include detail pages, table of contents pages, and content pages. The content of a detail page can specifically include the book title, cover image, and a brief synopsis. The content of a table of contents page can include the novel's table of contents or chapter list. The content of a content page can include the main text of the novel. Similarly, in the context of online movies and TV shows, page types can include playback pages, whose content can include the video title, a brief synopsis, and the video playback window.
[0168] Key page content can be any valid page content within a page. Once extracted, key page content can be used for subsequent style transformations.
[0169] Different page types contain different page content, resulting in different page content types for the key page content extracted from them. Since there is a certain correlation between page type and key page content type, the correspondence between page type and key page content type can be configured.
[0170] As an example, the page type is a details page. Key content to be extracted from a details page typically includes the book title, cover image, and summary information. Therefore, the book title, cover image, and summary information can be used as key content types, and a corresponding relationship can be established between the book title, cover image, and summary information and the details page.
[0171] As an example, the page type is a directory page. Key page content that needs to be extracted from a directory page typically includes directory information. Therefore, directory information can be used as the key content type, and a correspondence can be established between directory information and directory pages.
[0172] As an example, the page type is a content page. The key page content to be extracted from a content page typically includes the main text and chapter information. Therefore, the main text and chapter information can be considered as key content types, and a corresponding relationship can be established between the main text and chapter information and the content page.
[0173] In this embodiment of the disclosure, the key content block is part of the page content. Generally, the key content block contains at least one page tag. Key page content is generally contained within the key content block. There is a certain correlation between the key content block and the key page content type; therefore, the key content block can be determined from the page content of the page to be processed based on the key page content type.
[0174] As an example, the page type is a details page, and the key page content type corresponding to the details page includes a cover image. The cover image is one of the images included in the page content of the details page. Therefore, the image tag containing the cover image can be identified, and it can be used as a key content block to extract the cover image.
[0175] As another example, the page type is a directory page. The key page content type corresponding to a directory page includes directory information, which is generally found in a series of consecutive page tags (such as paragraph tags). Therefore, we can identify the consecutive page tags containing directory information, treat them as key content blocks, and extract the directory information from them. In this example, consecutive arrangement of page tags means that the page tags are adjacent nodes in the Document Object Model (DOM) corresponding to the page. For example, when multiple paragraph tags correspond to child nodes under the same parent node in the DOM, these paragraph tags are consecutive.
[0176] In this embodiment of the disclosure, key page content extraction rules corresponding to key page content types can be pre-configured for extracting key page content from key content blocks.
[0177] As an example, if the key page content type is a cover image, the corresponding key page content extraction rule is: extract the image contained in the image tag (i.e., the key content block) containing the cover image as the key page content.
[0178] As an example, the key page content type includes table of contents information. The corresponding key page content extraction rule is to extract strings containing preset table of contents keywords from consecutive page tags (i.e., key content blocks) containing table of contents information. Since table of contents information is generally in the form of "Chapter xx" or "Section xx", the table of contents keywords can be configured as "Chapter xx" or "Section xx".
[0179] In this embodiment of the disclosure, the corresponding key page content type is determined based on the page type, and then the key content block containing the key page content is determined based on the key page content type, thereby extracting the key page content from the key content block, thus achieving effective extraction of key page content.
[0180] The method provided in this disclosure determines a key page content type corresponding to the page type to which the page to be processed belongs; based on the key page content type, it identifies key content blocks containing key page content corresponding to the key page content type from the page content of the page to be processed, and extracts key page content from the key content blocks. Based on this solution, key page content can be effectively extracted from the page, providing a foundation for subsequent page style conversion to ensure a consistent user experience.
[0181] In this embodiment of the disclosure, the candidate content block is a portion of the content extracted from the page content, and the candidate content block can be used to determine the key content block.
[0182] Key page content of different types will exist in different parts of the page. Key page content types and content block extraction rules can be pre-configured so that candidate content blocks can be extracted according to the content block extraction rules. Candidate content blocks can be used to further determine key content blocks.
[0183] As an example, the key page content type corresponding to the details page includes a cover image. The cover image is one of the images included in the page content of the details page. Therefore, the content block extraction method corresponding to the cover image can be configured as follows: extract all image tags in the page content of the details page as candidate content blocks.
[0184] As an example, the key page content type corresponding to the directory page includes directory information, which generally exists within a series of consecutive page tags. Therefore, the content block extraction method corresponding to the directory information can be configured to extract at least a preset number of consecutive page tags from the directory page content as candidate content blocks. In this example, consecutive arrangement of page tags means that paragraph tags are adjacent nodes in the corresponding DOM. For example, when multiple paragraph tags correspond to child nodes under the same parent node in the DOM, these paragraph tags are consecutive.
[0185] In this embodiment of the disclosure, the key content blocks corresponding to different key page content types will have certain content characteristics. The key content block determination rules can be configured according to these content characteristics, and the correspondence between key page content types and key content block determination rules can be established.
[0186] As an example, the page type is a details page. The key page content types for the details page include a cover image, and the candidate content blocks are the image tags extracted from the page content of the details page. Since cover images are generally located in the center of the page and occupy a large area, the rule for determining the key content blocks corresponding to the cover image can be defined as follows: the proportion of the image contained in the image tag on the page is greater than a preset proportion, and the center of the image is located in the central area of the page. Based on the rule for determining the key content blocks corresponding to the cover image, the image tag containing the cover image (i.e., the key content block) can be determined from the image tags contained in the details page.
[0187] As another example, the page type is a details page. The key page content types corresponding to the details page include a cover image, and the candidate content blocks are the various image tags extracted from the page content of the details page. Since the cover image is generally located in the center of the page and occupies a large area of the page, the determination rule for the key content block corresponding to the cover image can be determined as follows: the proportion of the image contained in the image tag on the page is greater than a preset proportion, and the center of the image is located in the central area of the page. Based on the determination rule for the key content block corresponding to the cover image, the image tag containing the cover image (i.e., the key content block) can be determined from the various image tags contained in the details page.
[0188] In this embodiment of the disclosure, after extracting the key page content, a converted page can be generated based on a preset style. The preset style can pre-specify the borders, layout, fonts, etc. of the converted page, so that the converted page can have a platform-unified design style.
[0189] In this embodiment of the disclosure, by extracting key page content and then generating a converted page with a unified design style based on a preset style, the consistency of user experience can be guaranteed when browsing the converted page.
[0190] In this embodiment of the disclosure, since the key page content is extracted and then displayed after style conversion, the key page content can be specified according to actual needs to ensure that it does not contain information that does not meet the platform's requirements (such as some advertising information), thereby avoiding the display of such information that does not meet the platform's requirements to users.
[0191] Based on and Figure 1 The method shown follows the same principle. Figure 4 The diagram shows a structural schematic of a page content processing apparatus provided in an embodiment of this disclosure, such as... Figure 4 As shown, the page content processing device 40 may include:
[0192] The key page content type determination module 410 is used to determine at least one key page content type corresponding to the page type to which the page to be processed belongs;
[0193] The key content block determination module 420 is used to determine key content blocks from the page content of the page to be processed based on the key page content type. The key content blocks contain key page content corresponding to the key page content type.
[0194] The key page content extraction module 430 is used to extract key page content from key content blocks.
[0195] The apparatus provided in this disclosure determines a key page content type corresponding to the page type to which the page to be processed belongs; based on the key page content type, it determines key content blocks containing key page content corresponding to the key page content type from the page content of the page to be processed, and extracts key page content from the key content blocks. Based on this solution, key page content can be effectively extracted from the page, providing a foundation for subsequent page style conversion to ensure a consistent user experience.
[0196] Optionally, the key content block determination module is specifically used for:
[0197] Determine the content block extraction rules corresponding to the content types of key pages;
[0198] Extract at least one candidate content block from the page content of the page to be processed based on the content block extraction rules;
[0199] Key content blocks are identified based on candidate content blocks.
[0200] Optionally, when determining key content blocks based on candidate content blocks, the key content block determination module is specifically used for:
[0201] Determine the rules for identifying key content blocks corresponding to key page content types;
[0202] Key content blocks are determined from candidate content blocks based on key content block determination rules.
[0203] Optionally, the key content block determination rules include multiple rules. When determining key content blocks from candidate content blocks based on these rules, the key content block determination module specifically uses the following methods:
[0204] Determine the target key content block determination rules that each candidate content block satisfies from the key content block determination rules;
[0205] Based on the weight values corresponding to the target key content block determination rules, determine the weight score corresponding to each candidate content block;
[0206] Based on weighted scoring, key content blocks are identified from candidate content blocks.
[0207] Optionally, when determining key content blocks from candidate content blocks based on weighted scoring, the key content block determination module is specifically used for:
[0208] The candidate content block with the highest corresponding weight score is identified as the key content block.
[0209] Optionally, the key page content type is a cover image, and the content block extraction rule corresponding to the cover image includes extracting each image tag from the page content of the page to be processed as a candidate content block.
[0210] Optionally, the key page content extraction module is specifically used for:
[0211] Images contained in the image tags corresponding to key content blocks are identified as key page content.
[0212] Optionally, the above apparatus further includes a page-to-be-processed determination module, which is used to:
[0213] Before determining at least one key page content type corresponding to the page type to which the page to be processed belongs, the page type of the page to be detected is determined based on the page tags contained in the page to be detected;
[0214] Pages belonging to the specified page type are identified as pages to be processed.
[0215] Optionally, when determining the page type of the page to be detected based on the page tags contained in the page to be detected, the page determination module is specifically used for:
[0216] Based on the pre-defined relationship between page types and page tag conditions, and based on the page tag conditions satisfied by the page tags contained in the page to be detected, the page type of the page to be detected is determined.
[0217] Optionally, page tag conditions include at least one of the following:
[0218] The number of page tags of the first specified tag type satisfies the tag condition of the first subpage;
[0219] The number of characters contained in the content of the page tag satisfies the conditions for the second subpage tag;
[0220] The condition for a third subpage tag is met if the content of the page tag contains the specified characters.
[0221] Optionally, the above-mentioned device further includes:
[0222] The key page content extraction rule generation module is used to extract key page content from key content blocks and then determine the key page content extraction rules for the page to be processed based on the position of the key page content in the page to be processed.
[0223] Optionally, the above-mentioned device further includes:
[0224] The associated page content extraction module is used to determine the key page content extraction rules for the page to be processed based on the position of the key page content in the page to be processed. In response to the existence of associated pages related to the page to be processed, the module extracts the content of the associated pages based on the key page content extraction rules. The similarity between the URI of the associated page and the URI of the page to be processed meets the preset similarity conditions.
[0225] Optionally, if the page content of the page to be processed contains external links, the above device further includes an external link page content processing module, which is used for:
[0226] Before determining key content blocks from the page content of the page to be processed based on key page content types, obtain the content of the external link page corresponding to the external link;
[0227] Add the content of the external link page to the page content of the page to be processed.
[0228] Optionally, the above-mentioned device further includes:
[0229] The page conversion module is used to generate a converted page based on the key page content and preset styles after extracting key page content from key content blocks.
[0230] It is understood that the above-described modules of the page content processing apparatus in the embodiments of this disclosure have the ability to implement... Figure 1The embodiments shown illustrate the functionality of the corresponding steps in the page content processing method. This functionality can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions. These modules can be software and / or hardware, and each module can be implemented individually or multiple modules can be integrated. For a detailed description of the functions of each module of the page content processing device, please refer to [link to relevant documentation]. Figure 1 The corresponding descriptions of the page content processing methods in the embodiments shown are not repeated here.
[0231] Based on and Figure 3 The method shown follows the same principle. Figure 5 The diagram shows a structural schematic of a page content processing apparatus provided in an embodiment of this disclosure, such as... Figure 5 As shown, the page content processing device 50 may include:
[0232] The page type determination module 510 is used to determine the page type of the page to be detected based on the page tags contained in the page to be detected.
[0233] The pending page determination module 520 is used to determine the pending pages that belong to the specified page type as pending pages.
[0234] The key page content type determination module 530 is used to determine at least one key page content type corresponding to the page type to which the page to be processed belongs.
[0235] The content block extraction rule determination module 540 is used to determine the content block extraction rules corresponding to the content types of key pages.
[0236] The candidate content block determination module 550 is used to extract at least one candidate content block from the page content of the page to be processed based on the content block extraction rules.
[0237] The key content block determination rule module 560 is used to determine the key content block determination rule corresponding to the key page content type.
[0238] The key content block determination module 570 is used to determine key content blocks from candidate content blocks based on key content block determination rules.
[0239] The key page content extraction module 580 is used to extract key page content from key content blocks.
[0240] Page style conversion module 590 generates the converted page based on key page content and preset styles.
[0241] The apparatus provided in this disclosure determines a key page content type corresponding to the page type to which the page to be processed belongs; based on the key page content type, it determines key content blocks containing key page content corresponding to the key page content type from the page content of the page to be processed, and extracts key page content from the key content blocks. Based on this solution, key page content can be effectively extracted from the page, providing a foundation for subsequent page style conversion to ensure a consistent user experience.
[0242] It is understood that the above-described modules of the page content processing apparatus in the embodiments of this disclosure have the ability to implement... Figure 3 The embodiments shown illustrate the functionality of the corresponding steps in the page content processing method. This functionality can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions. These modules can be software and / or hardware, and each module can be implemented individually or multiple modules can be integrated. For a detailed description of the functions of each module of the page content processing device, please refer to [link to relevant documentation]. Figure 3 The corresponding descriptions of the page content processing methods in the embodiments shown are not repeated here.
[0243] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0244] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0245] The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a page content processing method as provided in the embodiments of this disclosure.
[0246] Compared with existing technologies, this electronic device identifies key page content types corresponding to the page type of the page to be processed. Based on these key page content types, it identifies key content blocks containing key page content corresponding to the key page content types from the page content of the page to be processed, and extracts key page content from these key content blocks. This solution effectively extracts key page content from the page, providing a foundation for subsequent page style conversion to ensure a consistent user experience.
[0247] The readable storage medium is a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform a page content processing method as provided in the embodiments of this disclosure.
[0248] Compared with existing technologies, this readable storage medium identifies key page content types corresponding to the page type of the page to be processed. Based on these key page content types, it identifies key content blocks containing key page content corresponding to the key page content type from the page content of the page to be processed, and extracts key page content from these key content blocks. This solution effectively extracts key page content from the page, providing a foundation for subsequent page style conversion to ensure a consistent user experience.
[0249] The computer program product includes a computer program that, when executed by a processor, implements a method for processing page content as provided in embodiments of this disclosure.
[0250] Compared with existing technologies, this computer program product identifies the key page content type corresponding to the page type of the page to be processed; based on the key page content type, it identifies key content blocks containing key page content corresponding to the key page content type from the page content of the page to be processed, and extracts the key page content from the key content blocks. Based on this solution, key page content can be effectively extracted from the page, providing a foundation for subsequent page style conversion to ensure a consistent user experience.
[0251] Figure 6 A schematic block diagram of an example electronic device 60 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0252] like Figure 6As shown, the electronic device 60 includes a computing unit 610, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 620 or a computer program loaded from a storage unit 680 into a random access memory (RAM) 630. The RAM 630 may also store various programs and data required for the operation of the device 60. The computing unit 610, ROM 620, and RAM 630 are interconnected via a bus 640. An input / output (I / O) interface 650 is also connected to the bus 640.
[0253] Multiple components in device 60 are connected to I / O interface 650, including: input unit 660, such as keyboard, mouse, etc.; output unit 670, such as various types of monitors, speakers, etc.; storage unit 680, such as disk, optical disk, etc.; and communication unit 690, such as network card, modem, wireless transceiver, etc. Communication unit 690 allows device 60 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0254] The computing unit 610 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 610 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 610 executes the page content processing methods provided in the embodiments of this disclosure. For example, in some embodiments, executing the page content processing methods provided in the embodiments of this disclosure can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 680. In some embodiments, part or all of the computer program can be loaded and / or installed on device 60 via ROM 620 and / or communication unit 690. When the computer program is loaded into RAM 630 and executed by computing unit 610, one or more steps of the page content processing methods provided in the embodiments of this disclosure can be performed. Alternatively, in other embodiments, the computing unit 610 can be configured to execute the page content processing methods provided in the embodiments of this disclosure by any other suitable means (e.g., by means of firmware).
[0255] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0256] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0257] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0258] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0259] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0260] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0261] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0262] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for processing page content, comprising: Determine at least one key page content type corresponding to the page type to which the page to be processed belongs. The page type includes detail page, table of contents page, and content page. The key page content type corresponding to the detail page includes book title, cover image, and synopsis information; the key page content type corresponding to the table of contents page includes table of contents information; and the key page content type corresponding to the content page includes main text content and chapter information. Based on the key page content type, key content blocks are determined from the page content of the page to be processed, and the key content blocks contain key page content corresponding to the key page content type. Extract the key page content from the key content block; The step of determining key content blocks from the page content of the page to be processed based on the key page content type specifically includes: Determine the content block extraction rules corresponding to the content types of the key pages; Based on the content block extraction rules, at least one candidate content block is extracted from the page content of the page to be processed; Determine the key content block determination rules corresponding to the key page content type. The key content block determination rules are configured based on the content characteristics of the key content blocks corresponding to the key page content type. The key content blocks are determined from the candidate content blocks based on the key content block determination rules.
2. The method according to claim 1, wherein, The key content block determination rules include multiple rules, and the step of determining key content blocks from candidate content blocks based on the key content block determination rules includes: Determine the target key content block determination rule satisfied by each candidate content block from the key content block determination rule; Based on the weight values corresponding to the target key content block determination rules, determine the weight score corresponding to each candidate content block; Based on the weighted scores, key content blocks are determined from the candidate content blocks.
3. The method according to claim 2, wherein, The step of determining key content blocks from the candidate content blocks based on the weighted scoring includes: The candidate content block with the highest corresponding weight score is identified as the key content block.
4. The method according to any one of claims 1-3, wherein, The key page content type is a cover image, and the content block extraction rule corresponding to the cover image includes extracting each image tag from the page content of the page to be processed as a candidate content block.
5. The method according to claim 4, wherein, The step of extracting the key page content from the key content block includes: The images contained in the image tags corresponding to the key content blocks are identified as the key page content.
6. The method according to any one of claims 1-3, wherein, Before determining at least one key page content type corresponding to the page type to which the page to be processed belongs, the method further includes: The page type of the page to be detected is determined based on the page tags contained in the page to be detected; The page to be detected that belongs to the specified page type is identified as the page to be processed.
7. The method according to claim 6, wherein, The step of determining the page type of the page to be detected based on the page tags contained in the page to be detected includes: Based on the preset association between page type and page tag conditions, and based on the page tag conditions satisfied by the page tags contained in the page to be detected, the page type of the page to be detected is determined.
8. The method according to claim 7, wherein, The page tag conditions include at least one of the following: The number of page tags of the first specified tag type satisfies the tag condition of the first subpage; The number of characters contained in the content of the page tag satisfies the conditions for the second subpage tag; The condition for a third subpage tag is met if the content of the page tag contains the specified characters.
9. The method according to any one of claims 1-3, wherein, After extracting the key page content from the key content block, the method further includes: Based on the location of the key page content in the page to be processed, the key page content extraction rules of the page to be processed are determined.
10. The method according to claim 9, after determining the key page content extraction rules of the page to be processed based on the position of the key page content in the page to be processed, the method further includes: In response to the existence of associated pages related to the page to be processed, the content of the associated pages is extracted based on the key page content extraction rules, and the similarity between the Uniform Resource Locator (URI) of the associated pages and the URI of the page to be processed satisfies a preset similarity condition.
11. The method according to any one of claims 1-3, wherein the page content of the page to be processed includes external links, and before determining the key content block from the page content of the page to be processed based on the key page content type, the method further includes: Obtain the content of the external link page corresponding to the external link; Add the content of the external link page to the page content of the page to be processed.
12. The method according to any one of claims 1-3, wherein, After extracting the key page content from the key content block, the method further includes: Based on the key page content and preset styles, the converted page is generated.
13. A page content processing apparatus, comprising: The key page content type determination module is used to determine at least one key page content type corresponding to the page type to which the page to be processed belongs. The page type includes detail page, table of contents page, and content page. The key page content type corresponding to the detail page includes book title, cover image, and synopsis information; the key page content type corresponding to the table of contents page includes table of contents information; and the key page content type corresponding to the content page includes main text content and chapter information. A key content block determination module is used to determine key content blocks from the page content of the page to be processed based on the key page content type. The key content blocks contain key page content corresponding to the key page content type. Specifically, the key content block determination module is used to determine the content block extraction rule corresponding to the key page content type; and to extract at least one candidate content block from the page content of the page to be processed based on the content block extraction rule. Determine the key content block determination rules corresponding to the key page content type. The key content block determination rules are configured based on the content characteristics of the key content blocks corresponding to the key page content type. Determine the key content blocks from the candidate content blocks based on the key content block determination rules. The key page content extraction module is used to extract the key page content from the key content block.
14. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-12.
15. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-12.
16. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-12.
Citation Information
Patent Citations
Page loading method, page loading apparatus and electronic device
CN104965871A