Interface implementation method, device, electronic device and storage medium
By rendering specified page resources and other interface resources, and utilizing built-in browser components and inter-process communication, it solves the problem of limited capabilities of the existing rendering engine, achieves more flexible and rich interface content generation, and improves rendering efficiency.
Patent Information
- Application Number
- CN201811368341.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-11-16
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2038-11-16
AI Technical Summary
Existing rendering engines have limited capabilities in rendering interface resources. The resource types are single and not flexible enough, making it difficult to achieve rich and colorful visual effects.
By rendering the specified page resources and interface resources except the specified page resources, the interface content is generated and output to the target interface. Combining the characteristics of different resource files, using built-in browser components such as Google Chrome Embedded Framework CEF Perform rendering and use inter-process communication to fuse rendering data.
It achieves more flexible and rich interface content generation, improves rendering efficiency, and can provide efficient visual effects in a variety of scenarios.
Smart Images

Figure CN111198731B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an interface implementation method, device, electronic equipment and storage medium. Background Art
[0002] In the prior art, the interface can be realized by rendering the interface resources by the rendering engine of the program. For example, the game can use the Direct3D engine to render the resource files to realize the colorful visual images. However, the rendering capabilities of various rendering engines are limited after all, and the types of resource files rendered are relatively single and not flexible enough. Summary of the invention
[0003] In view of the above problems, the present invention is proposed to provide an interface implementation method, device, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.
[0004] According to one aspect of the present invention, there is provided an interface implementation method, comprising:
[0005] Rendering a specified page resource to obtain first rendering data;
[0006] Rendering the interface resources except the designated page resources to obtain second rendering data;
[0007] Generate interface content according to the first rendering data and the second rendering data, and output the interface content to a target interface.
[0008] Optionally, the designated page resource is a local resource and / or a network resource obtained according to a URL.
[0009] Optionally, the specified page resource includes one or more of the following:
[0010] HTML resources, CSS resources, JS resources.
[0011] Optionally, rendering the specified page resource to obtain the first rendering data includes:
[0012] The page resource is rendered based on the built-in browser component to obtain first rendering data.
[0013] Optionally, the built-in browser component is implemented by Google Chrome Embedded Framework CEF.
[0014] Optionally, rendering the page resource based on the built-in browser component to obtain the first rendering data includes:
[0015] The page resource is rendered by a rendering engine of the built-in browser component, and first rendering data in a bitmap format is output by a rendering function of the rendering engine.
[0016] Optionally, outputting the interface content to a target interface includes:
[0017] Outputting the interface content corresponding to the first rendering data to a designated area on the target interface;
[0018] The method further includes:
[0019] When receiving an operation instruction on the target interface, it is determined whether the operation instruction falls into the designated area, and if so, the operation instruction is transparently transmitted to the built-in browser component.
[0020] Optionally, rendering the specified page resource to obtain the first rendering data includes:
[0021] Select the page resource to be rendered according to the preset resolution.
[0022] Optionally, rendering the specified page resource to obtain the first rendering data includes:
[0023] The portion of the specified page resource that is covered by the page element of the specified type is not refreshed.
[0024] Optionally, rendering the specified page resource to obtain the first rendering data includes:
[0025] Rendering the specified page resource to obtain an initial frame;
[0026] Calculate the change amount of each subsequent frame according to the initial frame;
[0027] The initial frame and the change amount are used as first rendering data.
[0028] Optionally, generating interface content according to the first rendering data and the second rendering data includes:
[0029] Acquire the second rendering data through the current process, and acquire the first rendering data according to inter-process communication;
[0030] The second rendering data and the first rendering data are merged to obtain interface content.
[0031] Optionally, the fusing the second rendering data and the first rendering data to obtain the interface content includes:
[0032] The frame rate of the interface content is determined according to the frame rate of the first rendering data and the frame rate of the second rendering data.
[0033] According to another aspect of the present invention, there is provided an interface implementation device, comprising:
[0034] A first rendering unit, adapted to render a specified page resource to obtain first rendering data;
[0035] A second rendering unit, adapted to render the interface resources other than the designated page resources to obtain second rendering data;
[0036] The interface unit is adapted to generate interface content according to the first rendering data and the second rendering data, and output the interface content to a target interface.
[0037] Optionally, the designated page resource is a local resource and / or a network resource obtained according to a URL.
[0038] Optionally, the specified page resource includes one or more of the following:
[0039] HTML resources, CSS resources, JS resources.
[0040] Optionally, the first rendering unit is adapted to render the page resource based on a built-in browser component to obtain first rendering data.
[0041] Optionally, the built-in browser component is implemented by Google Chrome Embedded Framework CEF.
[0042] Optionally, the first rendering unit is adapted to render the page resource through a rendering engine of the built-in browser component, and output first rendering data in a bitmap format through a rendering function of the rendering engine.
[0043] Optionally, the interface unit is adapted to output interface content corresponding to the first rendering data to a designated area on a target interface;
[0044] The device also includes: a transparent transmission unit, which is adapted to, upon receiving an operation instruction on a target interface, determine whether the operation instruction falls into the designated area, and if so, transparently transmit the operation instruction to the built-in browser component.
[0045] Optionally, the first rendering unit is adapted to select a page resource to be rendered according to a preset resolution.
[0046] Optionally, the first rendering unit is adapted to not refresh a portion of the specified page resource that is covered by a page element of a specified type.
[0047] Optionally, the first rendering unit is adapted to render the designated page resource to obtain an initial frame; calculate a change amount of subsequent frames according to the initial frame; and use the initial frame and the change amount as first rendering data.
[0048] Optionally, the interface unit is adapted to obtain the second rendering data through the current process, and obtain the first rendering data according to inter-process communication; and merge the second rendering data and the first rendering data to obtain interface content.
[0049] Optionally, the interface unit is adapted to determine a frame rate of the interface content according to a frame rate of the first rendering data and a frame rate of the second rendering data.
[0050] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the above methods.
[0051] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, the one or more programs implement any of the methods described above.
[0052] From the above, it can be seen that the technical solution of the present invention obtains first rendering data by rendering the specified page resources, and obtains second rendering data by rendering the interface resources other than the specified page resources, generates interface content according to the first rendering data and the second rendering data, and outputs the interface content to the target interface. This technical solution uses page resources as the implementation basis of the interface. The output interface content not only includes controls, windows, backgrounds, etc. obtained according to the interface resources, but also includes animations, login boxes, etc. obtained according to the page resources. It combines the characteristics of different resource files, so that the generated interface content is rich, and the implementation means are more flexible. It can utilize the characteristics of different rendering engines to achieve higher efficiency in many scenarios.
[0053] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0055] Figure 1 A schematic flow chart of an interface implementation method according to an embodiment of the present invention is shown;
[0056] Figure 2 A schematic diagram showing the structure of an interface implementation device according to an embodiment of the present invention is shown;
[0057] Figure 3 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown;
[0058] Figure 4 A schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0059] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0060] Figure 1 FIG. 2 is a flow chart showing a method for realizing an interface according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0061] Step S110, rendering the designated page resource to obtain first rendering data. The designated page resource here refers to the page resource of the web page. Specifically, in one embodiment of the present invention, in the above method, the designated page resource includes one or more of the following: HTML resource, CSS resource, JS resource.
[0062] That is, a normal web page can actually be realized according to the specified page resources. For example, a web page containing a login box, a web page containing an HTML5 animation, etc. However, in the embodiment of the present invention, the rendering data is not displayed through a normal browser window, but is integrated with the output of the interface. That is, the interface can contain other content, and other rendering engines are used to render according to the corresponding interface resources.
[0063] Step S120, rendering the interface resources except the designated page resources to obtain second rendering data.
[0064] This means that the interface resources are multiple resources including the specified page resources. It can be seen that step S110 and step S120 are independent of each other, for example, they can be implemented in a process respectively, so that even if one process crashes, it will not affect the other process and can be quickly restored. If static content is displayed, the user will hardly feel it; if dynamic content is displayed, the user will only feel that part of the interface content is static, but the entire interface will not crash.
[0065] Step S130: Generate interface content according to the first rendering data and the second rendering data, and output the interface content to the target interface.
[0066] In a specific implementation, the first rendering data and the second rendering data may be merged and output to a target interface. For example, in a login interface of a game client, some promotional information, advertising animations and login boxes may be implemented by page resource rendering, while other parts such as the background may be implemented by the game's own rendering engine.
[0067] visible, Figure 1 The method shown, by rendering the specified page resources to obtain the first rendering data, and rendering the interface resources other than the specified page resources to obtain the second rendering data, generates the interface content according to the first rendering data and the second rendering data, and outputs the interface content to the target interface. This technical solution uses page resources as the basis for the implementation of the interface. The output interface content not only includes controls, windows, backgrounds, etc. obtained according to the interface resources, but also includes animations, login boxes, etc. obtained according to the page resources. It combines the characteristics of different resource files, so that the generated interface content is rich, and the implementation means are more flexible. It can use the characteristics of different rendering engines to achieve higher efficiency in many scenarios.
[0068] In one embodiment of the present invention, in the above method, the designated page resource is a local resource and / or a network resource obtained according to a URL.
[0069] Both local resources and network resources have their own advantages and disadvantages, and can also be implemented in combination. For example, the promotional information of an event, due to its high variability, can be changed on the server side by changing the page resources. When users use the product, they can obtain network resources from the server. This method is similar to browsing the web page in normal times, and the web page content can be easily changed. For content that does not change often, it can be included in the installation package of the product program and rendered as local resources when it is used.
[0070] In one embodiment of the present invention, in the above method, rendering the specified page resource to obtain the first rendering data includes: rendering the page resource based on the built-in browser component to obtain the first rendering data. Specifically, in one embodiment of the present invention, in the above method, the built-in browser component is implemented by Google Chrome Embedded Framework CEF.
[0071] Chromium Embedded Framework (CEF) is an open source web browser control based on the Google Chromium project, supporting Windows, Linux, and Mac platforms. In a specific embodiment, CEF can be used to implement a built-in browser component in the client, and use its built-in rendering engine to render page resources, just like rendering a web page, but instead of rendering the content into the browser window, off-screen rendering is implemented.
[0072] In one embodiment of the present invention, in the above method, rendering the page resources based on the built-in browser component to obtain the first rendering data includes: rendering the page resources through the rendering engine of the built-in browser component, and outputting the first rendering data in a bitmap format through the rendering function of the rendering engine.
[0073] In a specific embodiment, a rendered bitmap is obtained by hooking the rendering function of the rendering engine to obtain a picture in the memory. For example, the browser rendering process is responsible for rendering, and the process responsible for interface content output obtains the picture, and the specific data transmission is implemented by using inter-process communication.
[0074] In one embodiment of the present invention, in the above method, outputting the interface content to the target interface includes: outputting the interface content corresponding to the first rendering data to a designated area on the target interface; the method also includes: when receiving an operation instruction on the target interface, determining whether the operation instruction falls into the designated area, and if so, passing the operation instruction to the built-in browser component.
[0075] Just as the pages in the browser can be interacted with through various operations such as clicking and input, the interface rendered using page resources also has this function. However, it should be noted that since the page is not presented in the browser window, it is not the browser process that is actually responsible for output and interaction. Therefore, the user's operations on this part of the content need to be transmitted to the built-in browser component, that is, transparent transmission.
[0076] In a specific example, page resource rendering is used to implement multiple fan-shaped pages in the interface, and each page can be clicked to be selected for highlighting. When a user click request for a page is received, the focus and click events are transmitted so that the built-in browser component performs corresponding operations to achieve page switching.
[0077] Since in the embodiments of the present invention, the rendering operation is implemented in two parts, and the specific data transmission can be implemented by using inter-process communication, it is necessary to optimize the efficiency. Several embodiments are shown below as examples of optimization from different angles.
[0078] In one embodiment of the present invention, in the above method, rendering the designated page resource to obtain the first rendering data includes: selecting the page resource to be rendered according to a preset resolution.
[0079] For example, if you need to obtain 800*600 content, and the specified page resource corresponds to 1280*720, you need to perform corresponding interception to reduce the amount of transmitted data.
[0080] In one embodiment of the present invention, in the above method, rendering the specified page resource to obtain the first rendering data includes: not refreshing the portion of the specified page resource that is covered by the page element of the specified type.
[0081] For example, the login box and background animation are both implemented by rendering page resources, and the login box can include a drop-down box design. When the drop-down box is displayed, the background animation is actually blocked. At this time, this part of the background animation does not need to be refreshed (because it is blocked and cannot be displayed, rendering will only waste resources), further improving efficiency.
[0082] In one embodiment of the present invention, in the above method, rendering the specified page resource to obtain the first rendering data includes: rendering the specified page resource to obtain an initial frame; calculating the change amount of subsequent frames based on the initial frame; and using the initial frame and the change amount as the first rendering data.
[0083] For example, for a 60-frame animation, the first frame is rendered and transmitted normally, and the remaining frames are calculated once for the changes. In this case, what is actually transmitted is the initial frame and the changes, which is much more efficient than transmitting each frame.
[0084] In one embodiment of the present invention, in the above method, generating interface content based on the first rendering data and the second rendering data includes: obtaining the second rendering data through the current process, and obtaining the first rendering data based on inter-process communication; and fusing the second rendering data and the first rendering data to obtain the interface content.
[0085] As described above, the first rendering data is obtained through inter-process communication, and different processes are used to render respectively, and then the merged rendering data is output. This takes advantage of different rendering engines, especially the ability of the browser rendering engine to render resources such as html, js, and css, so that the client program is rich in content, diversified, better in effect, and has a higher user experience.
[0086] In one embodiment of the present invention, in the above method, fusing the second rendering data with the first rendering data to obtain the interface content includes: determining a frame rate of the interface content according to a frame rate of the first rendering data and a frame rate of the second rendering data.
[0087] In a specific embodiment, the frame rate is adjusted mainly to make the interface content rendered by different engines more adaptable and smoother during display. Otherwise, one part of the interface moves faster and the other part moves slower, making the user feel uncomfortable.
[0088] Figure 2 FIG. 2 shows a schematic diagram of the structure of an interface implementation device according to an embodiment of the present invention. Figure 2 As shown, the interface implementation device 200 includes:
[0089] The first rendering unit 210 is adapted to render a specified page resource to obtain first rendering data.
[0090] The designated page resources here refer to page resources of a web page. Specifically, in one embodiment of the present invention, in the above-mentioned device, the designated page resources include one or more of the following: HTML resources, CSS resources, and JS resources.
[0091] That is, a normal web page can actually be realized according to the specified page resources. For example, a web page containing a login box, a web page containing an HTML5 animation, etc. However, in the embodiment of the present invention, the rendering data is not displayed through a normal browser window, but is integrated with the output of the interface. That is, the interface can contain other content, and other rendering engines are used to render according to the corresponding interface resources.
[0092] The second rendering unit 220 is adapted to render the interface resources except the designated page resources to obtain second rendering data.
[0093] This means that the interface resources are multiple resources including the specified page resources. The functions of the first rendering unit 210 and the second rendering unit 220 can be implemented in one process respectively, so that even if one process crashes, it will not affect the other process and can be quickly restored. If static content is displayed, the user will hardly feel it; if dynamic content is displayed, the user will only feel that part of the interface content is static, but the entire interface will not crash.
[0094] The interface unit 230 is adapted to generate interface content according to the first rendering data and the second rendering data, and output the interface content to a target interface.
[0095] In a specific implementation, the first rendering data and the second rendering data may be merged and output to a target interface. For example, in a login interface of a game client, some promotional information, advertising animations and login boxes may be implemented by page resource rendering, while other parts such as the background may be implemented by the game's own rendering engine.
[0096] visible, Figure 2The device shown renders the specified page resources to obtain the first rendering data, and renders the interface resources other than the specified page resources to obtain the second rendering data, generates the interface content according to the first rendering data and the second rendering data, and outputs the interface content to the target interface. This technical solution uses page resources as the basis for implementing the interface. The output interface content includes not only the controls, windows, backgrounds, etc. obtained according to the interface resources, but also animations, login boxes, etc. obtained according to the page resources. It combines the characteristics of different resource files, so that the generated interface content is rich, and the implementation means are more flexible. It can utilize the characteristics of different rendering engines to achieve higher efficiency in many scenarios.
[0097] In one embodiment of the present invention, in the above device, the designated page resource is a local resource and / or a network resource obtained according to a URL.
[0098] Both local resources and network resources have their own advantages and disadvantages, and can also be implemented in combination. For example, the promotional information of an event, due to its high variability, can be changed on the server side by changing the page resources. When users use the product, they can obtain network resources from the server. This method is similar to browsing the web page in normal times, and the web page content can be easily changed. For content that does not change often, it can be included in the installation package of the product program and rendered as local resources when it is used.
[0099] In one embodiment of the present invention, in the above device, the first rendering unit is adapted to render the page resource based on the built-in browser component to obtain the first rendering data. Specifically, in one embodiment of the present invention, in the above device, the built-in browser component is implemented by Google Chrome Embedded Framework CEF.
[0100] Chromium Embedded Framework (CEF) is an open source web browser control based on the Google Chromium project, supporting Windows, Linux, and Mac platforms. In a specific embodiment, CEF can be used to implement a built-in browser component in the client, and use its built-in rendering engine to render page resources, just like rendering a web page, but instead of rendering the content into the browser window, off-screen rendering is implemented.
[0101] In one embodiment of the present invention, in the above-mentioned device, the first rendering unit is adapted to render the page resource through a rendering engine of a built-in browser component, and output first rendering data in a bitmap format through a rendering function of the rendering engine.
[0102] In a specific embodiment, a rendered bitmap is obtained by hooking the rendering function of the rendering engine to obtain a picture in the memory. For example, the browser rendering process is responsible for rendering, and the process responsible for interface content output obtains the picture, and the specific data transmission is implemented by using inter-process communication.
[0103] In one embodiment of the present invention, in the above-mentioned device, the interface unit is suitable for outputting the interface content corresponding to the first rendering data to a designated area on the target interface; the device also includes: a transparent transmission unit, which is suitable for, when receiving an operation instruction on the target interface, determining whether the operation instruction falls into the designated area, and if so, transparently transmitting the operation instruction to the built-in browser component.
[0104] Just as the pages in the browser can be interacted with through various operations such as clicking and input, the interface rendered using page resources also has this function. However, it should be noted that since the page is not presented in the browser window, it is not the browser process that is actually responsible for output and interaction. Therefore, the user's operations on this part of the content need to be transmitted to the built-in browser component, that is, transparent transmission.
[0105] In a specific example, page resource rendering is used to implement multiple fan-shaped pages in the interface, and each page can be clicked to be selected for highlighting. When a user click request for a page is received, the focus and click events are transmitted so that the built-in browser component performs corresponding operations to achieve page switching.
[0106] Since in the embodiments of the present invention, the rendering operation is implemented in two parts, and the specific data transmission can be implemented by using inter-process communication, it is necessary to optimize the efficiency. Several embodiments are shown below as examples of optimization from different angles.
[0107] In one embodiment of the present invention, in the above-mentioned device, the first rendering unit is adapted to select a page resource to be rendered according to a preset resolution.
[0108] For example, if you need to obtain 800*600 content, and the specified page resource corresponds to 1280*720, you need to perform corresponding interception to reduce the amount of transmitted data.
[0109] In one embodiment of the present invention, in the above-mentioned device, the first rendering unit is adapted to not refresh the portion of the specified page resource that is covered by the page element of the specified type.
[0110] For example, the login box and background animation are both implemented by rendering page resources, and the login box can include a drop-down box design. When the drop-down box is displayed, the background animation is actually blocked. At this time, this part of the background animation does not need to be refreshed (because it is blocked and cannot be displayed, rendering will only waste resources), further improving efficiency.
[0111] In one embodiment of the present invention, in the above device, the first rendering unit is adapted to render the designated page resource to obtain an initial frame; calculate the change amount of subsequent frames according to the initial frame; and use the initial frame and the change amount as the first rendering data.
[0112] For example, for a 60-frame animation, the first frame is rendered and transmitted normally, and the remaining frames are calculated once for the changes. In this case, what is actually transmitted is the initial frame and the changes, which is much more efficient than transmitting each frame.
[0113] In one embodiment of the present invention, in the above-mentioned device, the interface unit is adapted to obtain the second rendering data through the current process, and obtain the first rendering data according to the inter-process communication; and merge the second rendering data and the first rendering data to obtain the interface content.
[0114] As described above, the first rendering data is obtained through inter-process communication, and different processes are used to render respectively, and then the merged rendering data is output. This takes advantage of different rendering engines, especially the ability of the browser rendering engine to render resources such as html, js, and css, so that the client program is rich in content, diversified, better in effect, and has a higher user experience.
[0115] In one embodiment of the present invention, in the above-mentioned device, the interface unit is adapted to determine the frame rate of the interface content according to the frame rate of the first rendering data and the frame rate of the second rendering data.
[0116] In a specific embodiment, the frame rate is adjusted mainly to make the interface content rendered by different engines more adaptable and smoother during display. Otherwise, one part of the interface moves faster and the other part moves slower, making the user feel uncomfortable.
[0117] In summary, the technical solution of the present invention obtains first rendering data by rendering the specified page resources, and obtains second rendering data by rendering the interface resources other than the specified page resources, generates interface content according to the first rendering data and the second rendering data, and outputs the interface content to the target interface. This technical solution uses page resources as the implementation basis of the interface. The output interface content not only includes controls, windows, backgrounds, etc. obtained according to the interface resources, but also includes animations, login boxes, etc. obtained according to the page resources. It combines the characteristics of different resource files, so that the generated interface content is rich, and the implementation means are more flexible. It can utilize the characteristics of different rendering engines to achieve higher efficiency in many scenarios.
[0118] It should be noted that:
[0119] The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. Various general-purpose devices can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of device. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific language is for the purpose of disclosing the best mode of the present invention.
[0120] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0121] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0122] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0123] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0124] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the interface implementation device according to an embodiment of the present invention. The present invention may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0125] For example, Figure 3A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown. The electronic device includes a processor 310 and a memory 320 arranged to store computer executable instructions (computer readable program code). The memory 320 can 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 320 has a storage space 330 for storing a computer readable program code 331 for executing any method step in the above method. For example, the storage space 330 for storing computer readable program code may include various computer readable program codes 331 respectively used to implement various steps in the above method. The computer readable program code 331 can be read from or written to one or more computer program products. These computer program products include program code carriers such as a hard disk, a compact disk (CD), a memory card or a floppy disk. Such a computer program product is usually, for example Figure 4 The computer-readable storage medium. Figure 4 A schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention is shown. The computer-readable storage medium 400 stores a computer-readable program code 331 for executing the method steps according to the present invention, which can be read by the processor 310 of the electronic device 300. When the computer-readable program code 331 is executed by the electronic device 300, the electronic device 300 executes the various steps in the method described above. Specifically, the computer-readable program code 331 stored in the computer-readable storage medium can execute the method shown in any of the above embodiments. The computer-readable program code 331 can be compressed in an appropriate form.
[0126] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0127] The present invention discloses A1, an interface realization method, comprising:
[0128] Rendering a specified page resource to obtain first rendering data;
[0129] Rendering the interface resources except the designated page resources to obtain second rendering data;
[0130] Generate interface content according to the first rendering data and the second rendering data, and output the interface content to a target interface.
[0131] A2. The method as described in A1, wherein the designated page resource is a local resource and / or a network resource obtained according to a URL.
[0132] A3. The method as described in A1, wherein the specified page resource includes one or more of the following:
[0133] HTML resources, CSS resources, JS resources.
[0134] A4. The method as described in A1, wherein rendering the specified page resource to obtain the first rendering data comprises:
[0135] The page resource is rendered based on the built-in browser component to obtain first rendering data.
[0136] A5. The method as described in A4, wherein the built-in browser component is implemented by Google Chrome Embedded Framework (CEF).
[0137] A6. The method as described in A4, wherein rendering the page resource based on the built-in browser component to obtain the first rendering data comprises:
[0138] The page resource is rendered by a rendering engine of the built-in browser component, and first rendering data in a bitmap format is output by a rendering function of the rendering engine.
[0139] A7. The method as described in A4, wherein outputting the interface content to the target interface comprises:
[0140] Outputting the interface content corresponding to the first rendering data to a designated area on the target interface;
[0141] The method further includes:
[0142] When receiving an operation instruction on the target interface, it is determined whether the operation instruction falls into the designated area, and if so, the operation instruction is transparently transmitted to the built-in browser component.
[0143] A8. The method as described in A1, wherein rendering the specified page resource to obtain the first rendering data comprises:
[0144] Select the page resource to be rendered according to the preset resolution.
[0145] A9. The method as described in A1, wherein rendering the specified page resource to obtain the first rendering data comprises:
[0146] The portion of the specified page resource that is covered by the page element of the specified type is not refreshed.
[0147] A10. The method as described in A1, wherein rendering the specified page resource to obtain the first rendering data comprises:
[0148] Rendering the specified page resource to obtain an initial frame;
[0149] Calculate the change amount of each subsequent frame according to the initial frame;
[0150] The initial frame and the change amount are used as first rendering data.
[0151] A11. The method as described in A1, wherein generating interface content according to the first rendering data and the second rendering data comprises:
[0152] Acquire the second rendering data through the current process, and acquire the first rendering data according to inter-process communication;
[0153] The second rendering data and the first rendering data are merged to obtain interface content.
[0154] A12. The method as described in A11, wherein the step of fusing the second rendering data with the first rendering data to obtain the interface content comprises:
[0155] The frame rate of the interface content is determined according to the frame rate of the first rendering data and the frame rate of the second rendering data.
[0156] The present invention also discloses B13, an interface realization device, comprising:
[0157] A first rendering unit, adapted to render a specified page resource to obtain first rendering data;
[0158] A second rendering unit, adapted to render the interface resources other than the designated page resources to obtain second rendering data;
[0159] The interface unit is adapted to generate interface content according to the first rendering data and the second rendering data, and output the interface content to a target interface.
[0160] B14. The device as described in B13, wherein the designated page resource is a local resource and / or a network resource obtained according to a URL.
[0161] B15. The device as described in B13, wherein the specified page resource includes one or more of the following:
[0162] HTML resources, CSS resources, JS resources.
[0163] B16. The device as described in B13, wherein:
[0164] The first rendering unit is adapted to render the page resource based on a built-in browser component to obtain first rendering data.
[0165] B17. The device as described in B16, wherein the built-in browser component is implemented by Google Chrome Embedded Framework (CEF).
[0166] B18. The device as described in B16, wherein
[0167] The first rendering unit is adapted to render the page resource through the rendering engine of the built-in browser component, and output first rendering data in a bitmap format through the rendering function of the rendering engine.
[0168] B19. The device as described in B16, wherein the interface unit is adapted to output the interface content corresponding to the first rendering data to a designated area on the target interface;
[0169] The device also includes: a transparent transmission unit, which is adapted to, upon receiving an operation instruction on a target interface, determine whether the operation instruction falls into the designated area, and if so, transparently transmit the operation instruction to the built-in browser component.
[0170] B20. The device as described in B13, wherein
[0171] The first rendering unit is adapted to select a page resource to be rendered according to a preset resolution.
[0172] B21. The device as described in B13, wherein
[0173] The first rendering unit is adapted to not refresh a portion of the specified page resource that is covered by a page element of a specified type.
[0174] B22. The device as described in B13, wherein:
[0175] The first rendering unit is adapted to render the designated page resource to obtain an initial frame; calculate the change amount of subsequent frames according to the initial frame; and use the initial frame and the change amount as first rendering data.
[0176] B23. The device as described in B13, wherein
[0177] The interface unit is adapted to obtain the second rendering data through the current process, and obtain the first rendering data according to inter-process communication; and merge the second rendering data and the first rendering data to obtain interface content.
[0178] B24. The device as described in B23, wherein
[0179] The interface unit is adapted to determine a frame rate of the interface content according to a frame rate of the first rendering data and a frame rate of the second rendering data.
[0180] The present invention also discloses C25, an electronic device, wherein the electronic device comprises: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to execute a method as described in any one of A1-A12.
[0181] The present invention also discloses D26, a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, they implement the method described in any one of A1-A12.
Claims
1. An interface implementation method, comprising: Rendering a specified page resource to obtain first rendering data; Rendering the interface resources other than the designated page resources to obtain second rendering data, wherein the step of generating the first rendering data and the step of generating the second rendering data are implemented by different independent processes, and the first rendering data and the second rendering data are obtained by rendering using different rendering engines; Generate interface content according to the first rendering data and the second rendering data, and output the interface content to a target interface; Generating interface content according to the first rendering data and the second rendering data, and outputting the interface content to a target interface comprises: The first rendering data and the second rendering data are merged and output to a target interface.
2. The method of claim 1, wherein: The designated page resource is a local resource and / or a network resource obtained according to a URL.
3. The method of claim 1, wherein: The specified page resources include one or more of the following: HTML resources, CSS resources, JS resources.
4. The method of claim 1, wherein: The rendering of the specified page resource to obtain the first rendering data includes: The page resource is rendered based on the built-in browser component to obtain first rendering data.
5. The method of claim 4, wherein: The built-in browser component is implemented by Google Chrome Embedded Framework CEF.
6. The method of claim 4, wherein: The rendering of the page resource based on the built-in browser component to obtain the first rendering data includes: The page resource is rendered by a rendering engine of the built-in browser component, and first rendering data in a bitmap format is output by a rendering function of the rendering engine.
7. The method of claim 4, wherein: Outputting the interface content to the target interface includes: Outputting the interface content corresponding to the first rendering data to a designated area on the target interface; The method further includes: When receiving an operation instruction on the target interface, it is determined whether the operation instruction falls into the designated area, and if so, the operation instruction is transparently transmitted to the built-in browser component.
8. The method of claim 1, wherein: The rendering of the specified page resource to obtain the first rendering data includes: Select the page resource to be rendered according to the preset resolution.
9. The method of claim 1, wherein: The rendering of the specified page resource to obtain the first rendering data includes: The portion of the specified page resource that is covered by the page element of the specified type is not refreshed.
10. The method of claim 1, wherein: The rendering of the specified page resource to obtain the first rendering data includes: Rendering the specified page resource to obtain an initial frame; Calculate the change amount of each subsequent frame according to the initial frame; The initial frame and the change amount are used as first rendering data.
11. The method of claim 1, wherein: Generating interface content according to the first rendering data and the second rendering data includes: Acquire the second rendering data through the current process, and acquire the first rendering data according to inter-process communication; The second rendering data and the first rendering data are merged to obtain interface content.
12. The method of claim 11, wherein: The step of fusing the second rendering data with the first rendering data to obtain the interface content includes: The frame rate of the interface content is determined according to the frame rate of the first rendering data and the frame rate of the second rendering data.
13. An interface implementation device, comprising: A first rendering unit, adapted to render a specified page resource to obtain first rendering data; A second rendering unit is adapted to render the interface resources other than the specified page resources to obtain second rendering data, wherein the step of generating the first rendering data and the step of generating the second rendering data are implemented in different independent processes, and the first rendering data and the second rendering data are obtained by rendering using different rendering engines; an interface unit, adapted to generate interface content according to the first rendering data and the second rendering data, and output the interface content to a target interface; The interface unit is specifically used to merge the first rendering data and the second rendering data, and output them to a target interface.
14. The device of claim 13, wherein: The designated page resource is a local resource and / or a network resource obtained according to a URL.
15. The device of claim 13, wherein: The specified page resources include one or more of the following: HTML resources, CSS resources, JS resources.
16. The device of claim 13, wherein: The first rendering unit is adapted to render the page resource based on a built-in browser component to obtain first rendering data.
17. The device of claim 16, wherein: The built-in browser component is implemented by Google Chrome Embedded Framework CEF.
18. The device of claim 16, wherein: The first rendering unit is adapted to render the page resource through the rendering engine of the built-in browser component, and output first rendering data in a bitmap format through the rendering function of the rendering engine.
19. The device of claim 16, wherein: The interface unit is adapted to output the interface content corresponding to the first rendering data to a designated area on a target interface; The device also includes: a transparent transmission unit, which is adapted to, upon receiving an operation instruction on a target interface, determine whether the operation instruction falls into the designated area, and if so, transparently transmit the operation instruction to the built-in browser component.
20. The device of claim 13, wherein: The first rendering unit is adapted to select a page resource to be rendered according to a preset resolution.
21. The apparatus of claim 13, wherein: The first rendering unit is adapted to not refresh a portion of the specified page resource that is covered by a page element of a specified type.
22. The device of claim 13, wherein: The first rendering unit is adapted to render the designated page resource to obtain an initial frame; Calculate the change amount of each subsequent frame according to the initial frame; The initial frame and the change amount are used as first rendering data.
23. The device of claim 13, wherein: The interface unit is adapted to obtain the second rendering data through the current process, and obtain the first rendering data according to inter-process communication; and merge the second rendering data and the first rendering data to obtain interface content.
24. The device of claim 23, wherein: The interface unit is adapted to determine a frame rate of the interface content according to a frame rate of the first rendering data and a frame rate of the second rendering data.
25. An electronic device, wherein: The electronic device comprises: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor performs the method according to any one of claims 1 to 12.
26. A computer-readable storage medium, wherein: The computer-readable storage medium stores one or more programs, which, when executed by a processor, implement the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Page rendering method and apparatus
CN107451181A
Device and method for dynamic local rendering of browser
CN107544970A
