Page display method, electronic device and storage medium

By detecting and adjusting the width parameters of the target page, the problem that the display object cannot be fully displayed in the mobile terminal browser is solved, and the user experience is improved.

CN115033814BActive Publication Date: 2025-07-11ZHANGYUE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210470378.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2025-07-11
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

When viewing pages displayed on mobile terminals through a browser, some display objects cannot be fully displayed in the width direction, resulting in poor user experience.

Method used

By obtaining the page file of the target page, detect whether there is a target object with the width to be replaced, and adjust the target width parameter to the target value to ensure that the target object is fully displayed within the screen.

Benefits of technology

Improves the display effect of the target objects in the target page in terms of width and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033814B_ABST
    Figure CN115033814B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a page display method, an electronic device, and a storage medium. Among them, the page display method includes: obtaining a page file corresponding to a target page; detecting whether there is a target object with a width to be replaced in the target page according to the page file; if it is detected that there is a target object in the target page, adjusting a target width parameter in the page file to a target value, where the target width parameter is a width-related parameter of the target object; and displaying the target page based on the adjusted page file. According to the embodiments of the present disclosure, it is possible to make the target object in the target page display normally in terms of width and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and in particular, to a page display method, an electronic device, and a storage medium. Background Art

[0002] With the rapid development of the Internet, on the basis of meeting the public usability, the user experience becomes increasingly important. In some cases, users can obtain different viewing experiences by viewing some pages displayed on a mobile terminal through a browser.

[0003] However, in the related technologies, when viewing some pages displayed on a mobile terminal through a browser, the page resources adapted to the mobile terminal are usually directly displayed on the browser, resulting in some page incompatibility situations, such as a situation where a certain display object in the page cannot be fully displayed within the screen in the width direction and other abnormal display situations of display objects, thus affecting the user experience. Summary of the Invention

[0004] To solve the above technical problems, the present disclosure provides a page display method, an electronic device, and a storage medium.

[0005] In a first aspect, the present disclosure provides a page display method, including:

[0006] Obtaining a page file corresponding to a target page;

[0007] Detecting whether there is a target object with a width to be replaced in the target page according to the page file;

[0008] If it is detected that there is a target object in the target page, adjusting a target width parameter in the page file to a target value, where the target width parameter is a parameter related to the width of the target object;

[0009] Displaying the target page based on the adjusted page file.

[0010] In a second aspect, the present disclosure provides an electronic device, including a processor and a memory, where the memory is used to store executable instructions, and the executable instructions cause the processor to perform the following operations:

[0011] Obtaining a page file corresponding to a target page;

[0012] Detecting whether there is a target object with a width to be replaced in the target page according to the page file;

[0013] If it is detected that there is a target object in the target page, adjusting a target width parameter in the page file to a target value, where the target width parameter is a parameter related to the width of the target object;

[0014] Displaying the target page based on the adjusted page file.

[0015] In a third aspect, the present disclosure provides a computer-readable storage medium storing a computer program, which when executed by a processor causes the processor to implement the page display method of the first aspect.

[0016] The technical solutions provided by the embodiments of the present disclosure have the following advantages compared with the prior art:

[0017] For the page display method, electronic device and storage medium according to the embodiments of the present disclosure, after obtaining the page file corresponding to the target page, it is possible to detect whether there is a target object with a width to be replaced in the corresponding target page according to the page file. If it is detected that there is a target object in the target page, the target width parameter in the page file is adjusted to a target value, that is, the parameter related to the width of the target object is adjusted to the target value. Then, based on the adjusted page file, the target page is displayed. Since the target page with a target object having a width to be replaced is a page with an object that cannot be fully displayed within the screen in the width direction, it is possible to adjust the parameter related to the width of the target object with a width to be replaced, so that the target object in the target page can be normally displayed in terms of width, improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic and the original elements and elements are not necessarily drawn to scale.

[0019] Figure 1 FIG. 17 shows a schematic diagram of the display of an e-book page in the related art;

[0020] Figure 2 FIG. 21 shows a schematic flowchart of a page display method provided by an embodiment of the present disclosure;

[0021] Figure 3 FIG. 25 shows a schematic diagram of the display of an e-book page provided by an embodiment of the present disclosure;

[0022] Figure 4 FIG. 29 shows a schematic flowchart of another page display method provided by an embodiment of the present disclosure;

[0023] Figure 5 FIG. 33 shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0025] It should be understood that the steps recited in the method embodiments of the present disclosure can be executed in different orders and / or executed in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0026] The term "including" and its variations used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0027] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependent relationships.

[0028] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".

[0029] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0030] In the related art, when viewing some pages displayed on a mobile terminal through a browser, the page resources adapted to the mobile terminal are usually directly displayed on the browser, resulting in some page incompatibility situations.

[0031] For example, Figure 1 shows a schematic diagram of the display of an e-book page.

[0032] As Figure 1As shown in the figure, on the browser page 101, an e - book cover image 102 is displayed. Since the e - book cover image 102 is not adapted to the browser, on the browser page 101, the right side of the e - book cover image 102 extends beyond the screen and cannot be fully displayed, resulting in a horizontal scroll bar 103 appearing in the horizontal direction of the e - book cover image 102. When the user browses, they need to pull the horizontal scroll bar 103 left and right to view the entire e - book cover image 102, which affects the user experience.

[0033] It can be seen that when viewing some pages displayed on a mobile terminal through a browser, there will be situations where a certain display object on the page cannot be fully displayed within the screen in the width direction, etc., resulting in abnormal display of the display object and thus affecting the user experience.

[0034] To solve the above problems, the embodiments of the present disclosure provide a page display method, an electronic device, and a storage medium that can enable a target object in a target page to be normally displayed in terms of width.

[0035] Next, first, in combination with Figures 2-4 the page display method provided by the embodiments of the present disclosure will be described.

[0036] The page display method provided by the embodiments of the present disclosure can be executed by an electronic device capable of providing page display functions. Among them, the electronic device may include, but is not limited to, mobile terminals such as smart phones, laptop computers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), wearable devices, etc., and fixed terminals such as digital TVs, desktop computers, and smart home devices.

[0037] Figure 2 The flowchart of a page display method provided by the embodiments of the present disclosure is shown.

[0038] As Figure 2 shown, the page display method may include the following steps.

[0039] S210. Obtain the page file corresponding to the target page.

[0040] In the embodiments of the present disclosure, when a user wants to browse a target page through a browser on an electronic device, the target page can be opened on the electronic device through the browser. At this time, the electronic device can obtain the page file corresponding to the target page in response to the user's operation of opening the target page.

[0041] In some embodiments, the electronic device can receive and obtain the page file corresponding to the target page uploaded by the user.

[0042] In some other embodiments, the electronic device may receive and respond to a user's click operation on a page link, and download the page file corresponding to the target page based on the page link.

[0043] Optionally, the target page may be different types of pages. For example, it may be an e-book page, a news page, a video page, etc., which is not limited here.

[0044] Optionally, the page file may be the source file of the target page. Among them, the source file may be a code file written by a programmer in a language supported by a development tool. The code may be a clear system of rules in which a set of characters, symbols, or signal elements represent information in a discrete form.

[0045] Optionally, the page file may include a code file with the standard layout style corresponding to the target page, but is not limited thereto.

[0046] S220. Detect whether there is a target object with a width to be replaced in the target page according to the page file.

[0047] In the embodiments of the present disclosure, after the electronic device obtains the page file corresponding to the target page, it may detect whether there is a target object with a width to be replaced in the corresponding target page according to the page file.

[0048] Among them, the width may be the horizontal width of the page.

[0049] Optionally, the target object with a width to be replaced refers to an object that cannot be completely displayed within the screen in the width direction, that is, the target object may be a page object that needs to adjust the width.

[0050] Optionally, the page object may be a page element in the target page.

[0051] Among them, the page element may be an element that composes the target page. For example, the page element may be a text element, a picture element, a control element, a link element, etc., but is not limited thereto.

[0052] Specifically, after the electronic device obtains the page file corresponding to the target page, it may parse the page file to obtain a data tree corresponding to the page file, and then based on the data tree, determine whether there is a target object with a width to be replaced in the target page.

[0053] Among them, the data tree can be understood as a tree structure formed by each page object and object container involved in the page file based on the standard layout style. The root node of the data tree can correspond to the object container that applies to all page objects and all other object containers within the display target inner surface, and the root node contains the standard layout style information of the corresponding object container. The root node can be connected to at least one first-level sub-node, and each first-level sub-node can correspond to a page object directly displayed within the object container corresponding to the root node or an object container directly displayed within the object container corresponding to the root node. Each first-level sub-node can contain the standard layout style information of the corresponding page object or object container. By analogy, the nodes at all levels of the data tree respectively correspond to page objects and object containers at all levels with hierarchical associations, and the root node to leaf nodes of the data tree can correspond to all page objects and object containers involved in the page file.

[0054] Therefore, the electronic device can detect whether the target page cannot be fully displayed on the screen during display based on the data tree. If it detects that there is an object in the target page that cannot be fully displayed within the screen in the width direction, it determines that there is a target object with a width to be replaced in the target page; if it detects that there is no object in the target page that cannot be fully displayed within the screen in the width direction, it determines that there is no target object with a width to be replaced in the target page.

[0055] S230. If a target object is detected in the target page, adjust the target width parameter in the page file to the target value, where the target width parameter is a parameter related to the width of the target object.

[0056] In the implementation of the present disclosure, after the electronic device detects whether there is a target object with a width to be replaced in the target page, if it detects that there is a target object with a width to be replaced in the target page, it adjusts the target width parameter in the page file to the target value, that is, adjusts the parameter related to the width of the target object in the page file to the target value.

[0057] Optionally, the target width parameter can be a parameter related to the width of the target object.

[0058] Optionally, the target value can be a value used to change the target width parameter.

[0059] Specifically, after the electronic device detects whether there is a target object with a width to be replaced in the target page, if it detects that there is a target object with a width to be replaced in the target page, the electronic device can find the target width parameter in the data tree, that is, find the parameter related to the width of the target object in the data tree. Thus, based on the mapping relationship between the data tree and the page file, it finds the code corresponding to the parameter related to the width of the target object in the page file, and then adjusts the code so that the parameter related to the width of the target object is adjusted to the target value.

[0060] S240. Display the target page based on the adjusted page file.

[0061] In an embodiment of the present disclosure, after the electronic device adjusts the target width parameter in the page file to a target value, it may display the corresponding target page according to the adjusted page file.

[0062] Specifically, after the electronic device adjusts the target width parameter in the page file to a target value, it may obtain the page file corresponding to the adjusted target page. The electronic device may parse the adjusted page file to obtain an adjusted data tree, and thus display the corresponding target page based on the adjusted data tree.

[0063] Therefore, in an embodiment of the present disclosure, after obtaining the page file corresponding to the target page, it is possible to detect whether there is a target object with a width to be replaced in the corresponding target page according to the page file. If it is detected that there is a target object in the target page, the target width parameter in the page file is adjusted to the target value, that is, the width-related parameter of the target object is adjusted to the target value. Then, based on the adjusted page file, the target page is displayed. Since the target page with a target object having a width to be replaced is a page with an object that cannot be fully displayed within the screen in the width direction, it is possible to adjust the width-related parameter of the target object with a width to be replaced, so that the target object in the target page can be normally displayed in terms of width, improving the user experience.

[0064] In some embodiments of the present disclosure, the electronic device may detect whether there is a target object with a width to be replaced in the target page according to different detection conditions, which will be described in detail below.

[0065] In some embodiments, S120 may specifically include: detecting whether there is a first object in the page file whose percentage width is greater than a preset percentage width threshold; if it is detected that there is a first object in the page file, the first object is used as the target object.

[0066] In an embodiment of the present disclosure, after the electronic device obtains the page file, it may detect whether there is a first object in the page file whose percentage width is greater than a preset percentage width threshold according to the data tree corresponding to the page file.

[0067] Specifically, the electronic device can traverse the data tree corresponding to the page file, that is, traverse the standard layout style information of each page object in the data tree, and compare the percentage width in the standard layout style information of each page object with a preset percentage width threshold. If the percentage width in any standard layout style information is greater than the preset percentage width threshold, the page object corresponding to the standard layout style information is determined as a first object with a percentage width greater than the preset percentage width threshold, so as to determine that there is a first object in the page file; if the percentage width in any standard layout style information is less than or equal to the preset percentage width threshold, it is determined that the page object corresponding to the standard layout style information is not a first object.

[0068] Optionally, the first object can be an object with a percentage width parameter greater than the preset percentage width threshold.

[0069] Optionally, the percentage width can be a percentage parameter used to define the width of the first object.

[0070] Optionally, the preset percentage width threshold can be the maximum percentage width allowed for the preset page. For example, the preset percentage width threshold can be 100%.

[0071] Specifically, taking the preset percentage width threshold of 100% as an example, the electronic device can search in the data tree corresponding to the page file to find out if there is a percentage width parameter greater than 100%, and use the object with the percentage width parameter greater than 100% as the first object.

[0072] Furthermore, if the electronic device detects that there is a first object in the page file with a percentage width greater than the preset percentage width threshold, the first object is used as the target object.

[0073] Specifically, taking the preset percentage width threshold of 100% as an example, if the electronic device detects that there is a percentage width parameter greater than 100% in the page file, the first object corresponding to the percentage width parameter is used as the target object, that is, there is a target object with a width to be replaced in the target page corresponding to the page file.

[0074] Thus, in the embodiments of the present disclosure, after the electronic device detects that there is a first object with a percentage width greater than the preset percentage width threshold, it can determine that there is a target object with a width to be replaced in the target page, that is, an object that cannot be fully displayed within the screen in the width direction, so as to adjust the width-related parameters of the target object with the width to be replaced, so that the target object in the target page can be normally displayed in terms of page width, improving the user experience.

[0075] In some other embodiments, S120 may specifically include: detecting whether there is a second object with a negative margin value in the page file; if a second object is detected in the page file, using the second object as the target object.

[0076] In the embodiments of the present disclosure, after obtaining the page file, the electronic device may detect whether there is a second object with a negative margin value in the page file according to the data tree corresponding to the page file.

[0077] Specifically, the electronic device may traverse the data tree corresponding to the page file, that is, traverse the standard layout style information of each page object in the data tree, and query the margins in the standard layout style information of each page object. If the margin in any standard layout style information is a negative margin value, the page object corresponding to the standard layout style information is determined as the second object with a negative margin value, so as to determine that there is a second object in the page file; if the margin in any standard layout style information is not a negative margin value, it is determined that the page object corresponding to the standard layout style information is not a second object.

[0078] Optionally, the second object may be an object with a negative margin parameter as the negative margin value.

[0079] Optionally, the margin may be a margin value parameter for defining the width of the second object.

[0080] Optionally, the negative margin value may be a value with a negative margin, that is, the margin is less than 0. For example, the negative margin value may be -10 device independent pixels (DP).

[0081] Specifically, after obtaining the page file, the electronic device may search in the page file to find whether there is an object with a margin value parameter as the negative margin value, that is, an object with a negative margin, and use the object with a negative margin as the second object.

[0082] Further, if the electronic device detects that there is a second object with a negative margin value in the page file, the second object is used as the target object.

[0083] Specifically, taking the negative margin value of -10 DP as an example, if the electronic device detects that there is a margin with a negative margin value in the page file, such as a margin of -10 DP, the second object corresponding to the margin is used as the target object, that is, there is a target object with a width to be replaced in the target page corresponding to the page file.

[0084] Thus, in the embodiments of the present disclosure, after the electronic device detects a second object with a negative outer margin value, it can determine that the target object with a width to be replaced in the target page is the object that cannot be fully displayed within the screen in the width direction. Then, the width-related parameters of the target object with a width to be replaced are adjusted, so that the target object in the target page can be normally displayed in terms of page width, improving the user experience.

[0085] In some other embodiments, S120 may specifically include: detecting whether there is a third object in the page file whose object width is greater than a preset width threshold; if it is detected that there is a third object in the page file, the third object is used as the target object.

[0086] Specifically, the electronic device can traverse the data tree corresponding to the page file, that is, traverse the standard layout style information of each page object in the data tree, and compare the object width in the standard layout style information of each page object with the preset width threshold. If the object width in any standard layout style information is greater than the preset width threshold, the page object corresponding to this standard layout style information is determined as the third object whose object width is greater than the preset width threshold, thereby determining that there is a third object in the page file; if the object width in any standard layout style information is less than or equal to the preset width threshold, it is determined that the page object corresponding to this standard layout style information is not a third object.

[0087] In the embodiments of the present disclosure, after the electronic device obtains the page file, it can detect whether there is a third object in the page file whose object width is greater than a preset width threshold according to the data tree corresponding to the page file.

[0088] Optionally, the third object may be an object whose object width parameter is greater than the preset width threshold.

[0089] Optionally, the object width may be a width value parameter used to define the width of the third object.

[0090] Optionally, the preset width threshold may be a preset maximum width value. Among them, the width value may be in units of viewport width (VW). For example, the preset width threshold may be 20VW.

[0091] Specifically, taking the preset width threshold of 20VW as an example, after the electronic device obtains the page file, it can search in the page file for an object whose object width is greater than the preset width threshold, that is, an object whose object width is greater than 20VW, and use the object whose object width is greater than 20VW as the third object.

[0092] Furthermore, if the electronic device detects that there is a third object in the page file whose object width is greater than the preset width threshold, the third object is used as the target object.

[0093] Specifically, taking the preset width threshold as 20VW as an example, if the electronic device detects that there is an object in the page file whose width is greater than the preset width threshold of 20VW, then the third object corresponding to the object width is taken as the target object, that is, there is a target object with a width to be replaced in the target page corresponding to the page file.

[0094] Thus, in the embodiments of the present disclosure, after the electronic device detects the third object whose object width is greater than the preset width threshold, it can determine that there is a target object with a width to be replaced in the target page, that is, an object that cannot be fully displayed within the screen in the width direction, so as to adjust the width-related parameters of the target object with the width to be replaced, so that the target object in the target page can be normally displayed in terms of the page width, improving the user experience.

[0095] In some other embodiments of the present disclosure, before adjusting the target width parameter in the page file to the target value, the electronic device also needs to perform pre-layout processing on the page file to determine the target value for adjusting the target width parameter based on the pre-layout result.

[0096] Optionally, before adjusting the target width parameter in the page file to the target value, the page display method may further include: inputting the page file into a preset layout engine for pre-layout to obtain a pre-layout result; and determining the target value corresponding to the target width parameter according to the pre-layout result.

[0097] In the embodiments of the present disclosure, the electronic device can input the page file into a preset layout engine for pre-layout to obtain the corresponding pre-layout result, and then determine the target value corresponding to the target width parameter according to the pre-layout result.

[0098] Optionally, the preset layout engine may be an engine pre-trained for pre-layout of page files. The preset layout engine may be trained for the model of the electronic device and / or the browser used by the electronic device.

[0099] Specifically, the electronic device can input the page file into a preset layout engine for pre-layout to obtain the corresponding pre-layout result, where the pre-layout result may be a corresponding layout tree.

[0100] Optionally, the layout tree is similar to the data tree.

[0101] Among them, the layout tree can be understood as a tree structure formed by each page object and object container involved after pre-layout of the page file based on the pre-layout style. The root node of the layout tree can correspond to the object container applied to all page objects and all other object containers within the target page to be displayed, and the root node contains the pre-layout style information of the corresponding object container. The root node can be connected to at least one first-level child node, and each first-level child node can correspond to a page object directly displayed within the object container corresponding to the root node or an object container directly displayed within the object container corresponding to the root node. Each first-level child node can contain the pre-layout style information of the corresponding page object or object container. By analogy, each level of nodes in the data tree corresponds to page objects and object containers at all levels associated hierarchically, and the root node to leaf nodes of the data tree can correspond to all page objects and object containers involved in the page file.

[0102] Furthermore, the electronic device can determine the target value corresponding to the target width parameter according to the pre-layout result.

[0103] Thus, in the embodiments of the present disclosure, the electronic device can perform pre-layout on the page file to obtain the target value used to replace the target width parameter, so as to adjust the width-related parameters of the target object with the width to be replaced, so that the target object in the target page can be normally displayed in terms of page width, improving the user experience.

[0104] The following will detail how the electronic device obtains different target values corresponding to different detection conditions through pre-layout.

[0105] In some embodiments, when the electronic device determines that the target object is a first object with a percentage width greater than a preset percentage width threshold, the target width parameter can be a percentage width parameter at this time.

[0106] Optionally, determining the target value corresponding to the target width parameter according to the pre-layout result can specifically include: determining the first object content width value corresponding to the target object and the second object content width value corresponding to the upper-level object of the target object according to the pre-layout result; using the ratio of the first object content width value to the second object content width value as the target value.

[0107] In the embodiments of the present disclosure, after the electronic device determines that the target object is a first object with a percentage width greater than a preset percentage width threshold, it can search for the first object in the obtained layout tree and obtain the first object content width value corresponding to the first object. Then, the electronic device can also search for the upper-level object of the first object in the obtained layout tree and obtain the second object content width value corresponding to the upper-level object.

[0108] Specifically, the electronic device can query the node corresponding to the object container to which the first object belongs in the layout tree, obtain the pre-layout style information included in the node after querying the node, and then extract the first object content width value corresponding to the first object from the obtained pre-layout style information; similarly, the electronic device can query the node corresponding to the object container to which the upper-level object of the first object belongs in the layout tree, obtain the pre-layout style information included in the node after querying the node, and then extract the second object content width value corresponding to the upper-level object of the first object from the obtained pre-layout style information.

[0109] Optionally, the upper-level object of the first object can be a page object within the upper-level object container of the object container to which the first object belongs.

[0110] Optionally, the first object content width value can be the content width parameter related to the width of the first object in the layout tree.

[0111] Optionally, the second object content width value can be the content width parameter related to the width of the upper-level object corresponding to the first object in the layout tree.

[0112] Specifically, the electronic device can search for and obtain the first object content width value corresponding to the width-related of the first object and the second object content width value corresponding to the width-related of the upper-level object corresponding to the first object in the layout tree.

[0113] Further, after the electronic device obtains the first object content width value and the second object content width value, it takes the ratio of the first object content width value and the second object content width value as the target value.

[0114] Specifically, the electronic device can divide the obtained first object content width value by the second object content width value and then multiply by 100 to obtain the percentage ratio of the first object content width value and the second object content width value, and then take the obtained percentage ratio as the target value.

[0115] Thus, in the embodiments of the present disclosure, the electronic device can take the percentage ratio of the first object content width value corresponding to the first object after layout and the second object content width value corresponding to the upper-level object of the first object as the target value, so as to adjust the width-related parameters of the target object with the width to be replaced, so that the target object in the target page can be normally displayed in terms of page width, improving the user experience.

[0116] Optionally, the electronic device determines a first object content width value corresponding to the target object and a second object content width value corresponding to the upper-level object of the target object, which may specifically include: obtaining a first layout width value of the target object, a first layout margin of the target object, a second layout width value of the upper-level object, and a second layout margin of the upper-level object in the pre-layout result; taking the difference between the first layout width value and the first layout margin as the first object content width value; taking the difference between the second layout width value and the second layout margin as the second object content width value.

[0117] In the embodiments of the present disclosure, after obtaining the layout tree, the electronic device may search for the first object and the upper-level object of the first object in the layout tree, and obtain the first layout width value of the first object, the first layout margin of the first object, the second layout width value of the upper-level object of the first object, and the second layout margin of the upper-level object of the first object.

[0118] Optionally, the first layout width value may be a width value parameter after pre-layout of the content corresponding to the first object.

[0119] Optionally, the first layout margin may be a margin parameter after pre-layout of the content corresponding to the first object.

[0120] Optionally, the second layout width value may be a width value parameter after pre-layout of the content corresponding to the upper-level object of the first object.

[0121] Optionally, the second layout margin may be a margin parameter after pre-layout of the content corresponding to the upper-level object of the first object.

[0122] Further, after obtaining the first layout width value, the first layout margin, the second layout width value, and the second layout margin, the electronic device may subtract the first layout margin from the first layout width value, take the obtained difference as the first object content width value, and may also subtract the second layout margin from the second layout width value, take the obtained difference as the second object content width value.

[0123] For example, the electronic device may search for the first object A and the upper-level object B of the first object in the layout tree, and obtain the first layout width value of 18 pixels (PX) and the first layout margin of 1 PX of the first object A, and obtain the second layout width value of 20 PX and the second layout margin of 2 PX of the upper-level object B of the first object. The electronic device may subtract the first layout margin of 1 PX from the first layout width value of 18 PX to obtain a difference of A 17 PX, and subtract the second layout margin of 2 PX from the second layout width value of 20 PX to obtain a difference of B 18 PX, so as to obtain the first object content width value of 17 PX and the second object content width value of 18 PX.

[0124] Further, the electronic device can divide the width value 17PX of the first object content by the width value 18PX of the second object content and then multiply by 100 to obtain a percentage ratio of 94%, that is, the target value can be 94%, which can be used to replace the target width parameter in the page file.

[0125] Thus, in the embodiments of the present disclosure, the electronic device can calculate to obtain the width value of the first object content and the width value of the second object content, so that the obtained target value is more accurate, thereby adjusting the width-related parameters of the target object with a width to be replaced, so that the target object in the target page can be normally displayed in terms of page width, improving the user experience.

[0126] In some other embodiments, when the electronic device determines that the target object is the second object with a negative margin value, the target width parameter can be a margin style at this time.

[0127] Optionally, determining the target value corresponding to the target width parameter according to the pre-layout result may specifically include: obtaining the third layout margin of the target object in the pre-layout result; converting the unit format of the third layout margin to the original unit format of the target layout style to obtain the target value.

[0128] In the embodiments of the present disclosure, after obtaining the layout tree, the electronic device can search for the target object in the layout tree, that is, search for the second object, and obtain the third layout margin of the second object after finding the second object.

[0129] Specifically, the electronic device can query the node corresponding to the object container to which the second object belongs in the layout tree, obtain the pre-layout style information included in the node after querying the node, and then extract the third layout margin corresponding to the second object from the obtained pre-layout style information.

[0130] Optionally, the third layout margin can be the margin parameter after pre-layout of the content corresponding to the second object.

[0131] Specifically, the electronic device can search for and obtain the second object and the third layout margin of the second object in the layout tree.

[0132] Further, after obtaining the third layout margin of the second object, the electronic device can convert the unit format of the third layout margin to the original unit format of the target layout style to obtain the target value.

[0133] For example, the unit format of the third layout margin can be PX.

[0134] Optionally, the target layout style can be the layout style corresponding to the margin of the second object in the data tree.

[0135] For example, the original unit format can be DP.

[0136] For example, an electronic device can obtain the third layout margin of a second object in a layout tree. For example, the third layout margin can be 5PX, and the electronic device can obtain the negative margin value of the second object in a data tree. For example, the negative margin value can be -10DP. At this time, the electronic device can convert the unit format of the third layout margin of 5PX to the original unit format DP based on the screen density. If the screen density is 160, the third layout margin of 5PX can be converted to 5DP, so that the target value of 5DP can be obtained.

[0137] Thus, in the embodiments of the present disclosure, the electronic device can convert the unit format of the third layout margin to obtain a target value, thereby adjusting the width-related parameters of a target object with a width to be replaced, so that the target object in the target page can be normally displayed in terms of page width, improving the user experience.

[0138] In still other embodiments, when the electronic device determines that the target object is a third object whose object width is greater than a preset width threshold, the target width parameter can be an object width style at this time.

[0139] Optionally, determining the target value corresponding to the target width parameter according to the pre-layout result can specifically include: obtaining the screen width value and the third layout width value of the target object in the pre-layout result; comparing the third layout width value with the screen width value to obtain the object screen width ratio; and using the product of the object screen width ratio and a preset height value as the target value.

[0140] In the embodiments of the present disclosure, after obtaining the layout tree, the electronic device can query the target object, that is, the third object, in the layout tree, and obtain the third layout width value of the third object and the screen width value.

[0141] Specifically, the electronic device can query the node corresponding to the object container to which the third object belongs in the layout tree. After querying the node, obtain the pre-layout style information included in the node, and then extract the third layout width value corresponding to the third object from the obtained pre-layout style information.

[0142] Optionally, the third layout width value can be a width value parameter after pre-layout of the content of the third object.

[0143] Optionally, the screen width value can be a width value parameter of the screen corresponding to the browser.

[0144] Specifically, the electronic device can search for and obtain the third layout width value and the screen width value of the third object in the layout tree.

[0145] Further, after obtaining the third layout width value and the screen width value, the electronic device can compare the third layout width value with the screen width value to obtain the object screen width ratio, and then use the product of the object screen width ratio and the preset height value as the target value.

[0146] Optionally, the object screen width ratio can be the ratio obtained by comparing the third layout width value with the screen width value.

[0147] Optionally, the preset height value can be a preset height value. For example, the preset height value can be 100VW.

[0148] For example, the electronic device can search for and obtain the third layout width value of 22PX and the screen width value of 25PX in the layout tree. Then, the electronic device can compare the third layout width value of 22PX with the screen width value of 25PX to obtain an object screen width ratio of 0.88. Then, the electronic device can multiply the obtained object screen width ratio of 0.88 by the preset height value of 100VW to obtain a product of 88%, and then use the product of 88% as the target value.

[0149] Thus, in the embodiments of the present disclosure, the electronic device can obtain the target value of the third object, and then adjust the width-related parameters of the target object with the width to be replaced, so that the target object in the target page can be normally displayed in terms of page width, improving the user experience.

[0150] In some other embodiments of the present disclosure, the electronic device can replace the target width parameter in the page file with the obtained target value, which will be described in detail below.

[0151] Optionally, adjusting the target width parameter in the page file to the target value may specifically include: adjusting the target width style corresponding to the target width parameter in the page file from the original value to the target value.

[0152] In the embodiments of the present disclosure, after obtaining the target value, the electronic device can adjust the target width style corresponding to the target width parameter in the page file from the original value to the target value.

[0153] Optionally, the target width style can be a code class for controlling the page object style. For example, the container style class can include width style, text style, font style, etc., but is not limited thereto.

[0154] Specifically, after determining that there is a target object in the target page, the electronic device can obtain the target width style of the target object from the source file corresponding to the page file, and adjust the original value in the target width style to the target value, so that the target width parameter in the page file is adjusted to the target value.

[0155] Figure 3 It shows a schematic diagram of the display of an e - book page provided by an embodiment of the present disclosure.

[0156] As Figure 3 shown, after the electronic device obtains the target value, it adjusts the target width parameter in the page file to the target value, and then based on the adjusted page file, displays the target page, thus obtaining Figure 3 the e - book cover image 302 in [reference]. After the electronic device adjusts the target width parameter in the page file corresponding to the e - book cover image 302 to the target value, the e - book cover image 302 can be completely displayed in the browser page 301, so that the e - book cover image 302 can display a normal page width, thereby improving the user experience.

[0157] Therefore, in the embodiment of the present disclosure, the width - related parameters of the target object with a width to be replaced are adjusted, so that the target object in the target page can be normally displayed in terms of page width, improving the user experience.

[0158] Figure 4 It shows a schematic flowchart of another page display method provided by an embodiment of the present disclosure. Taking the target page as an e - book page as an example for illustration.

[0159] As Figure 4 shown, the page display method may include the following steps.

[0160] S401. Obtain the page file corresponding to the target page.

[0161] In the embodiment of the present disclosure, the electronic device may obtain the page file corresponding to the target page. For example, it may obtain the page file corresponding to the e - book page.

[0162] S402. Determine whether there is a first object in the page file.

[0163] In the embodiment of the present disclosure, after the electronic device obtains the page file, it may detect whether there is a first object with a percentage width greater than a preset percentage width threshold in the page file according to the data tree corresponding to the page file. If it detects that there is a first object with a percentage width greater than the preset percentage width threshold in the page file, execute S406; if it detects that there is no first object with a percentage width greater than the preset percentage width threshold in the page file, execute S403.

[0164] Specifically, taking the preset percentage width threshold as 100% as an example, the electronic device may search in the data tree corresponding to the page file to find whether there is a percentage width parameter greater than 100%, and regard the object with the percentage width parameter greater than 100% as the first object.

[0165] S403. Whether there is a second object in the page file.

[0166] In an embodiment of the present disclosure, after obtaining the page file, the electronic device may detect whether there is a second object with a negative margin value in the page file according to the data tree corresponding to the page file. If it is detected that there is a second object with a negative margin value in the page file, execute S407; if it is detected that there is no second object with a negative margin value in the page file, execute S404.

[0167] Specifically, taking the negative margin value as -10DP as an example, if the electronic device detects that there is a margin with a negative margin value in the page file, such as a margin of -10DP, the second object corresponding to the margin is taken as the target object, that is, there is a target object with a width to be replaced in the target page corresponding to the page file.

[0168] S404. Whether there is a third object in the page file.

[0169] In an embodiment of the present disclosure, after obtaining the page file, the electronic device may detect whether there is a third object with an object width greater than a preset width threshold in the page file according to the data tree corresponding to the page file. If it is detected that there is a third object with an object width greater than the preset width threshold in the page file, execute S408; if it is detected that there is no third object with an object width greater than the preset width threshold in the page file, it means that there is no target object with a width to be replaced in the target page.

[0170] Specifically, taking the preset width threshold as 20VW as an example, after obtaining the page file, the electronic device may search in the page file for an object with an object width greater than the preset width threshold, that is, an object with an object width greater than 20VW, and take the object with an object width greater than 20VW as the third object.

[0171] S405. Perform pre-layout on the page file to obtain a pre-layout result.

[0172] In an embodiment of the present disclosure, the electronic device may input the page file into a preset layout engine for pre-layout to obtain a corresponding pre-layout result, and then determine the target value corresponding to the target width parameter according to the pre-layout result.

[0173] S406. If there is a first object in the page file, obtain the target value corresponding to the first object based on the pre-layout result.

[0174] In an embodiment of the present disclosure, if an electronic device detects that a first object exists in a page file, it may search for the first object in the obtained layout tree, and obtain a first object content width value corresponding to the first object. Then, the electronic device may also search for a parent object of the first object in the obtained layout tree, and obtain a second object content width value corresponding to the parent object, and use the ratio of the first object content width value to the second object content width value as a target value.

[0175] For example, the electronic device may search for a first object A and a parent object B of the first object in the layout tree, and obtain a first layout width value of 18 pixels (PX) and a first layout margin of 1 PX for the first object A, and obtain a second layout width value of 20 PX and a second layout margin of 2 PX for the parent object B of the first object. The electronic device may subtract the first layout margin of 1 PX from the first layout width value of 18 PX to obtain a difference A of 17 PX, and subtract the second layout margin of 2 PX from the second layout width value of 20 PX to obtain a difference B of 18 PX, so as to obtain a first object content width value of 17 PX and a second object content width value of 18 PX.

[0176] Further, the electronic device may divide the first object content width value of 17 PX by the second object content width value of 18 PX and then multiply by 100, so as to obtain a percentage ratio of 94%, that is, the target value may be 94%, which is used to replace a target width parameter in the page file.

[0177] S407. If a second object exists in the page file, based on the pre-layout result, obtain a target value corresponding to the second object.

[0178] In an embodiment of the present disclosure, if an electronic device detects that a second object exists in a page file, it may search for and obtain a third layout margin of the second object in the layout tree, and then convert the unit format of the third layout margin into an original unit format of a target layout style to obtain a target value.

[0179] For example, the electronic device may obtain a third layout margin of the second object in the layout tree. For example, the third layout margin may be 5 PX, and the electronic device may obtain a negative margin value of the second object in the data tree. For example, the negative margin value may be -10 DP. At this time, the electronic device may convert the unit format of the third layout margin of 5 PX into the original unit format DP based on the screen density. If the screen density is 160, the third layout margin of 5 PX may be converted into 5 DP, so as to obtain a target value of 5 DP.

[0180] S408. If a third object exists in the page file, based on the pre-layout result, obtain a target value corresponding to the third object.

[0181] In an embodiment of the present disclosure, if an electronic device detects that a third object exists in a page file, it may query and obtain the third layout width value of the third object in the layout tree, and obtain the screen width value. Then, it compares the third layout width value with the screen width value to obtain the ratio of the object's screen width, and takes the product of the ratio of the object's screen width and a preset height value as the target value.

[0182] For example, the electronic device may search and obtain the third layout width value of 22 PX and the screen width value of 25 PX in the layout tree. Then, the electronic device may compare the third layout width value of 22 PX with the screen width value of 25 PX to obtain the ratio of the object's screen width of 0.88. Then, the electronic device may multiply the obtained ratio of the object's screen width of 0.88 by the preset height value of 100 VW to obtain the product of 88%, and further take the product of 88% as the target value.

[0183] S409. Adjust the target width parameter in the page file to the target value.

[0184] In an embodiment of the present disclosure, after obtaining the target value, the electronic device may adjust the target width parameter in the page file to the target value.

[0185] S410. Display the target page based on the adjusted page file.

[0186] S410 is the same as S140, and will not be described herein again.

[0187] For the specific implementation manners of the above steps, please refer to the above text and will not be described herein again.

[0188] Thus, in an embodiment of the present disclosure, the width-related parameters of the target object with a width to be replaced are adjusted, so that the target object in the target page can be normally displayed in terms of the page width, improving the user experience.

[0189] Figure 5 FIG. shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.

[0190] The electronic device provided by an embodiment of the present disclosure may include, but is not limited to, mobile terminals such as smart phones, laptop computers, PDAs, PADs, PMPs, in-vehicle terminals (such as in-vehicle navigation terminals), wearable devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc.

[0191] It should be noted that Figure 5 The illustrated electronic device 500 is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0192] The electronic device 500 conventionally includes a processor 510 and a computer program product or a computer-readable medium in the form of a memory 520. The memory 520 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. The memory 520 has a storage space 521 for executable instructions (or program code) 5211 for performing any of the method steps in the above-described page display method. For example, the storage space 521 for the executable instructions may include respective executable instructions 5211 for implementing the various steps in the above page display method. These executable instructions may be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, optical discs (CDs), memory cards, or floppy disks. Such computer program products are typically portable or fixed storage units. The storage unit may have a storage segment or a storage space, etc., arranged similarly to the memory 520 in the Figure 5 electronic device 500. The executable instructions may be compressed in a suitable form, for example. Generally, the storage unit includes executable instructions for performing the method steps of the page display method according to the present disclosure, that is, code that can be read by a processor such as the processor 510, and when these codes are run by the electronic device 500, they cause the electronic device 500 to execute the respective steps in the above-described page display method.

[0193] Of course, for simplicity, Figure 5 only some of the components of the electronic device 500 related to the present disclosure are shown in the figure, and components such as buses, input / output interfaces, input devices, and output devices are omitted. In addition, according to specific application scenarios, the electronic device 500 may further include any other appropriate components.

[0194] Embodiments of the present disclosure further provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are run by a processor, the processor is caused to execute the page display method provided by the embodiments of the present disclosure.

[0195] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical link having one or more wires, a portable 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.

[0196] The above computer-readable medium may be included in the above electronic device; or may exist separately without being assembled into the electronic device.

[0197] In the embodiments of the present disclosure, program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The above programming languages include, but are not limited to, object-oriented programming languages - such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be linked to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or may be linked to an external computer (for example, by using an Internet service provider to link through the Internet).

[0198] This application discloses:

[0199] A1. A page display method, wherein the method includes:

[0200] Obtain a page file corresponding to a target page;

[0201] Detect whether there is a target object with a width to be replaced in the target page according to the page file;

[0202] If it is detected that there is a target object in the target page, adjust the target width parameter in the page file to a target value, where the target width parameter is a width-related parameter of the target object;

[0203] Based on the adjusted page file, display the target page.

[0204] A2. The method according to claim A1, wherein detecting whether there is a target object with a width to be replaced in the target page according to the page file includes:

[0205] Detecting whether there is a first object in the page file whose percentage width is greater than a preset percentage width threshold;

[0206] If it is detected that there is a first object in the page file, the first object is used as the target object.

[0207] A3. The method according to any one of claims A1 - A2, wherein detecting whether there is a target object with a width to be replaced in the target page according to the page file includes:

[0208] Detecting whether there is a second object in the page file whose margin is a negative margin value;

[0209] If it is detected that there is a second object in the page file, the second object is used as the target object.

[0210] A4. The method according to any one of claims A1 - A3, wherein detecting whether there is a target object with a width to be replaced in the target page according to the page file includes:

[0211] Detecting whether there is a third object in the page file whose object width is greater than a preset width threshold;

[0212] If it is detected that there is a third object in the page file, the third object is used as the target object.

[0213] A5. The method according to claim A1, wherein before adjusting the target width parameter in the page file to the target value, the method further includes:

[0214] Inputting the page file into a preset layout engine for pre - layout to obtain a pre - layout result;

[0215] Determining the target value corresponding to the target width parameter according to the pre - layout result.

[0216] A6. The method according to claim A5, wherein the target object is a first object whose percentage width is greater than a preset percentage width threshold, and the target width parameter is a percentage width parameter;

[0217] Wherein, determining the target value corresponding to the target width parameter according to the pre - layout result includes:

[0218] Determining the first object content width value corresponding to the target object and the second object content width value corresponding to the upper - level object of the target object according to the pre - layout result;

[0219] Taking the ratio of the first object content width value to the second object content width value as the target value.

[0220] A7. The method according to claim A6, wherein determining a first object content width value corresponding to the target object and a second object content width value corresponding to the upper-level object of the target object according to the pre-layout result includes:

[0221] Obtaining a first layout width value of the target object, a first layout margin of the target object, a second layout width value of the upper-level object, and a second layout margin of the upper-level object in the pre-layout result;

[0222] Taking the difference between the first layout width value and the first layout margin as the first object content width value;

[0223] Taking the difference between the second layout width value and the second layout margin as the second object content width value.

[0224] A8. The method according to claim A5, wherein the target object is a second object with a negative margin value, and the target width parameter is a margin style;

[0225] Wherein determining the target value corresponding to the target width parameter according to the pre-layout result includes:

[0226] Obtaining a third layout margin of the target object in the pre-layout result;

[0227] Converting the unit format of the third layout margin to the original unit format of the target layout style to obtain the target value.

[0228] A9. The method according to claim A5, wherein the target object is a third object with an object width greater than a preset width threshold, and the target width parameter is an object width style;

[0229] Wherein determining the target value corresponding to the target width parameter according to the pre-layout result includes:

[0230] Obtaining a screen width value and a third layout width value of the target object in the pre-layout result;

[0231] Comparing the third layout width value with the screen width value to obtain the object screen width ratio;

[0232] Taking the product of the object screen width ratio and a preset height value as the target value.

[0233] A10. The method according to any one of claims A1 - A9, wherein adjusting the target width parameter in the page file to the target value includes:

[0234] Adjusting the target width style corresponding to the target width parameter in the page file from the original value to the target value.

[0235] B11. An electronic device, comprising a processor and a memory, the memory being used to store executable instructions, and the executable instructions causing the processor to perform the following operations:

[0236] Obtain a page file corresponding to a target page;

[0237] Detect whether there is a target object with a width to be replaced in the target page according to the page file;

[0238] If it is detected that there is a target object in the target page, adjust the target width parameter in the page file to a target value, where the target width parameter is a width-related parameter of the target object;

[0239] Display the target page based on the adjusted page file.

[0240] B12. The electronic device according to claim B11, wherein when detecting whether there is a target object with a width to be replaced in the target page according to the page file, the executable instructions specifically cause the processor to perform:

[0241] Detect whether there is a first object in the page file whose percentage width is greater than a preset percentage width threshold;

[0242] If it is detected that there is a first object in the page file, use the first object as the target object.

[0243] B13. The electronic device according to any one of claims B11 - B12, wherein when detecting whether there is a target object with a width to be replaced in the target page according to the page file, the executable instructions specifically cause the processor to perform:

[0244] Detect whether there is a second object in the page file whose margin is a negative margin value;

[0245] If it is detected that there is a second object in the page file, use the second object as the target object.

[0246] B14. The electronic device according to any one of claims B11 - B13, wherein when detecting whether there is a target object with a width to be replaced in the target page according to the page file, the executable instructions specifically cause the processor to perform:

[0247] Detect whether there is a third object in the page file whose object width is greater than a preset width threshold;

[0248] If it is detected that there is a third object in the page file, use the third object as the target object.

[0249] B15. The electronic device according to claim B11, wherein before adjusting the target width parameter in the page file to the target value, the executable instructions further cause the processor to perform:

[0250] Input the page file into a preset typesetting engine for pre-typesetting to obtain a pre-typesetting result;

[0251] Determine the target value corresponding to the target width parameter according to the pre-typesetting result.

[0252] B16. The electronic device according to claim B15, wherein the target object is a first object with a percentage width greater than a preset percentage width threshold, and the target width parameter is a percentage width parameter;

[0253] Wherein, when determining the target value corresponding to the target width parameter according to the pre-typesetting result, the executable instruction specifically causes the processor to execute:

[0254] Determine the first object content width value corresponding to the target object and the second object content width value corresponding to the upper-level object of the target object according to the pre-typesetting result;

[0255] Take the ratio of the first object content width value to the second object content width value as the target value.

[0256] B17. The electronic device according to claim B16, wherein, when determining the first object content width value corresponding to the target object and the second object content width value corresponding to the upper-level object of the target object according to the pre-typesetting result, the executable instruction specifically causes the processor to execute:

[0257] Obtain the first typesetting width value of the target object, the first typesetting margin of the target object, the second typesetting width value of the upper-level object, and the second typesetting margin of the upper-level object in the pre-typesetting result;

[0258] Take the difference between the first typesetting width value and the first typesetting margin as the first object content width value;

[0259] Take the difference between the second typesetting width value and the second typesetting margin as the second object content width value.

[0260] B18. The electronic device according to claim B15, wherein the target object is a second object with a negative margin value, and the target width parameter is a margin style;

[0261] Wherein, when determining the target value corresponding to the target width parameter according to the pre-typesetting result, the executable instruction specifically causes the processor to execute:

[0262] Obtain the first typesetting margin of the target object in the pre-typesetting result;

[0263] Convert the unit format of the third typesetting margin to the original unit format of the target typesetting style to obtain the target value.

[0264] B19. The electronic device according to claim B15, wherein the target object is a third object whose object width is greater than a preset width threshold, and the target width parameter is an object width style;

[0265] Wherein, when determining the target value corresponding to the target width parameter according to the pre-layout result, the executable instruction specifically causes the processor to execute:

[0266] Obtain the screen width value and the first layout width value of the target object in the pre-layout result;

[0267] Compare the third layout width value with the screen width value to obtain the object screen width ratio;

[0268] Use the product of the object screen width ratio and the preset height value as the target value.

[0269] B20. The electronic device according to any one of claims B11 - B19, wherein when adjusting the target width parameter in the page file to the target value, the executable instruction specifically causes the processor to execute:

[0270] Adjust the target width style corresponding to the target width parameter in the page file from the original value to the target value.

[0271] C21. A computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, it causes the processor to implement the page display method according to any one of the above claims A1 - A10.

[0272] Each component embodiment of the present disclosure can be implemented in whole or in part by hardware, or by software modules running on one or more processors, or by a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the electronic device according to the embodiments of the present disclosure. The present disclosure can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present disclosure can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0273] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.

[0274] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although a number of specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented combinatorially in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.

[0275] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A page display method, characterized in that, The method includes: Obtaining a page file corresponding to a target page; Detecting whether there is a target object with a width to be replaced in the target page according to the page file; If it is detected that there is the target object in the target page, adjusting a target width parameter in the page file to a target value, where the target width parameter is a parameter related to the width of the target object; Displaying the target page based on the adjusted page file; Wherein, the detecting whether there is a target object with a width to be replaced in the target page according to the page file includes: Detecting whether there is a first object in the page file whose percentage width is greater than a preset percentage width threshold; If it is detected that there is the first object in the page file, using the first object as the target object; Wherein, before adjusting the target width parameter in the page file to the target value, the method further includes: Inputting the page file into a preset layout engine for pre-layout to obtain a pre-layout result; Determining the target value corresponding to the target width parameter according to the pre-layout result.

2. The method according to claim 1, wherein The detecting whether there is a target object with a width to be replaced in the target page according to the page file includes: Detecting whether there is a second object in the page file whose margin is a negative margin value; If it is detected that there is the second object in the page file, using the second object as the target object.

3. The method according to any one of claims 1-2, characterized in that, The detecting whether there is a target object with a width to be replaced in the target page according to the page file includes: Detecting whether there is a third object in the page file whose object width is greater than a preset width threshold; If it is detected that there is the third object in the page file, using the third object as the target object.

4. The method according to claim 1, characterized in that, The target object is a first object whose percentage width is greater than a preset percentage width threshold, and the target width parameter is a percentage width parameter; Wherein, the determining the target value corresponding to the target width parameter according to the pre-layout result includes: Determining a first object content width value corresponding to the target object and a second object content width value corresponding to the upper-level object of the target object according to the pre-layout result; Using the ratio of the first object content width value to the second object content width value as the target value.

5. The method according to claim 4, characterized in that, The determining the first object content width value corresponding to the target object and the second object content width value corresponding to the upper-level object of the target object according to the pre-layout result includes: Obtaining a first layout width value of the target object, a first layout margin of the target object, a second layout width value of the upper-level object, and a second layout margin of the upper-level object in the pre-layout result; Using the difference between the first layout width value and the first layout margin as the first object content width value; Using the difference between the second layout width value and the second layout margin as the second object content width value.

6. The method according to claim 1, wherein The target object is a second object whose margin is a negative margin value, and the target width parameter is a margin style; Among them, determining the target value corresponding to the target width parameter according to the pre-layout result includes: Obtaining the third layout margin of the target object in the pre-layout result; Converting the unit format of the third layout margin to the original unit format of the target layout style to obtain the target value.

7. The method according to claim 1, characterized in that The target object is a third object whose object width is greater than a preset width threshold, and the target width parameter is an object width style; Among them, determining the target value corresponding to the target width parameter according to the pre-layout result includes: Obtaining the screen width value and the third layout width value of the target object in the pre-layout result; Comparing the third layout width value with the screen width value to obtain the object screen width ratio; Taking the product of the object screen width ratio and a preset height value as the target value.

8. The method according to any one of claims 1-7, characterized in that, Adjusting the target width parameter in the page file to the target value includes: Adjusting the target width style corresponding to the target width parameter in the page file from the original value to the target value.

9. An electronic device, characterized in that, Including a processor and a memory, the memory is used to store executable instructions, and the executable instructions cause the processor to perform the following operations: Obtaining a page file corresponding to a target page; Detecting whether there is a target object with a width to be replaced in the target page according to the page file; If it is detected that there is the target object in the target page, adjusting the target width parameter in the page file to the target value, where the target width parameter is a parameter related to the width of the target object; Displaying the target page based on the adjusted page file; Among them, when detecting whether there is a target object with a width to be replaced in the target page according to the page file, the executable instructions specifically cause the processor to perform: Detecting whether there is a first object in the page file whose percentage width is greater than a preset percentage width threshold; If it is detected that there is the first object in the page file, taking the first object as the target object; Among them, before adjusting the target width parameter in the page file to the target value, the executable instructions further cause the processor to perform: Inputting the page file into a preset layout engine for pre-layout to obtain a pre-layout result; Determining the target value corresponding to the target width parameter according to the pre-layout result.

10. The electronic device according to claim 9, characterized in that, When detecting whether there is a target object with a width to be replaced in the target page according to the page file, the executable instructions specifically cause the processor to perform: Detecting whether there is a second object in the page file whose margin is a negative margin value; If it is detected that there is the second object in the page file, taking the second object as the target object.

11. The electronic device according to any one of claims 9-10, characterized in that, When detecting whether there is a target object with a width to be replaced in the target page according to the page file, the executable instructions specifically cause the processor to perform: Detecting whether there is a third object in the page file whose object width is greater than a preset width threshold; If it is detected that there is the third object in the page file, taking the third object as the target object.

12. The electronic device according to claim 9, wherein The target object is a first object with a percentage width greater than a preset percentage width threshold, and the target width parameter is a percentage width parameter; Wherein, when determining the target value corresponding to the target width parameter according to the pre-layout result, the executable instruction specifically causes the processor to execute: Determine a first object content width value corresponding to the target object and a second object content width value corresponding to the upper-level object of the target object according to the pre-layout result; Use the ratio of the first object content width value to the second object content width value as the target value.

13. The electronic device according to claim 12, wherein When determining the first object content width value corresponding to the target object and the second object content width value corresponding to the upper-level object of the target object according to the pre-layout result, the executable instruction specifically causes the processor to execute: Obtain a first layout width value of the target object, a first layout margin of the target object, a second layout width value of the upper-level object, and a second layout margin of the upper-level object in the pre-layout result; Use the difference between the first layout width value and the first layout margin as the first object content width value; Use the difference between the second layout width value and the second layout margin as the second object content width value.

14. The electronic device according to claim 9, wherein The target object is a second object with a negative margin value, and the target width parameter is a margin style; Wherein, when determining the target value corresponding to the target width parameter according to the pre-layout result, the executable instruction specifically causes the processor to execute: Obtain a third layout margin of the target object in the pre-layout result; Convert the unit format of the third layout margin to the original unit format of the target layout style to obtain the target value.

15. The electronic device according to claim 9, wherein The target object is a third object with an object width greater than a preset width threshold, and the target width parameter is an object width style; Wherein, when determining the target value corresponding to the target width parameter according to the pre-layout result, the executable instruction specifically causes the processor to execute: Obtain a screen width value and a third layout width value of the target object in the pre-layout result; Compare the third layout width value with the screen width value to obtain the object screen width ratio; Use the product of the object screen width ratio and a preset height value as the target value.

16. The electronic device according to any one of claims 9-15, characterized in that, When adjusting the target width parameter in the page file to the target value, the executable instruction specifically causes the processor to execute: Adjust the target width style corresponding to the target width parameter in the page file from the original value to the target value.

17. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which when executed by a processor, causes the processor to implement the page display method according to any one of the above claims 1-8.

Citation Information

Patent Citations

  • Terminal content adaptive display method and device as well as terminal

    CN105975576A

  • Page layout method and device

    CN109117210A