Web page generation method, device, electronic device, and storage medium
By extracting and arranging visible elements from a first web page based on original position information, the method generates a second web page that reproduces the third-party content efficiently, addressing loading and integration challenges while minimizing risks.
Patent Information
- Application Number
- JP2025507479
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-09-08
- Filing Date
- 2023-08-11
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-08-11
AI Technical Summary
Incorporating third-party webpages into first-party webpage services often results in excessive loading times, high production costs, slow iteration speeds, and risks such as non-compliance and data leakage due to their complexity.
A method to extract visible elements from a first web page, obtain original attribute information including position information, and generate a second web page with the same element arrangements as the first, thereby restoring the third-party webpage on the first-party platform.
This approach reduces loading and generation times, saves system memory, and avoids the issues associated with integrating third-party webpages by creating a first-party page that accurately reproduces the third-party content.
Smart Images

Figure 2025528153000001_ABST
Abstract
Description
[Technical Field]
[0001] (Reference to Related Application) This application claims priority to Chinese patent application No. 202211098354.5, filed with the China Patent Office on September 8, 2022, for "Webpage generating method, device, electronic device and storage medium," the entire contents of which are incorporated herein by reference.
[0002] (Technical field) The present disclosure relates to the field of computer technology, and more particularly to a web page generation method, device, electronic device, and storage medium. [Background technology]
[0003] With the development of Internet technology, a variety of webpage-based services have emerged, including page design services, page maintenance and operation services, advertising-focused webpage services, and sales-focused webpage and platform services. To improve page performance and achieve page owners' business goals, it is often necessary to incorporate third-party webpages into first-party webpage services, such as third-party advertising landing pages on e-commerce platform seller pages. However, incorporating third-party webpages often poses numerous challenges. For example, third-party pages often take excessively long to load, have high production costs, are slow to iterate, and are overly complex to operate, posing risks such as non-compliance and data leakage. Summary of the Invention
[0004] To solve the above problems, the present disclosure provides a web page generation method, device, electronic device, and storage medium.
[0005] According to a first aspect of the present disclosure, there is provided a web page generation method, the method comprising:
[0006] extracting visible elements from a first web page;
[0007] obtaining original attribute information of the visual element, the original attribute information including original position information, the original position information being used to describe an arrangement position of the visual element on the first web page;
[0008] generating a second web page based on the original location information, the second web page including at least some of the visible elements, and in the second web page, the at least some of the visible elements are arranged based on the original location information;
[0009] The arrangement positions of the at least some of the visible elements on the second web page are the same as their arrangement positions on the first web page.
[0010] According to another aspect of the present disclosure, there is provided a web page generation device, the device comprising:
[0011] an extraction module for extracting visible elements from the first web page;
[0012] an acquiring module for acquiring original attribute information of the visual element, the original attribute information including original position information, the original position information being used to describe an arrangement position of the visual element on the first web page;
[0013] a web page generation module for generating a second web page based on the original location information, the second web page including at least some of the visible elements, and in the second web page, the at least some of the visible elements are arranged based on the original location information;
[0014] The arrangement positions of the at least some of the visible elements on the second web page are the same as their arrangement positions on the first web page.
[0015] According to another aspect of the present disclosure, an electronic device is provided that includes a memory and a processor coupled to the memory, wherein instructions are stored in the memory and, when executed by the processor, a method described in the present disclosure is realized.
[0016] According to another aspect of the present disclosure, a storage medium is provided having stored thereon a computer program which, when executed by a processor, is used to implement a method as described in the present disclosure.
[0017] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the methods described herein.
[0018] The web page generation method, device, electronic device, and storage medium provided by the present disclosure are used to extract visual elements from a third-party web page, obtain original attribute information of the visual elements, and arrange the visual elements based on the original position information in the original attribute information to generate a new first-party web page, so that the generated first-party web page has the same visual elements as the third-party web page at the same arranged positions, thereby maximizing the restoration of the third-party web page and thereby avoiding many of the problems caused by introducing a third-party web page into a first-party network platform.
[0019] The drawings are intended to provide a further understanding of the invention and constitute a part of the specification, and together with the examples of the invention, are used to explain the invention and are not intended to limit the invention. [Brief explanation of the drawings]
[0020] [Figure 1] 1 illustrates a schematic diagram of a third-party web page according to an exemplary embodiment of the present disclosure. [Figure 2] 1 illustrates a flow diagram of a web page generation method according to an exemplary embodiment of the present disclosure. [Figure 3] 1 illustrates a flow diagram of a method for extracting visible elements according to an exemplary embodiment of the present disclosure. [Figure 4] 1 illustrates a flow diagram of a second web page generation method according to an exemplary embodiment of the present disclosure. [Figure 5] 1 shows a schematic diagram of a web page generation device according to an exemplary embodiment of the present disclosure; [Figure 6] FIG. 1 shows a schematic block diagram of an electronic device for implementing exemplary embodiments of the present disclosure. [Figure 7] FIG. 1 shows a schematic block diagram of a computer system for implementing exemplary embodiments of the present disclosure. DETAILED DESCRIPTION OF THE INVENTION
[0021] Hereinafter, the embodiments of the present disclosure will be described in more detail with reference to the drawings. The drawings show some embodiments of the disclosure, but the present disclosure can be realized in various forms and should not be construed as being limited to the embodiments described herein. Rather, these embodiments are provided to provide a more detailed, in-depth, and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are used for illustrative purposes only and do not limit the protection scope of the present disclosure.
[0022] It should be understood that the steps described in the method embodiments of the present disclosure may be performed in a different order and / or in parallel, and that method embodiments may include additional steps and / or omit steps as illustrated, and the scope of the present disclosure is not limited in this respect.
[0023] As used herein, the term "comprises" and variations thereof are open-ended, i.e., "including, but not limited to." The term "based on" means "based at least in part on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one other embodiment," and the term "some embodiments" means "at least some embodiments." Relevant definitions of other terms are provided in the following description. It should be noted that concepts such as "first," "second," etc. referred to in this disclosure are used only to distinguish different devices, modules, or units, and are not used to limit the order or interdependence of functions performed by these devices, modules, or units.
[0024] It should be noted that those skilled in the art will understand that the modifications "one" and "multiple" referred to in this disclosure are intended to be exemplary and not limiting, and should be understood as "one or more" unless the context clearly dictates otherwise.
[0025] The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only and are not used to limit the scope of these messages or information.
[0026] First, terms related to the embodiments of the present disclosure will be explained.
[0027] A user terminal is an input / output device used by a user to interact with a computer system, and mainly includes various types of computer terminal equipment, such as desktop computers, notebooks, personal digital assistants (PDAs), tablet computers (PADs), mobile phones, and various smart terminals. A server generally refers to a computer system that provides specific services to other user terminals connected to a network, and usually has greater stability, security, storage capacity, and computing performance than an ordinary user terminal.
[0028] A user interface is a channel for exchanging information between a person and a computer. A user inputs information into a computer through the user interface, and the computer provides information to the user through the user interface, allowing the user to know the information and make analysis and decisions based on that information. Examples of user interfaces include the conversation window of instant messaging software, a website page, and a game page.
[0029] A landing page, also known as a destination page or information page, is the first page a visitor sees when they access a website or software, and can be used to achieve advertising or marketing conversions. A first-party landing page is a landing page provided by a single operator.
[0030] A third-party landing page is a landing page provided by a third party other than the operator or user.
[0031] The Document Object Model (DOM) is a platform- and language-neutral application program interface that can be used by programs and scripts to dynamically connect to, access, and update the content, structure, and style of World Wide Web documents.
[0032] DOM Tree: Among the many document structures of the DOM, the most commonly used implementation is the tree structure. The basic element of the DOM is the node, and the document structure is made up of hierarchical nodes, and the hierarchical node structure is easy to represent using a tree structure.
[0033] Pruning a DOM Tree, when combined with the definition of a DOM Tree, literally means removing some nodes. In this disclosure, pruning is used to describe the process of extracting visible elements, in which non-visible elements are discarded.
[0034] Flattening is the process of converting data with a hierarchical structure into data with a flat structure, for example, all data is arranged under a root node.
[0035] In SSR (Server side rendering), the assembly or page generates an HTML string through the server and sends it to the browser. After sending a request through the SSR method, the server returns the HTML structure of the entire page.
[0036] The CSR (Client side render) requests data through a port, and the front end dynamically processes and generates the necessary structure and page content through JavaScript.
[0037] Lazy loading, also known as delayed loading, involves loading resources by loading network resources or only if certain conditions are met.
[0038] Regarding src, in HTML, src is an abbreviation of source, and indicates the source file. It usually indicates the address that points to the file, for example, <img src=""ming.bmp”"> indicates that the picture source file has a file name of ming.bmp.
[0039] With the development of Internet technology, Internet services have become more diverse and complex, and the entities providing Internet services have gradually differentiated and become more sophisticated. Services from third-party Internet service providers are often implemented on a single Internet platform. For example, in e-commerce platforms, sellers often implement third-party landing pages for their storefronts, products, or services to achieve specific business goals, such as increasing clicks, marketing conversions, and collecting consumer information. However, implementing third-party web pages can lead to many problems, including excessive loading times, high production costs, slow iteration speeds, overly complex page operations, and risks such as non-compliance and data leakage.
[0040] FIG. 1 shows a schematic diagram of a third-party webpage, which may be a landing page for advertising, marketing conversion, increasing clicks, etc. The product advertising landing page shown in FIG. 1 includes webpage elements related to product sales, such as a product logo, product name, product introduction, and product part name, as well as payment methods, shipping methods, arrival information, and comments, which are arranged in the form of text-type visual elements. The webpage also includes a product video, product images, and multiple product part images, which are arranged in the form of video-type visual elements and picture-type visual elements, respectively. The webpage also includes several jump buttons and hidden operable controls. For example, a small icon above the payment method can be clicked to jump to the payment page, and product option parameters can be clicked to select various product configuration parameters in a pop-up control window.
[0041] In order to provide better services to users on first-party Internet platforms while avoiding many of the problems caused by the introduction of third-party web pages, the present disclosure provides a web page generation method, device, electronic device, and storage medium, which solves the aforementioned problems by generating first-party web pages that restore the above-mentioned third-party web pages on the first-party Internet platform.
[0042] The present disclosure provides a web page generation method, device, electronic device, and storage medium.
[0043] As shown in FIG. 2, a web page generating method is disclosed, which includes the following steps:
[0044] S1, extract visible elements from a first web page.
[0045] In order to provide users with richer information and more attractive visual effects, web pages often contain a wealth of elements such as text, pictures, videos, various controls, network links, operable buttons, some hidden function plug-ins, etc. Elements contained in web pages include visible elements such as text, pictures, and video type elements, and invisible elements such as network links and hidden function plug-ins.
[0046] When restoring a third-party webpage using a first-party webpage, only the most important visible elements of the webpage can be extracted and other webpage elements can be discarded. At the same time, due to limitations imposed by the first-party webpage's implementation capabilities, some third-party webpages may have difficulty implementing complex assembly operations such as content cascading and animation effects. In step S1, the visible elements of the first webpage are extracted, while adapting to the first-party webpage's implementation capabilities to streamline the elements displayed on the webpage, thereby shortening the generation and loading time of the first-party webpage and saving system memory.
[0047] According to the different element types, the visual elements can be classified into text-type visual elements, picture-type visual elements and video-type visual elements.
[0048] Taking Figure 1 as an example, the following visible elements are extracted from the webpage: product video, pictures of the product and its parts, product logo, button icons, product name, product introduction, product and product name, product optional parameters, and "payment method", "shipping method", "arrival", "comments", "other text information", etc.
[0049] S2, obtain original attribute information of the visible element, the original attribute information including original position information, and the original position information is used to describe the arrangement position of the visible element on the first page.
[0050] In the first web page, the extracted visible elements have corresponding original attribute information. In step S1, when extracting the visible elements, the corresponding original attribute information may be directly obtained, or further processing may be required to obtain the original attribute information of the visible elements.
[0051] The original attribute information of the visible element includes, but is not limited to, original position information, size information, source information, font information, format information, tag information, and the like.
[0052] It is important to obtain the original position information of the visible elements, so that the first web page can be restored in a more intuitive way by displaying the same visible elements in the same positions on the newly generated web page.
[0053] S3. Generate a second page based on the original position information, the second page including at least some of the visible elements, and in the second page, the at least some of the visible elements are arranged based on the original position information.
[0054] The arrangement positions of the at least some of the visible elements on the second web page are the same as their arrangement positions on the first web page.
[0055] Based on the acquired original position information, the same visual elements as those in the first webpage can be displayed at the same arrangement position, thereby realizing the restoration of the first webpage by the second webpage. However, the first webpage may contain a large number of visual elements. For example, take picture-type visual elements, such as small logo pictures that are easy to overlook, as an example. Displaying these visual elements may not attract the attention of the browsing user, and therefore these visual elements may be discarded by further filtering. For example, the product logo in FIG. 1 is easy to overlook due to its small size.
[0056] The second page may include all visible elements, or may include some of the visible elements but discard other portions, for example, discarding visible elements that the viewing user overlooked.
[0057] The above method extracts visible elements from a first web page, obtains the original attribute information of the visible elements, and arranges the visual information according to the original position information in the original attribute information to generate a second web page. The arrangement positions of the visible elements in the generated second web page are the same as those in the first web page, thereby achieving the maximum restoration of the first web page and thereby avoiding many of the problems caused by introducing a third-party web page into a first-party network platform.
[0058] 3, which shows a flow diagram of a method for extracting visible elements according to an exemplary embodiment of the present disclosure. As shown in FIG. 3, in some embodiments, step S1 may further include the following steps:
[0059] S11, loading the first web page into a browser.
[0060] Specifically, in some embodiments, the first web page may be loaded by a headless browser.
[0061] S12, analyzing the loaded first web page.
[0062] In some embodiments, the first web page may be an SSR or CSR type web page. If a web page contains many complex elements, it may take a long time to load, and waiting for all elements to load may take even longer. Considering that a web page may contain elements that take a long time to load but are not necessarily used, analysis of the first web page may begin when the first web page has essentially completed loading.
[0063] S13, performing flattening processing on the analyzed first web page.
[0064] Under normal circumstances, web pages adopt a tree document structure, i.e., the DOM Tree of the loaded first web page can be obtained by parsing the first web page, and the processing of the parsed first web page is to process the DOM Tree.
[0065] In a tree document structure, elements in a web page can be specific nodes. If the number of layers of nodes is large, it is not helpful to extract elements and their attribute information in the web page. Through flattening processing, the tree structure can be converted into a flat structure, which makes it easier to extract elements and their attribute information in the web page, and reduces the extraction time and occupied processing resources.
[0066] S14, extracting visual elements from the flattened first web page, where the visual elements include picture-type visual elements, text-type visual elements and video-type visual elements.
[0067] The first web page that has undergone the flattening process is more suitable for extracting web page information. Visual elements are extracted from the first web page, and the visual elements include at least pictures, characters, and videos.
[0068] In some embodiments, extraction of picture-type visual elements and video-type visual elements may be achieved by the tag of the web page element, for example, extraction of picture-type visual elements may be achieved by matching the tag as img or pic, and extraction of video-type visual elements may be achieved by matching the tag as video.
[0069] In some embodiments, the extraction of text-type visible elements can be performed by traversing all elements in the first page to extract text information therein. Taking Figure 1 as an example, all elements in the first page are traversed and text information therein is extracted, which may mean extracting some text information pages that are not displayed on the current page of Figure 1, such as hidden specific comment information, specific option text information of product option parameters, etc.
[0070] In some embodiments, in step S2, the original position information may include at least one of width and height information and web page margin information, which may be, for example, a margin from the top edge of a web page (top value), a margin from the left edge of a web page (left value), etc.
[0071] In some embodiments, in step S2, the original attribute information may include at least one of the following:
[0072] For a picture-type visible element, the original attribute information includes original resource information, original size information, and original position information;
[0073] For a visual element of text type, the original attribute information includes original font information and original position information;
[0074] In the case of a video-type visual element, the original attribute information includes original position information of the video-type visual element that meets a predetermined format.
[0075] Therefore, step S2 can be implemented as follows.
[0076] Based on the type of the visible element, original attribute information of the visible element is obtained, and the original attribute information includes original position information, which is used to describe the arrangement position of the visible element on the first page.
[0077] where:
[0078] For a picture-type visible element, obtain original resource information, original size information and original position information of the picture-type visible element;
[0079] For a text-type visual element, obtain original font information and original position information of the text-type visual element;
[0080] In the case of a video-type visual element, the original position information of the video-type visual element that satisfies a predetermined format is obtained.
[0081] The predetermined format may be determined according to the format supported by the web page to be generated. For example, if the web page to be generated only supports videos in MP4 format, the predetermined format may be MP4 format. Among the extracted video-type visual elements, only visual elements whose original format information is MP4 format are provided with corresponding original attribute information. That is, video-type visual elements that do not meet the predetermined format are discarded in this step.
[0082] In some embodiments, for a picture-type visible element, if the picture information is inaccurate as a result of the delayed load policy, the original picture resource can be obtained by simulating page scrolling or picture src splicing. Also, if the page load is incomplete and the picture size information is biased, the picture's original size information is obtained by reloading the picture. The original size information can be used to further filter the picture-type visible element; for example, if the original size information is too small, it may mean that the current picture's visible element is not important and can be discarded.
[0083] In step S3, the present disclosure can restore the first web page by the second web page using the original attribute information of the visible elements, especially the original position information contained therein. Referring to FIG. 4, FIG. 4 shows a flow diagram of a second web page generation method according to an exemplary embodiment of the present disclosure. As shown in FIG. 4, in some embodiments, step S3 may further include the following steps:
[0084] S31, clustering at least some of the visible elements based on the original position information;
[0085] S32, in each cluster corresponding to the original position information, arrange the visible elements according to the following rules based on the types of the visible elements:
[0086] For text-type visual elements, arranging all text-type visual elements included in the cluster at corresponding positions in the cluster;
[0087] for picture-type visible elements, arranging picture-type visible elements in said cluster that satisfy a first predetermined condition at corresponding positions in said cluster;
[0088] For video-type visual elements, arranging video-type visual elements in the cluster that satisfy a second predetermined condition at corresponding positions in the cluster;
[0089] The first predetermined condition relates to original attribute information of visual elements of picture type, and the second predetermined condition relates to the order of visual elements of video type within a cluster.
[0090] To restore the first web page, the same visual elements as those in the first web page should be displayed at the same positions in the generated second web page as much as possible. When clustering according to the original position information, the visual elements at the same original positions can be classified into the same cluster, so that the visual elements can be easily arranged by clustering them one by one to restore the first web page.
[0091] In some embodiments, the original position information may be at least one of a top value, a left value, and a width / height value.
[0092] In some embodiments, if the original position information is a top value, the visible elements in the corresponding cluster can be arranged one by one from smallest to largest according to the top value.
[0093] In some embodiments, the original attribute information of the picture-type visible element may further include original size information, and the first predetermined condition is that the original size of the picture-type visible element is maximum.
[0094] In some embodiments, the second predetermined condition is the highest ranked visible element of the video image in the cluster.
[0095] In some embodiments, the first web page contains a large number of visual elements, for example, various types of visual elements exist simultaneously in the same position. If directly arranged according to S32, the various types of visual elements will overlap. In this case, S32 further includes the following steps:
[0096] For each cluster corresponding to the original location information, filter the visible elements with the highest priority according to the priority of the types of visible elements;
[0097] Arrange the visible elements according to the following rules, based on their type:
[0098] In the case of text-type visual elements, arranging all text-type visual elements included in said cluster at corresponding positions in said cluster;
[0099] for picture-type visible elements, arranging picture-type visible elements in said cluster that satisfy a first predetermined condition at corresponding positions in said cluster;
[0100] For video-type visual elements, the video-type visual elements in the cluster that satisfy a second predetermined condition are arranged at corresponding positions in the cluster.
[0101] In some embodiments, the priority of the types of visual elements may be, from highest priority to lowest, video type visual elements, picture type visual elements and text type visual elements.
[0102] In some embodiments, step S3 further includes the following steps before step S31:
[0103] S30, filtering at least some of the visible elements from the visible elements based on the type of the visible elements;
[0104] said filtering being based on at least one of the following rules:
[0105] For text-type visible elements, retain text-type visible elements whose original font information meets the specified font conditions;
[0106] In the case of a visual element of picture type, retaining a visual element of picture type whose original size satisfies a predetermined size condition and / or retaining a visual element of picture type whose original picture resource satisfies a predetermined picture resource condition;
[0107] In the case of video type visual elements, all video type visual elements that satisfy the predetermined format conditions are retained.
[0108] In some embodiments, the predetermined font condition is that the original font size is larger than the median font size of all text-type visible elements.
[0109] In some embodiments, the predetermined size condition is that the original size is greater than or equal to a predetermined ratio of the screen size, for example, the width is greater than or equal to 1 / 4 of the screen width and the product of the width and height is greater than or equal to 1 / 10 of the screen area.
[0110] In some embodiments, the predetermined picture resource condition may be a predetermined address source condition, for example, that the address of the picture resource is local or from a specific address.
[0111] In some embodiments, the predetermined format condition may be a playback format that the second web page can support, for example, mp4 format.
[0112] Taking FIG. 1 as an example, the filter in S30 discards the product logo because its original size does not meet the predetermined size requirement, and discards the product introduction information because its font size does not meet the predetermined font requirement.
[0113] The filtering operation in step S30 takes into consideration the importance and visual effect of the visible elements in advance to optimize potentially unimportant visible elements, further narrow down the range of visible elements to be placed, and optimize the entire page generation process. For example, font conditions are set taking into account that small font text may represent unimportant text information, picture size conditions are set taking into account that if a picture is too small, it will not be eye-catching and the fill effect will be insufficient, picture resource conditions are set taking into account the difficulty of acquiring pictures and loading speed, etc. Video resources have powerful visual effects, and all video resources should be kept within the range of supported formats as much as possible.
[0114] The above examples each include specific steps of generating a web page. It should be understood that to realize the above functions, the corresponding steps can be executed by a computer including a hardware structure and / or software module corresponding to each function that executes the above specific steps. Those skilled in the art will easily understand that the present disclosure can be realized in the form of hardware or a combination of software and hardware by combining the steps of each example described in the embodiments disclosed herein. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may implement the described functions using different methods for each specific application, but such implementation should not be considered as going beyond the scope of the present disclosure.
[0115] In the embodiments of the present disclosure, a computer can be divided into functional units based on the above-described exemplary method. For example, each functional module can be divided into individual functions, or two or more functions can be integrated into a single processing module. The integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the module division in the embodiments of the present disclosure is only a rough outline and merely a logical functional division, and other division methods may be used in actual implementation.
[0116] When each functional module is divided into corresponding functions, an exemplary embodiment of the present disclosure provides a web page generating device, which is located at the terminal or the server side. Figure 5 shows a schematic diagram of a web page generating device according to an exemplary embodiment of the present disclosure. As shown in Figure 5, the web page generating device 500 includes:
[0117] an extraction module 501 for extracting visible elements from a first web page;
[0118] an acquiring module 502 for acquiring original attribute information of the visual element, the original attribute information including original position information, the original position information being used to describe an arrangement position of the visual element on the first web page;
[0119] a web page generation module (503) for generating a second web page based on the original location information, the second web page including at least some of the visible elements, and in the second web page, the at least some of the visible elements are arranged based on the original location information;
[0120] The arrangement positions of the at least some of the visible elements on the second web page are the same as their arrangement positions on the first web page.
[0121] 6 shows a schematic block diagram of an electronic device according to an exemplary embodiment of the present disclosure. As shown in FIG. 6, the electronic device 600 includes a memory 602 and a processor 601 coupled to the memory 602, and the processor 601 can execute corresponding steps in the above-described web page generation method.
[0122] In some embodiments, memory 602 may include read-only memory and random access memory and may provide operating instructions and data to the processor, and a portion of the memory may include non-volatile random access memory (NVRAM).
[0123] In some embodiments, as shown in FIG. 6 , processor 601 executes corresponding operations by calling operation instructions stored in memory (which may be stored in an operating system). Processor 601 controls any processing operations of the terminal device, and may also be referred to as a central processing unit (CPU). Memory 602 may include read-only memory and random access memory, and also provides instructions and data to processor 601. A portion of memory 602 may further include NVRAM. For example, in an application, the memory, communication port, and memory are coupled via a bus system, which may include a power bus, a control bus, a status signal bus, etc. in addition to a data bus.
[0124] The method disclosed in the embodiments of the present disclosure may be applied to or implemented by a processor 601. The processor 601 may be an integrated circuit chip with signal processing functions. In the implementation process, each step of the method may be completed by a hardware integrated logic circuit in the processor 601 or by instructions in the form of software. The processor 601 may be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware assembly. The general-purpose processor may be a microprocessor, and the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present disclosure may be directly implemented by a hardware decoding processor or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a memory 602, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, or other storage media well-known in the art. The processor 601 reads the information in the memory 602 and completes the steps of the above method in combination with its hardware.
[0125] According to some embodiments of the present disclosure, when various operations / processes according to the present disclosure are implemented by software and / or firmware, programs constituting the software can be installed from a storage medium or a network onto a computer system having a dedicated hardware configuration, such as computer system 700 shown in Figure 7, and the computer system can perform various functions, including those described above, by installing various programs. Figure 7 shows a block diagram of an exemplary structure of a computer system that can be used according to an exemplary embodiment of the present disclosure.
[0126] A computer system may include various forms of computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. A computer system may also represent various forms of mobile terminal devices, such as personal digital assistants, mobile phones, smartphones, wearable devices, and other similar mobile terminal devices. The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the practice of the disclosure described and / or claimed herein.
[0127] 7, computer system 700 includes a computing unit 701 that can perform various appropriate operations and processes based on computer programs stored in read-only memory (ROM) 702 or loaded from storage unit 708 into random access memory (RAM) 703. RAM 703 can also store various programs and data necessary for the operation of computer system 700. Computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) ports 705 are also connected to bus 704.
[0128] Components within computer system 700 are connected to I / O ports 705, which include an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information into computer system 700, and may receive input numeric or character information and generate key signal inputs associated with user settings and / or function control of electronic devices. The output unit 707 may be any type of device capable of displaying information and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 704 includes, but is not limited to, a magnetic disk and an optical disk. The communications unit 709 enables the computer system 700 to exchange information / data with other devices over a computer network, such as the Internet and / or various telecommunications networks, and includes, but is not limited to, a wireless communications transceiver and / or chipset, such as a modem, a network card, an infrared communications device, a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communications device, and / or the like.
[0129] The computing unit 701 may be any of a variety of general-purpose and / or special-purpose processing assemblies having processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that execute machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 executes the various methods and processes described above. For example, methods included in embodiments of the present disclosure may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 708. In some embodiments, some or all of the computer program may be loaded and / or installed into the computer system 700 via the ROM 702 and / or the communication unit 709. In some embodiments, the computing unit 701 may be configured to execute the web page generation method of the present disclosure in any other suitable manner (e.g., by firmware).
[0130] An exemplary embodiment of the present disclosure further provides a computer program product including a computer program, which, when executed by a processor of a computer, is used to cause the computer to perform a method according to an embodiment of the present disclosure.
[0131] Program products for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow diagrams and / or block diagrams are performed. The program code may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine, partially on a remote machine, or entirely on a remote machine or server.
[0132] An exemplary embodiment of the present disclosure further provides a storage medium having a computer program stored thereon, the program being used to implement the web page generation method provided by the present disclosure when executed by a processor.
[0133] In the context of this disclosure, a storage medium may be a tangible medium that contains or can store a program used by or in connection with an instruction execution system, apparatus, or device. The storage medium may be a machine signal medium or a machine-readable storage medium. A machine-readable medium includes, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More specific examples of a machine-readable storage medium may include one or more wire-based electrical connections, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0134] In the above embodiments, all or part of the implementation may be implemented by software, hardware, firmware, or any combination thereof. When implemented in software, all or part of the implementation may be in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of the present disclosure is executed. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a terminal, a user device, or another programmable device. The computer program or instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer program or instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium may be any available medium accessible by a computer, or a data storage device, such as a server or data center, in which one or more available media are integrated. The available media include magnetic media (e.g., floppy disks, hard disks, magnetic tapes, etc.), optical media (e.g., digital video discs (DVDs)), and semiconductor media (e.g., solid state drives (SSDs)).
[0135] Although the present disclosure has been described with reference to specific features and embodiments thereof, it will be apparent that various modifications and combinations can be made without departing from the spirit and scope of the present disclosure. Therefore, the specification and drawings are merely illustrative of the present disclosure as defined by the appended claims, and are intended to cover all modifications, variations, combinations, or equivalents within the scope of the present disclosure. Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is intended to include those modifications and variations.
Claims
1. A web page generation method, comprising: extracting visible elements from a first web page; obtaining original attribute information of the visual element, the original attribute information including original position information, the original position information being used to describe an arrangement position of the visual element on the first web page; generating a second web page based on the original location information, the second web page including at least some of the visible elements, and in the second web page, the at least some of the visible elements are arranged based on the original location information; the arrangement positions of the at least some of the visible elements on the second web page are the same as the arrangement positions of the at least some of the visible elements on the first web page; Web page generation methods.
2. generating a second web page based on the original location information; clustering at least some of the visible elements based on the original position information; In each cluster corresponding to the original position information, arranging the visible elements based on the type of the visible elements according to the following rules: For text-type visual elements, arranging all text-type visual elements included in the cluster at corresponding positions in the cluster; for picture-type visible elements, arranging picture-type visible elements in said cluster that satisfy a first predetermined condition at corresponding positions in said cluster; for video-type visual elements, arranging video-type visual elements in the cluster that satisfy a second predetermined condition at corresponding positions in the cluster; the first predetermined condition is related to original attribute information of the visual elements of the picture type, and the second predetermined condition is related to the order of the visual elements of the video type within a cluster; The web page generation method of claim 1 .
3. 3. The web page generating method according to claim 2, wherein the original attribute information of the picture-type visible element further includes original size information, and the first predetermined condition is that the picture-type visible element in the cluster has the largest original size.
4. 3. The method of claim 2, wherein the second predetermined condition is a visible element of the highest ranked video image in the cluster.
5. After clustering at least some of the visible elements based on the original position information, For each cluster corresponding to the original location information, filtering the visible elements with the highest priority according to the priority of the types of visible elements; The web page generation method according to claim 2 .
6. The priority of the types of visible elements is: In order of priority from highest to lowest, these include video type visual elements, picture type visual elements, and text type visual elements. The web page generation method according to claim 5 .
7. generating a second web page based on the original location information; filtering at least some of the visible elements from the visible elements based on a type of the visible element; said filtering being based on at least one of the following rules: For text-type visible elements, retain the text-type visible elements whose original font meets the specified font conditions; In the case of picture-type visual elements, retaining picture-type visual elements whose original size satisfies a predetermined size condition and / or retaining picture-type visual elements whose original picture resource satisfies a predetermined picture resource condition; In the case of video type visual elements, all video type visual elements that satisfy the given format conditions are retained.
3. The web page generation method according to claim 1 or 2.
8. the predetermined font condition includes that the original font size is equal to or greater than the median font size of all visible elements of text type; the predetermined size condition includes that the original size is equal to or greater than a predetermined ratio of the screen size; the predetermined picture resource condition includes a predetermined address source condition; and / or the predetermined format conditions include playback formats that the second web page can support; The web page generation method according to claim 7.
9. The step of obtaining original attribute information of the visual element includes obtaining original attribute information of the visual element according to the type of the visual element according to the following rules: For a picture-type visible element, obtain original resource information, original size information and original position information of the picture-type visible element; For a text-type visual element, obtain original font information and original position information of the text-type visual element; For a video-type visual element, the method further includes the step of obtaining original position information of the video-type visual element that meets a predetermined format; The web page generation method of claim 1 .
10. The step of extracting visible elements from the first web page includes: loading the first web page into a browser; analyzing the loaded first web page; performing a flattening process on the analyzed first web page; extracting visible elements from the flattened first web page; The web page generation method of claim 1 .
11. A web page generation device, an extraction module for extracting visible elements from the first web page; an acquiring module for acquiring original attribute information of the visual element, the original attribute information including original position information, the original position information being used to describe an arrangement position of the visual element on the first web page; a web page generation module for generating a second web page based on the original location information, the second web page including at least some of the visible elements, and in the second web page, the at least some of the visible elements are arranged based on the original location information; the arrangement positions of the at least some of the visible elements on the second web page are the same as the arrangement positions of the at least some of the visible elements on the first web page; Web page generator.
12. 11. An electronic device comprising a memory and a processor coupled to said memory, wherein instructions are stored in said memory and, when executed by said processor, the method for generating a web page according to any one of claims 1 to 10 is implemented.
13. A storage medium having a computer program stored thereon, the computer program being used to implement the web page generation method according to any one of claims 1 to 10 when executed by a processor.
14. A computer program product which, when executed by a processor, implements the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Web content adaptation processes and systems
JP2007509385A
System, apparatus, method and program for converting markup language document
JP2009176144A
Extracting key content from web pages
JP2015502603A