CN113377475A - Content display method and terminal equipment - Google Patents

Content display method and terminal equipment Download PDF

Info

Publication number
CN113377475A
CN113377475A CN202110689807.0A CN202110689807A CN113377475A CN 113377475 A CN113377475 A CN 113377475A CN 202110689807 A CN202110689807 A CN 202110689807A CN 113377475 A CN113377475 A CN 113377475A
Authority
CN
China
Prior art keywords
target
source file
page
preset
webpage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110689807.0A
Other languages
Chinese (zh)
Other versions
CN113377475B (en
Inventor
刘运璇
雷志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202110689807.0A priority Critical patent/CN113377475B/en
Publication of CN113377475A publication Critical patent/CN113377475A/en
Application granted granted Critical
Publication of CN113377475B publication Critical patent/CN113377475B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Abstract

The embodiment of the invention provides a content display method and device, and relates to the technical field of display. The method comprises the following steps: acquiring a first source file, wherein the first source file is a source file of a target webpage, and the target webpage comprises target content needing to be displayed in a native reader; setting target parameters in the first source file to preset values, and generating a second source file; the target parameter is a parameter for controlling the background transparency of the target webpage; loading the second source file in a preset webpage view to generate a display page of the target content, wherein the transparency of the background of the preset webpage view is a preset transparency; and displaying the display page on a user interface of a native reader in an overlapping manner. The embodiment of the invention is used for solving the problem that the multimedia content to be displayed can only be replaced by releasing a new version when the multimedia content is displayed in the Native reader based on a Native mode.

Description

Content display method and terminal equipment
Technical Field
The invention relates to the technical field of display, in particular to a content display method and terminal equipment.
Background
Native Application (Native App) refers to an Application program that is written and run based on a local operating system of a terminal device and using a Native program. Unlike Web applications (World Wide Web applications), which directly display a user interface obtained from a server, native applications implement typesetting and drawing of the user interface based on the capabilities of terminal devices.
Besides displaying text contents, the native reader also has the requirement of displaying multimedia contents such as images, animations, videos, controls and the like. The prior art generally shows multimedia content in a Native reader based on a Native mode. The multimedia content is displayed in the Native reader based on a Native mode, and elements of the multimedia content to be displayed need to be configured in an installation package of the Native reader in advance. When the native reader generates the content display page, firstly typesetting the text content by calling the text typesetting function of the system, then reading the elements of the pre-configured multimedia content and adding each element to the specified area above the text content, thereby generating the content display page for displaying the multimedia content.
Because when a certain multimedia content is displayed in a Native reader based on a Native mode, elements of the multimedia content need to be pre-configured into an installation package of the Native reader in advance, when the multimedia content to be displayed needs to be replaced, the multimedia content can be realized only by releasing a new version of the Native reader.
Disclosure of Invention
In view of the above, the present invention provides a content display method and a terminal device, which are used to solve the problem that when multimedia content is displayed in a Native reader in a Native-based manner, the multimedia content to be displayed can only be replaced by releasing a new version.
In order to achieve the above object, the embodiments of the present invention provide the following technical solutions:
in a first aspect, an embodiment of the present invention provides a content display method, including:
acquiring a first source file, wherein the first source file is a source file of a target webpage, and the target webpage comprises target content needing to be displayed in a native reader;
setting target parameters in the first source file to preset values, and generating a second source file; the target parameter is a parameter for controlling the background transparency of the target webpage;
loading the second source file in a preset webpage view to generate a display page of the target content, wherein the transparency of the background of the preset webpage view is a preset transparency;
and displaying the display page on a user interface of a native reader in an overlapping manner.
As an optional implementation manner of the embodiment of the present invention, the method further includes:
before the first source file is obtained, a preset image is displayed on a user interface of the native reader in an overlapping mode;
the displaying page is displayed on a user interface of a native reader in an overlapping mode, and the displaying page comprises the following steps: and replacing the preset image through the display page.
As an optional implementation manner of the embodiment of the present invention, the obtaining the first source file includes:
sending request information to a server, wherein the request information carries a uniform resource locator of the target webpage and a background color of a user interface of the native reader, and the request information is used for requesting the server to return a source file of the target webpage corresponding to the background color;
and receiving a hypertext markup language file of the target webpage corresponding to the background color sent by the server.
As an optional implementation manner of the embodiment of the present invention, the obtaining the first source file includes:
sending request information to a server, wherein the request information carries a uniform resource locator of the target webpage and a page turning mode of a native reader, and the request information is used for requesting the server to return a source file of the target webpage corresponding to the page turning mode;
and receiving a hypertext markup language file of the target webpage corresponding to the page turning mode, which is sent by the server.
As an optional implementation manner of the embodiment of the present invention, after the displaying page is displayed on the user interface of the native reader in an overlapping manner, the method further includes:
receiving a background color changing operation input by a user, wherein the background color changing operation is used for changing the background color of a user interface of the native reader into a target color;
and responding to the background color changing operation, changing the background color of the user interface of the native reader into the target color, and changing the color of at least one element in the display page into a color matched with the target color.
As an optional implementation manner of the embodiment of the present invention, after the displaying page is displayed on the user interface of the native reader in an overlapping manner, the method further includes:
receiving a page turning mode change operation input by a user, wherein the page turning mode change operation is used for changing the page turning mode of the native reader into a target mode;
and responding to the page turning mode changing operation, changing the page turning mode of the native reader into the target mode, and changing the layout mode of the elements in the display page into the layout mode matched with the target mode.
As an optional implementation manner of the embodiment of the present invention, before the second source file is loaded in the preset web page view, the method further includes:
generating a webpage view for displaying the target webpage, wherein the size and the shape of the webpage view are the same as those of a user interface of the native reader;
and taking the transparency of the background of the webpage view as a preset transparency, and acquiring the preset webpage view.
In a second aspect, an embodiment of the present invention provides a terminal device, including:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring a first source file which is a source file of a target webpage, and the target webpage comprises target content needing to be displayed in a native reader;
the setting unit is used for setting the target parameters in the first source file to preset values and generating a second source file; the target parameter is a parameter for controlling the background transparency of the target webpage;
the loading unit is used for loading the second source file in a preset webpage view to generate a display page of the target content, and the transparency of the background of the preset webpage view is a preset transparency;
and the display unit is used for displaying the display page on a user interface of the native reader in an overlapping manner.
As an optional implementation manner of the embodiment of the present invention, the display unit is further configured to, before the first source file is acquired, display a preset image on a user interface of the native reader in an overlapping manner, and replace the preset image with the display page.
As an optional implementation manner of the embodiment of the present invention, the obtaining unit is specifically configured to send request information to a server, where the request information carries a uniform resource locator of the target web page and a background color of a user interface of the native reader, and the request information is used to request the server to return a source file of the target web page corresponding to the background color; and receiving a hypertext markup language file of the target webpage corresponding to the background color sent by the server.
As an optional implementation manner of the embodiment of the present invention, the obtaining unit is specifically configured to send request information to a server, where the request information carries a uniform resource locator of the target web page and a page-turning mode of a native reader, and the request information is used to request the server to return a source file of the target web page corresponding to the page-turning mode; and receiving a hypertext markup language file of the target webpage corresponding to the page turning mode, which is sent by the server.
As an optional implementation manner of the embodiment of the present invention, the display unit is further configured to receive a background color changing operation input by a user after the display page is displayed in a superimposed manner on the user interface of the native reader, where the background color changing operation is used to change a background color of the user interface of the native reader to a target color; and responding to the background color changing operation, changing the background color of the user interface of the native reader into the target color, and changing the color of at least one element in the display page into a color matched with the target color.
As an optional implementation manner of the embodiment of the present invention, the display unit is further configured to receive a page turning mode changing operation input by a user after the display page is displayed on the user interface of the native reader in an overlapping manner, where the page turning mode changing operation is used to change a page turning mode of the native reader to a target mode; and responding to the page turning mode changing operation, changing the page turning mode of the native reader into the target mode, and changing the layout mode of the elements in the display page into the layout mode matched with the target mode.
As an optional implementation manner of the embodiment of the present invention, the loading unit is further configured to generate a web page view for displaying the target web page before the second source file is loaded in the preset web page view, where a size and a shape of the web page view are the same as a size and a shape of a user interface of the native reader; and setting the transparency of the background of the webpage view as a preset transparency, and acquiring the preset webpage view.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory for storing a computer program and a processor; the processor is configured to, when the computer program is invoked, cause the electronic device to implement the content presentation method according to the first aspect or any one of the optional implementation manners of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computing device, the computing device is enabled to implement the content presentation method according to the first aspect or any one of the optional implementation manners of the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program product, which when run on a computer, causes the computer to implement the content presentation method according to the first aspect or any one of the optional implementation manners of the first aspect.
The content display method provided by the embodiment of the invention comprises the steps of firstly obtaining a source file of a target webpage comprising target content to be displayed in a native reader, then setting a target parameter in the first source file, which controls the background transparency of the target webpage, as a preset value to generate a second source file, then loading the second source file in a preset webpage view with the background transparency as the preset transparency to generate a display page of the target content, and finally overlapping and displaying the display page on a user interface of the native reader. Firstly, because the parameter for controlling the background transparency of the target webpage in the second source file is a preset value, and the transparency of the background of the preset webpage view loaded with the second source file is a preset transparency, when the display page of the target content is superposed and displayed on the user interface of the native reader, not only can the elements in the display page of the target content be seen, but also the user interface of the native reader can be seen through the non-element area, so that the target content required to be displayed in the native reader can be displayed in the native reader. Secondly, when the content display method provided by the embodiment of the invention generates the display page of the target content, the elements of the multimedia content do not need to be pre-configured into the installation package of the native reader in advance, so that when the content to be displayed needs to be replaced, only the source file sent to the terminal equipment needs to be modified or replaced, and the content display method is realized without releasing a new version of the native reader. In summary, the embodiment of the invention can solve the problem that the multimedia content to be displayed can only be replaced by releasing a new version when the multimedia content is displayed in the native reader.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a scene architecture diagram of a content display method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a content display method according to an embodiment of the present invention;
fig. 3 is one of scene interface diagrams of a content presentation method according to an embodiment of the present invention;
fig. 4 is a second view of a scene interface of the content display method according to the embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention may be more clearly understood, a solution of the present invention will be further described below. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways than those described herein; it is to be understood that the embodiments described in this specification are only some embodiments of the invention, and not all embodiments.
The terms "first" and "second," and the like, in the description and in the claims of the present invention are used for distinguishing between synchronized objects, and are not used to describe a particular order of objects. For example, the first correspondence and the second correspondence are for distinguishing different correspondences, not for describing a specific order of the correspondences.
In the embodiments of the present invention, words such as "exemplary" or "for example" are used to mean serving as examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion. Further, in the description of the embodiments of the present invention, "a plurality" means two or more unless otherwise specified.
The execution main body of the content display method provided by the embodiment of the invention can be terminal equipment. The terminal device may be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), an intelligent watch, an intelligent bracelet, or other types of terminal devices, and the embodiment of the present invention does not limit the type of the terminal device.
First, a scene architecture of the content presentation method provided by the embodiment of the present invention is described below. Referring to fig. 1, a scene architecture of a content presentation method provided in an embodiment of the present invention includes: a terminal device 11 and a server 12.
The terminal device 11 has a native reader 110 installed therein, which is based on a local operating system of the terminal device and is written and operated using a native program. The server 12 may return the corresponding network resource to the terminal device 11 according to the request information sent by the terminal device 11. When the target content needs to be displayed in the Native reader 110 of the terminal device 11, the terminal device 11 first obtains a first source file of a target web page including the target content from the server 12, then sets a parameter in the first source file, which controls a background transparency of the target web page, as a preset value to generate a second source file, loads the second source file in a preset web page view (webview) with a background of the preset transparency to obtain a display page of the target content, and finally displays the display page of the target content in an overlapping manner on a user interface of the Native reader 110 to display the target content in the Native reader 110 of the terminal device 11 in a manner of realizing mixed layout based on the web page and Native.
Based on the above, an embodiment of the present invention provides a content display method, which, as shown in fig. 1, includes the following steps S101 to S104:
s101, obtaining a first source file.
The first source file is a source file of a target webpage, and the target webpage comprises target content needing to be displayed in a native reader.
The targeted content in embodiments of the present invention may include one or more of images, video files, animation files, audio files, virtual controls, tables, and the like.
Specifically, the source file of the web page can link elements such as texts, images, animation files, audio files, video files, tables and the like stored in different storage positions together to generate the web page, so that the target web page including the target content required to be displayed in the native reader can be generated by acquiring the first source file. Optionally, in this embodiment of the present invention, the source file of the target web page may include a hypertext markup language (HTML) file of the target web page.
Optionally, the implementation manner of the step S101 (obtaining the first source file) may include the following steps a and b:
step a, sending request information to a server.
The request information carries a Uniform Resource Locator (URL) of the target web page, and is used to request a source file of the target web page.
And step b, receiving a Hyper Text Markup Language (HTML) file of the target webpage sent by the server.
Optionally, the manner of triggering to acquire the first source file may be: specific operation of a user on a native reader installed in a terminal device is received.
Further, the specific operation may be an operation input by the user to trigger the native reader to display a preset user interface, or an operation of the user on a designated virtual control of the native reader. For example: the target content is related content of a pay-per-view service, and the triggering operation for acquiring the first source file may be: the user input is used for controlling the operation of the original reader to display chapters needing to be read for payment.
S102, setting target parameters in the first source file to preset values, and generating a second source file.
And the target parameter is a parameter for controlling the background transparency of the target webpage.
Specifically, a Cascading Style Sheets (CSS) in the source file is a computer language used for representing a Style of the source file, and attributes such as background transparency, element position, element color, element layout and the like in the target webpage can be controlled through the CSS, so that in the embodiment of the present invention, a parameter value of a parameter used for controlling the background transparency of the webpage in the CSS is set to a preset value, so that the background transparency of the target webpage is set to a required transparency.
For example, the preset value may be a value for controlling the background transparency of the target web page to be 100%.
S103, loading the second source file in a preset webpage view, and generating a display page of the target content.
And the transparency of the background of the preset webpage view is preset transparency.
For example, the preset transparency may be 100%.
The web view (webview) in the embodiment of the present invention is a control for displaying a web page, and when the second source file is loaded in the preset web view, the web page corresponding to the second source file (including the web page that needs to be displayed in the native reader and has a parameter for controlling background transparency set to a preset value) can be displayed through the preset web view.
Further, since the step S103 needs to load the second source file in the web page view with the background transparency being the preset transparency, before the step S103 (loading the second source file in the preset web page view, generating the display page of the target content), the method provided by the present disclosure further includes:
generating a webpage view for displaying the target webpage, wherein the size and the shape of the webpage view are the same as those of a user interface of the native reader;
and taking the transparency of the background of the webpage view as the preset transparency, and acquiring the preset webpage view.
Since the size and shape of the webpage view for displaying the target webpage are set to be the same as those of the user interface of the native viewer in the above embodiment, the above embodiment can prevent the display page of the target content from displaying the target content outside the user interface of the native viewer.
And S104, overlapping and displaying the display page on a user interface of a native reader.
Namely, the display page of the target content is displayed on the top layer of the screen of the terminal equipment, and the user interface of the native reader is displayed on the negative layer of the screen of the terminal equipment.
Illustratively, referring to fig. 3, the above embodiment is described by taking the user interface of the native reader as the user interface 31 and the presentation page of the target content as the operation activity interface 32 for reading at a fee. As shown in fig. 3, after the presentation page 32 of the target content is displayed in an overlaid manner on the user interface 31 of the native reader, the presentation page 32 of the target content is located at the top layer of the terminal device screen, the user interface 31 of the native reader is located at the negative layer of the terminal device screen, and since the parameter for controlling the background transparency of the web page in the second source file of the presentation page 32 of the target content is a preset value and the transparency of the background of the web page view is preset transparency, the transparency of the background of the presentation page 32 of the target content is relatively large, and the user interface 31 of the native reader can be seen through the presentation page 32 of the target content, thereby achieving the effect of presenting the multimedia content in the native reader shown by 33 in fig. 3.
The content display method provided by the embodiment of the invention comprises the steps of firstly obtaining a source file of a target webpage comprising target content to be displayed in a native reader, then setting a target parameter in the first source file, which controls the background transparency of the target webpage, as a preset value to generate a second source file, then loading the second source file in a preset webpage view with the background transparency as the preset transparency to generate a display page of the target content, and finally overlapping and displaying the display page on a user interface of the native reader. Firstly, because the parameter for controlling the background transparency of the target webpage in the second source file is a preset value, and the transparency of the background of the preset webpage view loaded with the second source file is a preset transparency, when the display page of the target content is superposed and displayed on the user interface of the native reader, not only can the elements in the display page of the target content be seen, but also the user interface of the native reader can be seen through the non-element area, so that the target content required to be displayed in the native reader can be displayed in the native reader. Secondly, when the content display method provided by the embodiment of the invention generates the display page of the target content, the elements of the multimedia content do not need to be pre-configured into the installation package of the native reader in advance, so that when the content to be displayed needs to be replaced, only the source file sent to the terminal equipment needs to be modified or replaced, and the content display method is realized without releasing a new version of the native reader. In summary, the embodiment of the invention can solve the problem that the multimedia content to be displayed can only be replaced by releasing a new version when the multimedia content is displayed in the native reader.
It should be further noted that displaying the multimedia content in the Native reader based on the Native mode not only brings the problem that the multimedia content to be displayed can only be replaced by releasing a new version, but also makes the service logic of the Native reader very complex, thereby increasing the development time of the Native reader.
As an optional implementation manner in the embodiment of the present invention, the content display method provided in the embodiment of the present invention further includes:
and before the first source file is acquired, overlapping and displaying a preset image on a user interface of the native reader.
Because the preset image is displayed on the user interface of the native reader in an overlapping manner before the first source file is acquired, the user interface of the native reader can be shielded by the preset image in the process of generating the display page of the target content, so that the user is prevented from seeing the user interface of the native reader first, and then the display page of the target content is displayed on the user interface of the native reader in an overlapping manner, and the use experience of the user is improved.
Illustratively, referring to fig. 4, the preset image 41 is shown in fig. 4 with a text prompt "… … in loading" as an example. As shown in fig. 4, when the target content displayed in the native reader is required, a preset image 41 is first displayed in a superimposed manner on the user interface displayed in the native reader to block the user interface of the native reader.
Further, the step S104 (displaying the display page on the user interface of the native reader in an overlapping manner) includes:
and replacing the preset image through the display page.
Namely, the preset image is deleted from the user interface of the native reader, and the display page of the target content is displayed on the user interface of the native reader in an overlapped mode.
According to the embodiment, the preset image is replaced by the display page after the display page of the target content is generated, so that the display page of the target content and the user interface of the Native reader can be displayed to a user at the same time, and the same display effect as that of displaying the target content in the Native reader based on a Native mode is achieved.
Further, the content display method provided by the embodiment of the present invention may further set the color of the element in the display page of the target content to a color matched with the background color of the user interface of the native reader, and the specific implementation manners include the following two types:
the first implementation of setting the color of the element in the presentation page of the target content to a color matching the background color of the user interface of the native reader includes the following steps a11 and a 12:
step a11, sending request information to the server.
The request information carries a uniform resource locator of the target webpage and a background color of a user interface of the native reader, and the request information is used for requesting the server to return a source file of the target webpage corresponding to the background color.
Optionally, the implementation manner of the request information carrying the background color of the user interface of the native reader may be: and splicing the background color of the user interface of the native reader on the uniform resource locator of the target webpage. For example: the uniform resource locator of the target webpage is as follows: "https:// www.xxx.com/", the color of the background of the user interface of the native reader is red, then the color "red" of the background of the user interface of the native reader may be stitched to the uniform resource locator of the target web page "https:// www.xxx.com/", thereby forming the uniform resource locator of the target web page corresponding to the color of the background of the user interface of the native reader: "https:// www.xxx.com/color ═ red".
Step a12, receiving the hypertext markup language file of the target webpage corresponding to the background color sent by the server.
For example, the server may pre-store the html file of the target web page corresponding to each background color and the corresponding relationship between the background color and the html file of the target web page, when receiving the request information sent by the terminal device, analyze the background color of the user interface of the native reader, determine the html file corresponding to the background color of the user interface of the native reader, and finally send the html file corresponding to the background color of the user interface of the native reader to the terminal device.
Before the display page of the target content is generated, the background color of the user interface of the original reader is sent to the server, so that the hypertext markup language file sent by the server is the hypertext markup language file of the target webpage corresponding to the background color of the user interface of the original reader.
In the above embodiment, the request information of the terminal device carries the background color of the user interface of the native reader, and the received hypertext markup language file of the target webpage is the hypertext markup language file of the target webpage corresponding to the background color of the user interface of the native reader, so the color of the element in the display page of the target content can be matched with the color of the background of the user interface of the native reader in the above embodiment.
The second implementation manner of setting the color of the element in the presentation page of the target content to a color matching the background color of the user interface of the native reader includes the following steps a21 and a 22:
and step a21, receiving the background color change operation input by the user.
Wherein. The background color changing operation is used for changing the background color of the user interface of the native reader to a target color.
For example, the background color changing operation may specifically include: clicking a control used for setting the background color of the user interface in the native reader and selecting a target color.
Step a22, responding to the background color changing operation, changing the background color of the user interface of the native reader to the target color, and changing the color of at least one element in the display page to a color matching with the target color.
That is, after the display page of the target content is generated and displayed on the user interface of the native reader in an overlapping manner, if the user changes the color of the background of the user interface of the native reader, the user does not request the source file of the target web page from the server again, but modifies the color of the element in the display page according to the changed background color of the user interface, so that the color of the element in the display page is matched with the color of the background of the user interface of the native reader.
Further, the content display method provided by the embodiment of the present invention may further set a layout manner of elements in the display page of the target content to a layout manner matched with the page turning pattern of the native reader, and specific implementation manners include the following two types:
the first implementation manner of setting the layout manner of the elements in the presentation page of the target content to the layout manner matched with the page turning pattern of the native reader includes the following steps b11 and b 12:
and step b11, sending the request information to the server.
The request information carries a uniform resource locator of the target webpage and a page turning mode of a native reader, and the request information is used for requesting the server to return a source file of the target webpage corresponding to the page turning mode.
Similarly, the implementation manner of the page turning mode of the native reader carried by the request information may be: and splicing the page turning mode of the original reader on the uniform resource locator of the target webpage.
Step b12, receiving the hypertext markup language file of the target webpage corresponding to the page turning mode sent by the server.
Before the display page of the target content is generated, sending the page turning mode of the original reader to the server, so that the hypertext markup language file sent by the server is the hypertext markup language file of the target webpage corresponding to the page turning mode of the original reader.
In the above embodiment, the terminal device carries the page turning mode of the native reader in the request information, and the received hypertext markup language file of the target webpage is the hypertext markup language file of the target webpage corresponding to the page turning mode of the native reader, so that the above embodiment can match the layout mode of the elements in the display page of the target content with the page turning mode of the native reader.
The second implementation manner of setting the layout manner of the elements in the presentation page of the target content to the layout manner matched with the page turning pattern of the native reader includes the following steps b21 and b 22:
and b21, receiving the page turning mode change operation input by the user.
And the page turning mode changing operation is used for changing the page turning mode of the native reader into a target mode.
For example, the page-turning mode changing operation may specifically include: clicking a control used for setting a page turning mode in the native reader and selecting a target mode.
Step b22, responding to the page turning mode changing operation, changing the page turning mode of the native reader to the target mode, and changing the layout mode of the elements in the display page to the layout mode matched with the target mode.
That is, after the display page of the target content is generated and displayed on the user interface of the native reader in an overlapping manner, if the user changes the page turning mode of the native reader, the user does not request the source file of the target web page from the server again, but modifies the layout mode of the elements in the display page according to the changed page turning mode, so that the layout mode of the elements in the display page is matched with the page turning mode of the native reader.
Based on the same inventive concept, as an implementation of the foregoing method, an embodiment of the present invention further provides a terminal device, where the terminal device embodiment corresponds to the foregoing method embodiment, and for convenience of reading, details in the foregoing method embodiment are not repeated in this apparatus embodiment one by one, but it should be clear that the terminal device in this embodiment can correspondingly implement all steps of the foregoing method embodiment.
Fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present invention, and as shown in fig. 5, a terminal device 500 according to this embodiment includes:
an obtaining unit 51, configured to obtain a first source file, where the first source file is a source file of a target web page, and the target web page includes target content that needs to be displayed in a native reader;
a setting unit 52, configured to set a target parameter in the first source file to a preset value, and generate a second source file; the target parameter is a parameter for controlling the background transparency of the target webpage;
a loading unit 53, configured to load the second source file in a preset web view, and generate a display page of the target content, where a transparency of a background of the preset web view is a preset transparency;
and the display unit 54 is used for displaying the display page on the user interface of the native reader in an overlapping manner.
As an optional implementation manner of the embodiment of the present invention, the display unit 54 is further configured to, before the first source file is acquired, display a preset image on a user interface of the native reader in an overlapping manner, and replace the preset image with the display page.
As an optional implementation manner of the embodiment of the present invention, the obtaining unit 51 is specifically configured to send request information to a server, where the request information carries a uniform resource locator of the target web page and a background color of a user interface of the native reader, and the request information is used to request the server to return a source file of the target web page corresponding to the background color; and receiving a hypertext markup language file of the target webpage corresponding to the background color sent by the server.
As an optional implementation manner of the embodiment of the present invention, the obtaining unit 51 is specifically configured to send request information to a server, where the request information carries a uniform resource locator of the target web page and a page-turning mode of a native reader, and the request information is used to request the server to return a source file of the target web page corresponding to the page-turning mode; and receiving a hypertext markup language file of the target webpage corresponding to the page turning mode, which is sent by the server.
As an optional implementation manner of the embodiment of the present invention, the display unit 54 is further configured to receive a background color changing operation input by a user after the display page is displayed in an overlaid manner on the user interface of the native reader, where the background color changing operation is used to change the background color of the user interface of the native reader to a target color; and responding to the background color changing operation, changing the background color of the user interface of the native reader into the target color, and changing the color of at least one element in the display page into a color matched with the target color.
As an optional implementation manner of the embodiment of the present invention, the display unit 54 is further configured to receive a page turning mode changing operation input by a user after the display page is displayed on the user interface of the native reader in an overlapped manner, where the page turning mode changing operation is used to change the page turning mode of the native reader to a target mode; and responding to the page turning mode changing operation, changing the page turning mode of the native reader into the target mode, and changing the layout mode of the elements in the display page into the layout mode matched with the target mode.
As an optional implementation manner of the embodiment of the present invention, the loading unit 53 is further configured to generate a web page view for displaying the target web page before the second source file is loaded in the preset web page view, where a size and a shape of the web page view are the same as a size and a shape of a user interface of the native reader; and setting the transparency of the background of the webpage view as a preset transparency, and acquiring the preset webpage view.
The terminal device provided in this embodiment may execute the content display method provided in the foregoing method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Based on the same inventive concept, the embodiment of the invention also provides electronic equipment. Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 6, the electronic device according to the embodiment includes: a memory 61 and a processor 62, the memory 61 being for storing computer programs; the processor 62 is configured to cause the electronic device to execute the content presentation method provided by the above method embodiment when the computer program is called.
In particular, the memory 61 may be used to store software programs as well as various data. The memory 61 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 61 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 62 is a control center of the electronic device, connects various parts of the entire electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 61 and calling data stored in the memory 61, thereby performing overall monitoring of the electronic device. Processor 62 may include one or more processing units.
In addition, it should be understood that the electronic device provided by the embodiment of the present invention may further include: the device comprises a radio frequency unit, a network module, an audio output unit, a receiving unit, a sensor, a display unit, a user receiving unit, an interface unit, a power supply and the like. It will be appreciated by those skilled in the art that the above-described configuration of the electronic device does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The radio frequency unit may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink data from the base station and then process the received downlink data to the processor 62; in addition, the uplink data is transmitted to the base station. Typically, the radio frequency units include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access for the user through the network module, such as helping the user send and receive e-mails, browse webpages, access streaming media and the like.
The audio output unit may convert audio data received by the radio frequency unit or the network module or stored in the memory 61 into an audio signal and output as sound. Also, the audio output unit may also provide audio output related to a specific function performed by the electronic device (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit comprises a loudspeaker, a buzzer, a receiver and the like.
The receiving unit is used for receiving audio or video signals. The receiving Unit may include a Graphics Processing Unit (GPU) that processes image data of still pictures or video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode, and a microphone. The processed video frame may be displayed on a display unit. The video frames processed by the graphic processor may be stored in a memory (or other storage medium) or transmitted via a radio frequency unit or a network module. The microphone may receive sound and be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit in case of the phone call mode.
The electronic device also includes at least one sensor, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that turns off the display panel and/or the backlight when the electronic device is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer and tapping); the sensors may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., and will not be described herein.
The display unit is used for displaying information input by a user or information provided to the user. The Display unit may include a Display panel, and the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user receiving unit may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user receiving unit includes a touch panel and other input devices. A touch panel, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel (e.g., operations by a user on or near the touch panel using a finger, a stylus, or any other suitable object or attachment). The touch panel may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 62, and receives and executes commands sent from the processor 62. In addition, the touch panel may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel, the user receiving unit may include other input devices. Specifically, the other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel may be overlaid on the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel may transmit the touch operation to the processor 62 to determine the type of the touch event, and then the processor 62 may provide a corresponding visual output on the display panel according to the type of the touch event. Generally, the touch panel and the display panel are two independent components to implement the input and output functions of the electronic device, but in some embodiments, the touch panel and the display panel may be integrated to implement the input and output functions of the electronic device, and the implementation is not limited herein.
The interface unit is an interface for connecting an external device and the electronic equipment. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements in the electronic equipment or may be used to transmit data between the electronic equipment and the external device.
The electronic device may also include a power source (e.g., a battery) for powering the components, and optionally, the power source may be logically connected to the processor 62 via a power management system, such that functions of managing charging, discharging, and power consumption are performed via the power management system.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computing device, the computing device is enabled to perform the content presentation method provided in the foregoing method embodiment.
The embodiment of the present invention further provides a computer program product, when the computer program product runs on a computer, the computer is enabled to implement the content display method provided by the method embodiment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied in the medium.
Computer readable media include both permanent and non-permanent, removable and non-removable storage media. Storage media may implement information storage by any method or technology, and the information may be computer-readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transmyedia) such as modulated data signals and carrier waves.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (11)

1. A method for content presentation, comprising:
acquiring a first source file, wherein the first source file is a source file of a target webpage, and the target webpage comprises target content needing to be displayed in a native reader;
setting target parameters in the first source file to preset values, and generating a second source file; the target parameter is a parameter for controlling the background transparency of the target webpage;
loading the second source file in a preset webpage view to generate a display page of the target content, wherein the transparency of the background of the preset webpage view is a preset transparency;
and displaying the display page on a user interface of a native reader in an overlapping manner.
2. The method of claim 1, further comprising:
before the first source file is obtained, a preset image is displayed on a user interface of the native reader in an overlapping mode;
the displaying page is displayed on a user interface of a native reader in an overlapping mode, and the displaying page comprises the following steps: and replacing the preset image through the display page.
3. The method of claim 1, wherein obtaining the first source file comprises:
sending request information to a server, wherein the request information carries a uniform resource locator of the target webpage and a background color of a user interface of the native reader, and the request information is used for requesting the server to return a source file of the target webpage corresponding to the background color;
and receiving a hypertext markup language file of the target webpage corresponding to the background color sent by the server.
4. The method of claim 1, wherein obtaining the first source file comprises:
sending request information to a server, wherein the request information carries a uniform resource locator of the target webpage and a page turning mode of a native reader, and the request information is used for requesting the server to return a source file of the target webpage corresponding to the page turning mode;
and receiving a hypertext markup language file of the target webpage corresponding to the page turning mode, which is sent by the server.
5. The method of claim 1, wherein after displaying the presentation page superimposed on a user interface of the native reader, the method further comprises:
receiving a background color changing operation input by a user, wherein the background color changing operation is used for changing the background color of a user interface of the native reader into a target color;
and responding to the background color changing operation, changing the background color of the user interface of the native reader into the target color, and changing the color of at least one element in the display page into a color matched with the target color.
6. The method of claim 1, wherein after displaying the presentation page superimposed on a user interface of the native reader, the method further comprises:
receiving a page turning mode change operation input by a user, wherein the page turning mode change operation is used for changing the page turning mode of the native reader into a target mode;
and responding to the page turning mode changing operation, changing the page turning mode of the native reader into the target mode, and changing the layout mode of the elements in the display page into the layout mode matched with the target mode.
7. The method of claim 1, wherein before loading the second source file in the preset web page view, the method further comprises:
generating a webpage view for displaying the target webpage, wherein the size and the shape of the webpage view are the same as those of a user interface of the native reader;
and taking the transparency of the background of the webpage view as a preset transparency, and acquiring the preset webpage view.
8. A terminal device, comprising:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring a first source file which is a source file of a target webpage, and the target webpage comprises target content needing to be displayed in a native reader;
the setting unit is used for setting the target parameters in the first source file to preset values and generating a second source file; the target parameter is a parameter for controlling the background transparency of the target webpage;
the loading unit is used for loading the second source file in a preset webpage view to generate a display page of the target content, and the transparency of the background of the preset webpage view is a preset transparency;
and the display unit is used for displaying the display page on a user interface of the native reader in an overlapping manner.
9. An electronic device, comprising: a memory for storing a computer program and a processor; the processor is configured to cause the electronic device to implement the content presentation method of any one of claims 1-7 when the computer program is invoked.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when executed by a computing device, causes the computing device to implement the content presentation method of any one of claims 1 to 7.
11. A computer program product, which, when run on a computer, causes the computer to carry out a content presentation method as claimed in any one of claims 1 to 7.
CN202110689807.0A 2021-06-22 2021-06-22 Content display method and terminal equipment Active CN113377475B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110689807.0A CN113377475B (en) 2021-06-22 2021-06-22 Content display method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110689807.0A CN113377475B (en) 2021-06-22 2021-06-22 Content display method and terminal equipment

Publications (2)

Publication Number Publication Date
CN113377475A true CN113377475A (en) 2021-09-10
CN113377475B CN113377475B (en) 2024-04-09

Family

ID=77578333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110689807.0A Active CN113377475B (en) 2021-06-22 2021-06-22 Content display method and terminal equipment

Country Status (1)

Country Link
CN (1) CN113377475B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740364A (en) * 2016-01-26 2016-07-06 腾讯科技(深圳)有限公司 Page processing method and related apparatus
CN105808248A (en) * 2016-03-03 2016-07-27 北京旷视科技有限公司 Method and device for generating interface of application
CN109063202A (en) * 2018-09-13 2018-12-21 北京三快在线科技有限公司 The method, apparatus and computer equipment of pop-up are realized in mixed interface application
CN110489116A (en) * 2018-05-15 2019-11-22 优酷网络技术(北京)有限公司 A kind of rendering method of the page, device and computer storage medium
CN110609965A (en) * 2018-05-28 2019-12-24 腾讯科技(深圳)有限公司 Page display method and device and storage medium
CN111966354A (en) * 2020-08-17 2020-11-20 Oppo(重庆)智能科技有限公司 Page display method and device and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740364A (en) * 2016-01-26 2016-07-06 腾讯科技(深圳)有限公司 Page processing method and related apparatus
CN105808248A (en) * 2016-03-03 2016-07-27 北京旷视科技有限公司 Method and device for generating interface of application
CN110489116A (en) * 2018-05-15 2019-11-22 优酷网络技术(北京)有限公司 A kind of rendering method of the page, device and computer storage medium
CN110609965A (en) * 2018-05-28 2019-12-24 腾讯科技(深圳)有限公司 Page display method and device and storage medium
CN109063202A (en) * 2018-09-13 2018-12-21 北京三快在线科技有限公司 The method, apparatus and computer equipment of pop-up are realized in mixed interface application
CN111966354A (en) * 2020-08-17 2020-11-20 Oppo(重庆)智能科技有限公司 Page display method and device and computer readable storage medium

Also Published As

Publication number Publication date
CN113377475B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
CN108073343B (en) display interface adjusting method and mobile terminal
CN109917995B (en) Object processing method and terminal equipment
US10768881B2 (en) Multi-screen interaction method and system in augmented reality scene
CN109614061B (en) Display method and terminal
CN107943390B (en) Character copying method and mobile terminal
CN111338530B (en) Control method of application program icon and electronic equipment
CN105975190B (en) Graphical interface processing method, device and system
CN108170723B (en) Webpage resource acquisition method, terminal equipment, server and system
CN109085968B (en) Screen capturing method and terminal equipment
CN109828705B (en) Icon display method and terminal equipment
CN109710349B (en) Screen capturing method and mobile terminal
CN110865758B (en) Display method and electronic equipment
CN110908554B (en) Long screenshot method and terminal device
CN110703972B (en) File control method and electronic equipment
CN110035181B (en) Method and terminal for setting theme of quick application card
CN111026464A (en) Identification method and electronic equipment
CN109358931B (en) Interface display method and terminal
WO2021083091A1 (en) Screenshot capturing method and terminal device
CN110795021B (en) Information display method and device and electronic equipment
CN110012152B (en) Interface display method and terminal equipment
CN109063079B (en) Webpage labeling method and electronic equipment
CN107479799B (en) Method and device for displaying window
CN110012151B (en) Information display method and terminal equipment
CN111274842A (en) Method for identifying coded image and electronic equipment
CN111090529A (en) Method for sharing information and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant