WO2024260252A1 - 一种页面渲染方法、装置、电子设备、计算机可读存储介质及计算机程序产品 - Google Patents
一种页面渲染方法、装置、电子设备、计算机可读存储介质及计算机程序产品 Download PDFInfo
- Publication number
- WO2024260252A1 WO2024260252A1 PCT/CN2024/097277 CN2024097277W WO2024260252A1 WO 2024260252 A1 WO2024260252 A1 WO 2024260252A1 CN 2024097277 W CN2024097277 W CN 2024097277W WO 2024260252 A1 WO2024260252 A1 WO 2024260252A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- rendering
- rendering function
- browser
- function
- calling
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9577—Optimising the visualization of content, e.g. distillation of HTML documents
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/986—Document structures and storage, e.g. HTML extensions
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/60—Memory management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/509—Offload
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/541—Client-server
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/545—Gui
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the present application relates to graphics processing technology, and in particular to a page rendering method, device, electronic device, computer-readable storage medium, and computer program product.
- Mini programs are applications that can be used without downloading and installing, thus providing great convenience for users in using different applications.
- the operation of mini programs is achieved with the help of embedded browsers (such as WebView). That is, the business logic code of the mini program is interpreted and executed by the browser process, and the graphics rendering function is called by the browser process to render the page frame of the mini program.
- embedded browsers such as WebView
- the embodiments of the present application provide a page rendering method, device, electronic device, computer-readable storage medium and computer program product, which can improve the running stability of the mini program.
- the present application embodiment provides a page rendering method, which is applied to an electronic device, including:
- a browser process of the browser is started through a client process of the application client, and a business logic code of the applet is executed through the browser process, and the applet runs in the application client;
- the browser process In response to the browser process executing a calling code for a first rendering function in the business logic code, sending a calling processing request to a client process through the browser process; wherein the first rendering function is a graphics rendering function called by the browser process, and the first rendering function is used to render a page frame of the applet;
- the second rendering function is used to perform graphics rendering on the page frame of the mini program to obtain a rendering result of the page frame of the mini program.
- the present application provides a page rendering device, including:
- a process startup module configured to, in response to a startup operation for a mini-program, start a browser process of a browser through a client process of an application client, and execute the business logic code of the mini-program through the browser process, wherein the mini-program runs in the application client;
- a request sending module configured to send a call processing request to a client process through the browser process in response to the browser process executing a call code for a first rendering function in the business logic code; wherein the first rendering function is a graphics rendering function called by the browser process, and the first rendering function is used to render a page frame of the applet;
- a calling processing module configured to, in response to the calling processing request, determine, through the client process, a second rendering function corresponding to the first rendering function, and call the second rendering function; wherein the second rendering function and the first rendering function have the same graphics rendering function;
- the graphics rendering module is configured to perform graphics rendering on the page frame of the mini program through the second rendering function to obtain a rendering result of the page frame of the mini program.
- An embodiment of the present application provides an electronic device, including:
- Memory for storing computer executable instructions or computer programs
- An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions or a computer program for causing a processor to execute and implement the page rendering method provided in the embodiment of the present application.
- An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, can implement the page rendering method provided in the embodiment of the present application.
- the electronic device when the mini-program is started, the electronic device will first start the browser process through the application client process, execute the business logic code of the mini-program through the browser process, and when executing the calling code for the first rendering function in the business logic code, send a call processing request to the client process through the browser process, so as to convert the browser process's call to the first rendering function into a call to the second rendering function by the client process through the call processing request, and perform graphics rendering on the page frame of the mini-program through the second rendering function.
- the second rendering function is a rendering function with the same graphics rendering function as the first rendering function, in this way, under the premise of ensuring that the graphics rendering function can be implemented normally, the graphics rendering process of the page frame of the mini-program is transferred to the application client for implementation, so that the browser only serves as an executor of the business logic code, thereby greatly reducing the browser's memory consumption and reducing the possibility of the browser process being forced to stop, and ultimately reducing the risk of the mini-program being forced to close, thereby improving the running stability of the mini-program.
- FIG1 is a schematic diagram of rendering of a page frame of a mini program
- FIG2 is a schematic diagram of the architecture of a page rendering system provided in an embodiment of the present application.
- FIG3 is a schematic diagram of the structure of the terminal in FIG2 provided in an embodiment of the present application.
- FIG4 is a flowchart of a page rendering method according to an embodiment of the present application.
- FIG5 is a second flow chart of the page rendering method provided in an embodiment of the present application.
- FIG6 is a third flow chart of the page rendering method provided in an embodiment of the present application.
- FIG7 is a schematic diagram of the principle of rendering a game screen of a mini-game provided in an embodiment of the present application.
- FIG8 is a schematic diagram of recording a call to a WebGL function provided by an embodiment of the present application.
- FIG. 9 is another schematic diagram of recording calls to WebGL functions provided in an embodiment of the present application.
- first ⁇ second involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that “first ⁇ second” can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
- module refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as processing circuits or memories) or a combination thereof.
- a processor or multiple processors or memories
- each module or unit can be part of an overall module or unit that includes the function of the module or unit.
- Mini Program also known as Web Program, is a program developed based on a front-end language (such as JavaScript) to implement services in a Hypertext Markup Language (HTML) page. It is downloaded by the client via a network (such as the Internet) and interpreted and executed in the client's browser or embedded browser, saving the steps of installation in the client.
- a mini program for clocking in or gaming services can be downloaded and run in a social network client.
- Clients are applications that users need to download and install on their terminals (e.g., smartphones) before they can use the application, such as browser clients or social network clients.
- Client process It is a process allocated to the client on the terminal and is used to implement various functions of the client.
- Embedded browser is a browser embedded in native applications (referring to applications that can run directly on the operating system). Native applications can use embedded browsers to display web pages. Different operating systems will have different embedded browsers. For example, some operating systems can use UIWebView and WKWebview to display web pages.
- Browser process It is a process allocated by the embedded browser on the terminal and is used to implement various functions of the browser process.
- Page frame refers to the unit of rendering and display of the screen content of the mini program. That is, the screen content of the mini program is rendered in units of one page frame and displayed in units of one page frame. Therefore, the screen content of the mini program can be dynamically presented by continuously displaying multiple page frames.
- Rendering function refers to the function used to define and describe how a page is displayed in web development or applet development. It is usually responsible for converting data into a visual HTML structure and presenting it on the user interface.
- page rendering functions may vary in different frameworks and platforms, but their core purpose is similar, that is, to define the display logic of the page.
- Command cache a cache space used to store call information of rendering functions.
- Business logic code is the code used to complete the business logic. In the embodiment of the present application, it refers to the business logic code of the mini-program, that is, the code part that implements various functions and interactions in the mini-program. These codes may include functions such as login verification, page jump, data request and processing, component operation, etc. Generally speaking, the business logic code of the mini-program mainly includes the following aspects:
- Page life cycle function In the mini program, each page has its own life cycle function, including callback functions for different stages such as page loading, page display, page hiding, page unloading, etc. Various logical operations can be performed in these functions.
- the mini program needs to interact with the server for data. It can send requests and process the returned data through the built-in request method, including data parsing, data display and other operations.
- Event monitoring and processing The pages in the mini program can monitor various user interaction events, such as click events, sliding events, input events, etc., and can implement the corresponding business logic through event processing functions.
- Component operation Various built-in components and custom components can be used in the mini program to implement different functions of the page, and the display, hiding, style and other operations of the components can be controlled through the relevant API.
- the business logic code of a mini program is the code part responsible for implementing the various functions and interactions of the mini program. Through these codes, various complex logics and interactive effects of the mini program can be realized.
- Mini programs are applications that can be used without downloading and installing, thus providing great convenience for users in using different applications. For example, users can use mini programs to clock in and out without installing the corresponding client, or play games and entertainment without installing the corresponding client.
- the operation of the applet is realized by means of an embedded browser (such as WebView), that is, the business logic code of the applet is interpreted and executed by the browser process, and the graphics rendering function is called by the browser process to render the page frame of the applet.
- an embedded browser such as WebView
- FIG1 is a schematic diagram of rendering of a page frame of a mini program.
- the code of a mini program is usually divided into a business logic code (i.e., the code written by the creator of the mini program to implement the functions of the mini program) 11, an application programming interface (Application Programming Interface, API) 12 for calling the client, and a calling interface for a rendering function 13, which is used to render the page frame of the mini program.
- a business logic code i.e., the code written by the creator of the mini program to implement the functions of the mini program
- API Application Programming Interface
- the embedded browser may be upgraded along with the terminal's operating system (i.e., when the operating system is upgraded, the embedded browser may also be upgraded accordingly).
- the upgrade of the embedded browser may bring some operational failures (bugs), so when the browser process is used to render the page frame of the applet, a failure may also occur, thereby affecting the normal use of the applet.
- the embodiments of the present application provide a page rendering method, apparatus, device, computer-readable storage medium, and computer program product, which can reduce the risk of mini-programs being forcibly closed.
- the following describes an exemplary application of an electronic device for page rendering provided by the embodiments of the present application.
- the electronic device provided by the embodiments of the present application can be implemented as various types of terminals such as laptops, tablet computers, desktop computers, set-top boxes, mobile devices (for example, mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), and can also be implemented as a server
- an exemplary application when the electronic device is implemented as a terminal will be described.
- FIG. 2 is a schematic diagram of the architecture of the page rendering system provided in an embodiment of the present application.
- the terminal terminal 400-1 and terminal 400-2 are shown as examples
- the network 300 can be a wide area network or a local area network, or a combination of the two.
- a database 500 is also provided for providing data support to the server 200.
- the database 500 can be independent of the server 200, and can also be configured in the server 200.
- Figure 2 shows a situation where the database 500 is independent of the server 200.
- Terminal 400-1 and terminal 400-2 are used to respond to the user's startup operation on the graphical interface 410-1 and the graphical interface 410-2 for the small program, download the program code of the small program from the server 200 through the client process and start the browser process of the browser, and execute the business logic code in the program code of the small program through the browser process; in response to the business logic code, call the first rendering function for the page frame of the small program, send a call processing request to the client process through the browser process, wherein the first rendering function is a graphics rendering function that can be called by the browser process; in response to the call processing request, determine the corresponding second rendering function for the first rendering function through the client process, and call the second rendering function; wherein the second rendering function is a graphics rendering function that can be called by the client process; through the second rendering function, perform graphics rendering on the page frame of the small program to obtain the rendering result of the page frame of the small program; and display the rendering result of each page frame in turn on the graphical interface 410-1 and the graphical interface 410-2.
- the server 200 is used to send the program code of the mini-program to the terminal 400 - 1 and the terminal 400 - 2 .
- Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or a local area network to achieve data computing, storage, processing, and sharing.
- Cloud computing is a general term for network technology, information technology, integration technology, management platform, and application technology based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The system background services of the technical network require a large amount of computing and storage resources, which need to be realized through cloud computing.
- server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
- Terminals 400-1 and 400-2 may be smart phones, tablet computers, laptops, desktop computers, smart speakers, smart watches, smart home appliances, car terminals, etc., but are not limited thereto.
- the terminals and servers may be directly or indirectly connected via wired or wireless communications, which is not limited in the embodiments of the present application.
- FIG. 3 is a schematic diagram of the structure of the terminal (an implementation of an electronic device) in FIG. 2 provided in an embodiment of the present application.
- the terminal 400 shown in FIG. 3 includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430.
- the various components in the terminal 400 are coupled together via a bus system 440. It is understandable that the bus system 440 is used to achieve connection and communication between these components.
- the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus system 440 in FIG. 3 .
- Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
- DSP digital signal processor
- the user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and/or one or more visual display screens.
- the user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
- the memory 450 may be removable, non-removable, or a combination thereof.
- Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc.
- the memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
- the memory 450 includes a volatile memory or a nonvolatile memory, and may also include both volatile and nonvolatile memories.
- the nonvolatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM).
- the memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
- memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
- Operating system 451 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
- a network communication module 452 for reaching other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;
- a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripherals and displaying content and information);
- output devices 431 e.g., display screen, speaker, etc.
- the user interface 430 e.g., a user interface for operating peripherals and displaying content and information
- the input processing module 454 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.
- the page rendering device provided in the embodiment of the present application can be implemented in software.
- FIG. 3 shows a page rendering device 455 stored in the memory 450, which can be software in the form of a program and a plug-in, including the following software modules: a process startup module 4551, a request sending module 4552, a call processing module 4553, a graphics rendering module 4554, a script processing module 4555, and a mapping generation module 4556. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
- the page rendering device provided in the embodiments of the present application can be implemented in hardware.
- the page rendering device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the page rendering method provided in the embodiments of the present application.
- the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.
- ASICs application specific integrated circuits
- DSPs digital signal processor
- PLDs programmable logic devices
- CPLDs complex programmable logic devices
- FPGAs field programmable gate arrays
- a terminal or a server can implement the page rendering method provided in the embodiments of the present application by running a computer program.
- the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a social network APP or an instant messaging APP; it can also be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a small program that can be embedded in any APP.
- the above-mentioned computer program can be an application, module or plug-in in any form.
- the embodiments of the present application can be applied to the page rendering scenarios of small programs of application software, operating systems, etc.
- the page rendering method provided by the embodiments of the present application is described.
- the electronic device that implements the page rendering method of the embodiments of the present application can be a terminal, a server, or a combination of the two. Therefore, the execution subject of each step will not be repeated in the following.
- Figure 4 is a flowchart diagram of the page rendering method provided in an embodiment of the present application, and will be explained in conjunction with the steps shown in Figure 4.
- a browser process of a browser is started through a client process of an application client, and a business logic code of the small program is executed through the browser process.
- the embodiment of the present application is implemented in the scenario of performing graphic rendering on the page frame of the applet, and the page frame after the graphic rendering is used to present the screen content of the applet.
- the electronic device will detect in real time whether a startup operation for the applet is received.
- the browser process of the browser will be started through the client process of the application client, and the business logic code of the applet will be interpreted and executed through the browser process, thereby realizing the business function of the applet.
- the mini-program in the embodiment of the present application may be a game mini-program (also referred to as a mini-game), an office software mini-program, or various types of mini-programs such as music mini-programs, and the embodiment of the present application is not limited thereto.
- the client process refers to the process of the client of the application program embedded with the mini program, that is, the mini program is running in the application client, and thus, the startup operation for the mini program refers to the operation of entering the mini program triggered on the application client (hereinafter referred to as the client).
- the startup operation can be implemented by clicking the icon of the mini program, scanning the QR code of the mini program, etc.
- the above-mentioned application can refer to a social network application, or it can be a music application, a game application, etc., and thus, the client can be a social network client, a music client, a game client, etc.
- the mini program can be embedded in these clients and run to provide the functions of the mini program to users who have installed these clients.
- the browser in the embodiment of the present application can be a browser provided by the client, or an embedded browser provided by the operating system of the electronic device, which is not limited in the embodiment of the present application.
- the browser process refers to the process allocated by the electronic device to the browser.
- the business logic code of a mini program is the code used to implement the specific functions of the mini program, which is generally written by the creator of the mini program.
- the business logic code of the mini program will be pulled from the server by the client when the mini program is started for the first time. It can also be extracted from the client's cache file when it is not started for the first time.
- the business logic code will call the first rendering function to render the page frames of the applet one by one or in parallel.
- the first rendering function is a graphics rendering function that can be called by the browser process, and the business logic code is executed by the browser process.
- the browser process executes the calling code for the first rendering function in the business logic code
- the browser process executes the calling code for the first rendering function in the business logic code, indicating that the browser process has executed the calling code for the first rendering function.
- the first rendering function is called by the browser process to render the page.
- the electronic device in response to the browser process executing the calling code for the first rendering function in the business logic code, the electronic device will forward the function call of the page rendering in the browser process to the client process by calling the processing request, so as to implement the function call of the page rendering through the client.
- the browser can be regarded as only an executor of the business logic code, and only a few pages need to be loaded, thereby reducing the memory consumption of the browser.
- the browser process can send a call processing request to the client process in a variety of ways.
- the calling information of the first rendering function is written into the command cache through the browser process to record the calling of the first rendering function through the command cache.
- the browser process can write the calling information of all the first rendering functions called for each page frame into the same command cache, or write the calling information of each first rendering function into the command cache allocated to it (that is, the browser process allocates a command cache for each first rendering function, and only the calling information of the corresponding first rendering function is written into each command cache).
- the calling information of the first rendering function needs to include at least the function identifier of the first rendering function and the calling parameters of the first rendering function (which can also be understood as the input parameters of the first rendering function).
- the function identifier is used to distinguish different first rendering functions, and the function identifier can be the function name of the first rendering function, or it can be the function identifier of the first rendering function.
- the calling parameters of the first rendering function can vary according to the specific rendering function of the first rendering function. For example, when the first rendering function is a graphics drawing function, the calling parameters of the first rendering function are the coordinates of each point of the graphics. When the first rendering function is a shading function, the calling parameters of the first rendering function are the color code.
- command cache in the embodiment of the present application can be created by the browser process itself, or it can be created by the client process and injected into the browser process.
- the method may also include the following processing: generating script code for the command cache through the client process, and injecting the script code for the command cache into the browser process.
- the script code of the command cache is used to create the command cache and control the browser process to write the call information of the first rendering function into the command cache. That is, the client process generates a section of script code that can be automatically executed.
- the script code is used to open a command cache that can be read and written, intercept the call of the first rendering function, and control the browser process to record the corresponding call information.
- injecting the script code of the command cache into the browser process can be achieved by creating a thread in the browser process and making the thread execute the script code of the command cache, or by generating an executable file corresponding to the script code and using the executable file to replace the call code (or code segment) for the first rendering function in the browser process, that is, replacing the call code for the first rendering function with the executable file.
- the electronic device After the electronic device writes the call information of the first rendering function in the command cache through the browser process, it will generate a call processing request for the first rendering function through the browser process, and pack the command cache with the call information written into the call processing request, and send the call processing request to the client process through cross-process communication. In this way, after receiving the call processing request, the client process can parse the command cache therefrom to obtain the call information of the first rendering function.
- the electronic device can, after the browser process writes the call information of the first rendering function into the command cache, immediately generate a call processing request for the command cache through the browser process and send it to the client process; or, after the browser process writes the call information of the first rendering function into the command cache, when certain request sending conditions are met (i.e., when the call processing request needs to be sent), generate a call processing request for the command cache through the browser process and send it to the client.
- the request sending condition may mean that the first rendering function is a synchronous rendering function with a return value (such as the gl.createBuffer function), or that the calling information of all first rendering functions called for the page frame has been recorded in the command cache.
- a return value such as the gl.createBuffer function
- a call process is generated for a command cache through a browser process.
- the request is generated and the call processing request is sent to the client process.
- This can be achieved by the following processing: when the first rendering function called by the business logic code is a synchronous rendering function with a return value, the call processing request is generated for the command cache through the browser process, and the call processing request is sent to the client process.
- the synchronous rendering function can only continue to run after obtaining the return value, otherwise it will remain in a suspended state to continue waiting for the return value. Therefore, when the first rendering function is a synchronous rendering function with a return value, the command cache needs to be submitted to the client process in a timely manner so that the client process generates a corresponding return value for the first rendering function and returns it, so that the first rendering function can continue to execute.
- S1022 in Figure 5 that is, generating a call processing request for the command cache through the browser process, and sending the call processing request to the client process, can also be achieved through the following processing: when the call information of each of the multiple first rendering functions that need to be called when the page frame is rendered has been recorded in the command cache, generating a call processing request for the command cache through the browser process, and sending the call processing request to the client process.
- cross-process communication takes a certain amount of time to achieve, and a page frame may need to call multiple, for example dozens or hundreds of first rendering functions, to complete graphics rendering.
- These first rendering functions can all be regarded as the first rendering functions that the page frame needs to call when rendering.
- the electronic device When the call information of each of these first rendering functions has been recorded in the command cache, the electronic device will generate a call processing request for the command cache through the browser process and send it to the client process. In this way, the calls of all the first rendering functions required for a page frame can be submitted to the client process in batches, thereby reducing the number of cross-process communications and improving the processing efficiency of the page frame during graphics rendering.
- sending the call processing request to the client process can be implemented through an XMLHttpRequest (XHR) request, or based on technologies such as the WebSocket protocol, which is not limited in the embodiment of the present application.
- XHR XMLHttpRequest
- sending the call processing request to the client process can be achieved through the following processing: through the browser process, the access address of the call processing request is set to the service address of the client process; through the client process, the call processing request is intercepted at the service address to complete the sending of the call processing request to the client process.
- the browser process directly uses the service address of the client process as the access address for calling the processing request. Then the client process can intercept the request sent by the browser process at its service address through the request interception control (such as the WKURLSchemeHandler control) to achieve cross-process communication between the browser process and the client process and complete the sending of the calling processing request.
- the request interception control such as the WKURLSchemeHandler control
- S103 In response to the call processing request, determine, through the client process, a second rendering function corresponding to the first rendering function, and call the second rendering function.
- the electronic device responds to the call processing request through the client process, and determines a second rendering function that has the same graphics rendering function as the first rendering function, and the second rendering function is an image rendering function that can be called by the client process. Then, the electronic device calls the second rendering function through the client process, thereby converting the call to the first rendering function into a call to the second rendering function, so that the second rendering function can be used to render the page frame of the applet later.
- the first rendering function and the second rendering function can perform the same graphics rendering function, but are different in the way they are called.
- the first rendering function is a function for creating a buffer object (such as the creatBuffer function in WebGL)
- the second rendering function is also a function for creating a buffer object (such as a function for creating a buffer object in OpenGL).
- the second rendering function can be obtained by the client process from the existing graphics rendering functions that can be called by the client process according to the function of the first rendering function.
- a correspondence table between various graphics rendering functions that can be called by the browser process and graphics rendering functions that can be called by the client process with the same graphics rendering function can be established in advance, and then the second rendering function corresponding to the first rendering function can be queried from the correspondence table.
- the second rendering function can also be a function that the client process performs on the first rendering function.
- the converted and rewritten data are not limited in the embodiments of the present application.
- calling the second rendering function can be implemented by the following processing: through the client process, parsing the calling parameters of the first rendering function from the command cache, and converting the calling parameters of the first rendering function into calling parameters of the second rendering function; through the client process, passing the calling parameters of the second rendering function to the second rendering function, thereby completing the call to the second rendering function.
- the electronic device parses the command cache from the call processing request through the client process, and parses the call parameters of the first rendering function from the command cache, and converts them into call parameters available to the second rendering function, and finally passes the converted call parameters as input parameters of the second rendering function to the second rendering function to implement the call of the second rendering function.
- the electronic device converts them according to the second rendering function parameter format through the client process, and inputs the conversion results into the second rendering parameters to complete the call.
- the electronic device uses the second rendering function to perform graphics rendering processing on each page frame of the mini-program, such as drawing patterns and coloring each page frame. After completing the graphics rendering, the rendering result of each page frame can be obtained.
- the electronic device will first start the browser process through the client process when the user starts the mini-program, execute the business logic code of the mini-program through the browser, and when the business logic code needs to call the first rendering function, send a call processing request to the client process through the browser process, so as to convert the browser process's call to the first rendering function into a call to the second rendering function by the client process through the call processing request, and perform graphics rendering on the mini-program's page frame through the second rendering function.
- the graphics rendering process of the mini-program's page frame can be transferred to the client implementation, so that the browser only acts as an executor of the business logic code without the resource overhead required to call the graphics processor, thereby greatly reducing the browser's memory consumption and reducing the possibility of the browser process being forced to stop, and ultimately reducing the risk of the mini-program being forced to close.
- the graphics rendering process of the mini-program's page frame is transferred to the client, which unbinds the graphics rendering of the browser and the mini-program's page frame. In this way, even if the browser upgrade may cause operational failures, it will not affect the graphics rendering of the mini-program's page frame, thereby ensuring the normal use of the mini-program.
- the browser process when the first rendering function is a synchronous rendering function with a return value, the browser process will immediately carry the command cache in the call processing request and send it to the client process to realize the submission of the command cache, and will continue the subsequent execution only after obtaining the return value. It can be seen that this method still takes some time to continue to write the subsequent call information of the first rendering function into the command cache and submit the command cache because it needs to wait for the return value to be returned, thereby affecting the operation efficiency.
- FIG6 is a flow chart of the page rendering method provided in an embodiment of the present application.
- the method may further include the following processing:
- the first rendering function is a synchronous rendering function with a return value
- a virtual return value is returned for the first rendering function through the browser process, and the virtual return value and the calling information of the first rendering function are written into the command cache together.
- the electronic device when the first rendering function is a synchronous rendering function with a return value, the electronic device will first generate a virtual return value for the first rendering function through the browser process, and return the virtual return value to the first rendering function, so that the first rendering function can continue to run.
- the browser process does not need to wait for the return value of the first rendering function, so that it can continue to record the call information of other subsequent first rendering functions, and after completing the recording of the call information of all first rendering functions for the page frame, submit the command cache to the client process at one time.
- the virtual return value can be randomly generated by the browser process according to the format of the return value of the first rendering function, or it can be the historical return value of the first rendering function, which is not limited in the embodiments of the present application.
- the electronic device will write the calling information (i.e., function identifier, calling parameters, etc.) and the virtual return value of the first rendering function into the command cache through the browser process, so that the subsequent client process can parse the calling information and virtual return value of the first rendering function from the command cache.
- calling information i.e., function identifier, calling parameters, etc.
- the method further includes: through the client process, parsing the command cache from the call processing request, and extracting the virtual return value from the command cache; through the client process, using the return value of the second rendering function as the real return value of the first rendering function, and establishing a mapping relationship between the real return value and the virtual return value.
- mapping relationship is used to determine the corresponding real return value for the virtual return value in the command cache at a future time.
- the call to the first rendering function is converted into a call to the second rendering function, so that the second rendering function has the same function as the first rendering function, and therefore, the return value of the second rendering function can be used as the real return value of the first rendering function.
- the function of the first rendering function is to create a buffer object
- the function of the second rendering function is also to create a buffer object, so that the return value of the second rendering function can be the identifier of the buffer object (for example, bufferID), and the return value of the first rendering function should also be the identifier of the buffer object.
- the electronic device will directly determine the return value of the second rendering function as the real return value of the first rendering function through the client process, and bind the real return value and the virtual return value by establishing a mapping relationship between the real return value and the virtual return value.
- the client process can directly determine the real return value for the first rendering function through the mapping relationship, so as to facilitate the subsequent functions.
- the embodiment of the present application is implemented in the scenario of rendering the game screen (called page frame) of a small game (called applet).
- the rendering of the game screen of the small game is switched from WebView (called browser) to the client of the social application.
- FIG7 is a schematic diagram of the principle of rendering the game screen of the mini-game provided by an embodiment of the present application.
- the call of the first rendering function 73 (exemplarily, the first rendering function can be a WebGL function) in the browser process 71 (also referred to as the WebView process) is forwarded to the client process 72 through cross-process communication, while the business logic code of the mini-game, i.e., the JS code 74, is still running in the browser process 71, and at the same time, the client process 72 is called through the application programming interface 75 to implement file reading and writing, information logging, etc.
- the JS code may need to be called dozens or even hundreds of times for each frame of the game screen. If each WebGL function is called, it needs to be forwarded to the client through cross-process communication. Therefore, in the embodiment of the present application, the call of the WebGL function is recorded in the command cache through the browser process, and when submission is required, the call of the WebGL function is submitted to the client process in batches at one time through cross-process communication for batch processing.
- the client process will inject script code of the command cache into the browser process.
- the script code is used to intercept the call of the WebGL function of the JS code and record the call of the WebGL function into the command cache.
- Figure 8 is a schematic diagram of recording the call of the WebGL function provided by the embodiment of the present application.
- the browser process writes the call of the WebGL function, that is, the function ID (called function identification) of the WebGL function and the call parameters, into the command cache for subsequent batch submission.
- the command cache When a frame ends or a synchronous function (called a synchronous rendering function) is called, the command cache needs to be submitted to the client process.
- the command cache can be converted into binary data, so that cross-process communication can be implemented using XHR, that is, the browser process will carry the command cache data through an XHR request and submit it to the client process, and the client process will intercept the XHR request (called a call processing request) through WKURLSchemeHandler.
- cross-process communication can also be implemented through WebScoket, Prompt, postMessage, etc.
- a synchronous function with a return value such as calling gl.createBuffer
- the browser process will submit the command cache once and wait for the return value, so that the rendering efficiency is not very high.
- the call can be written into the command cache without triggering a synchronous submission.
- the browser process returns a false BufferID (called a virtual return value) and writes the false BufferID to the command cache together with the function call.
- the client process parses the command cache and generates a true BufferID (called a real return value), it maps the true BufferID and the false BufferID.
- the client process can directly replace the false BufferID with the true BufferID based on the mapping relationship to achieve the function.
- FIG. 9 is another schematic diagram of recording the call of WebGL function provided by an embodiment of the present application.
- the command buffer in addition to recording the function identifiers (i.e., function IDs) and call parameters of some WebGL functions that do not have return values, a virtual return value (i.e., fake BufferID) is also recorded for the create command buffer (createBuffer) function so as to pass it to the client process.
- function IDs i.e., function IDs
- fake BufferID i.e., fake BufferID
- the client process When the client process is rendering, that is, when the client process receives the instruction from the browser process indicating that a canvas needs to be created and calls the WebGL function through getContext (the client process does not execute the instruction at this time), the corresponding drawing layer (such as EAGLView) and EAGLContext will be created on the client. After that, after the client process receives the command cache, it will convert the call of the WebGL function into an OpenGL ES function (called the second rendering function) to achieve rendering.
- the second rendering function OpenGL ES function
- the browser is only an executor of the JS code.
- the browser only needs to load a very small or even blank HTML page (which can ensure the normal execution of the JS code), without any GPU resource-related overhead. This can greatly reduce the memory consumption of WebView itself.
- the browser since the browser is no longer required to render, the impact of browser upgrade failures on the rendering of the game screen can be avoided.
- the software module stored in the page rendering device 455 of the memory 450 may include:
- a process start module 4551 is configured to start a browser process of a browser through a client process of an application client in response to a start operation for the mini program, and execute the business logic code of the mini program through the browser process, and the mini program runs in the application client;
- the request sending module 4552 is configured to respond to the browser process executing the business logic code to A calling code of a first rendering function sends a calling processing request to a client process through the browser process; wherein the first rendering function is a graphics rendering function called by the browser process, and the first rendering function is used to render a page frame of the applet;
- a call processing module 4553 is configured to, in response to the call processing request, determine, through the client process, a second rendering function corresponding to the first rendering function, and call the second rendering function; wherein the second rendering function and the first rendering function have the same graphics rendering function;
- the graphics rendering module 4554 is configured to perform graphics rendering on the page frame of the mini program through the second rendering function to obtain the rendering result of the page frame of the mini program.
- the request sending module 4552 is also configured to, in response to the browser process executing a calling code for a first rendering function in the business logic code, write the calling information of the first rendering function in the command cache through the browser process; generate the call processing request for the command cache through the browser process, and send the call processing request to the client process.
- the request sending module 4552 is also configured to generate the call processing request for the command cache through the browser process when the first rendering function is a synchronous rendering function with a return value, and send the call processing request to the client process.
- the script processing module 4555 is further configured to create a thread in the browser process and use the thread to execute the script code in the command cache; or, generate an executable file corresponding to the script code in the command cache and replace the calling code for the first rendering function with the executable file.
- the call information includes: call parameters; the call processing module 4553 is further configured to parse the call parameters of the first rendering function from the command cache through the client process; The method further comprises: converting the calling parameter of the first rendering function into the calling parameter of the second rendering function; and passing the calling parameter of the second rendering function to the second rendering function through the client process to complete the calling of the second rendering function.
- the embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium.
- the processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the page rendering method described in the embodiment of the present application.
- An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein computer-executable instructions are stored.
- the processor will execute the page rendering method provided by an embodiment of the present application, for example, the page rendering method shown in FIG. 4 .
- the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.
- computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
- computer-executable instructions may, but do not necessarily, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
- HTML HyperText Markup Language
- computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
- the electronic device when the user starts the applet, the electronic device will first start the browser process through the client process, execute the business logic code of the applet through the browser, and when the business logic code needs to call the first rendering function, send a call processing request to the client process through the browser process, so as to convert the browser process's call to the first rendering function into a call to the second rendering function by the client process through the call processing request, and perform graphics rendering on the page frame of the applet through the second rendering function.
- the graphics rendering process of the page frame of the applet can be transferred to the client implementation, so that the browser is only used as an executor of the business logic code, thereby greatly reducing the memory consumption of the browser and reducing the possibility of the browser process being forced to stop, and ultimately reducing the risk of the applet being forced to close.
- the graphics rendering process of the page frame of the applet is transferred to the client implementation, which realizes the unbinding of the graphics rendering of the page frame of the browser and the applet. In this way, even if the upgrade of the browser may cause an operating failure, it will not affect the graphics rendering of the page frame of the applet, thereby ensuring the normal use of the applet.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
Claims (14)
- 一种页面渲染方法,应用于电子设备,所述电子设备中包括应用程序客户端和浏览器,所述方法包括:响应于针对小程序的启动操作,通过应用程序客户端的客户端进程启动浏览器的浏览器进程,并通过所述浏览器进程执行所述小程序的业务逻辑代码,所述小程序在所述应用程序客户端中运行;响应于所述浏览器进程执行至所述业务逻辑代码中针对第一渲染函数的调用代码,通过所述浏览器进程向客户端进程发送调用处理请求;其中,所述第一渲染函数是所述浏览器进程调用的图形渲染函数,所述第一渲染函数用于渲染所述小程序的页面帧;响应于所述调用处理请求,通过所述客户端进程确定所述第一渲染函数相对应的第二渲染函数,并对所述第二渲染函数进行调用;其中,所述第二渲染函数和所述第一渲染函数的图形渲染功能相同;通过所述第二渲染函数,对所述小程序的所述页面帧进行图形渲染,得到所述小程序的所述页面帧的渲染结果。
- 根据权利要求1所述的方法,其中,所述响应于所述浏览器进程执行至所述业务逻辑代码中针对第一渲染函数的调用代码,通过所述浏览器进程向客户端进程发送调用处理请求,包括:响应于所述浏览器进程执行至所述业务逻辑代码中针对第一渲染函数的调用代码,通过所述浏览器进程在命令缓存中写入所述第一渲染函数的调用信息;通过所述浏览器进程,针对所述命令缓存生成所述调用处理请求,并将所述调用处理请求发送至所述客户端进程。
- 根据权利要求1或2所述的方法,其中,所述通过所述浏览器进程,针对所述命令缓存生成所述调用处理请求,并将所述调用处理请求发送至所述客户端进程,包括:当所述第一渲染函数为存在返回值的同步渲染函数时,通过所述浏览器进程,针对所述命令缓存生成所述调用处理请求,并将所述调用处理请求发送至所述客户端进程。
- 根据权利要求1至3任一项所述的方法,其中,所述通过所述浏览器进程,针对所述命令缓存生成所述调用处理请求,并将所述调用处理请求发送至所述客户端进程,包括:当在渲染所述页面帧时所需要调用的多个第一渲染函数各自的调用信息均已被记录在所述命令缓存时,通过所述浏览器进程,针对所述命令缓存生成所述调用处理请求,并将所述调用处理请求发送至所述客户端进程。
- 根据权利要求1至4任一项所述的方法,其中,所述响应于所述浏览器进程执行至所述业务逻辑代码中针对第一渲染函数的调用代码,通过所述浏览器进程在命令缓存中写入所述第一渲染函数的调用信息之前,所述方法还包括:通过所述客户端进程,生成所述命令缓存的脚本代码;将所述命令缓存的脚本代码注入至所述浏览器进程中;所述命令缓存的脚本代码用于创建所述命令缓存;控制所述浏览器进程将所述第一渲染函数的调用信息写入至所述命令缓存中。
- 根据权利要求1至5任一项所述的方法,所述将所述命令缓存的脚本代码注入至所述浏览器进程中,包括:在所述浏览器进程中创建线程,利用所述线程执行所述命令缓存的脚本代码;或者,生成所述命令缓存的脚本代码对应的可执行文件,将针对所述第一渲染函数的调用代码替换为所述可执行文件。
- 根据权利要求1至6任一项所述的方法,其中,所述将所述调用处理请求发送至所述客户端进程,包括:通过所述浏览器进程,将所述调用处理请求的访问地址设置为所述客户端进程的服务地址;通过所述客户端进程,在所述服务地址对所述调用处理请求进行拦截,完成将所述调用处理请求发送至所述客户端进程。
- 根据权利要求1至7任一项所述的方法,其中,所述通过所述浏览器进程,针对所述命令缓存生成所述调用处理请求,并将所述调用处理请求发送至所述客户端进程之前,所述方法还包括:当所述第一渲染函数为存在返回值的同步渲染函数时,响应于所述浏览器进程执行至所述业务逻辑代码中针对第一渲染函数的调用代码,通过所述浏览器进程,针对所述第一渲染函数返回虚拟返回值,并将所述虚拟返回值和所述第一渲染函数的调用信息,共同写入至所述命令缓存中。
- 根据权利要求1至8任一项所述的方法,其中,所述通过所述第二渲染函数,对所述小程序的所述页面帧进行图形渲染,得到所述小程序的所述页面帧的渲染结果之后,所述方法还包括:通过所述客户端进程,从所述调用处理请求中解析得到所述命令缓存,并从所述命令缓存中提取得到所述虚拟返回值;通过所述客户端进程,将所述第二渲染函数的返回值作为所述第一渲染函数的真实返回值,并建立所述真实返回值与所述虚拟返回值之间的映射关系;其中,所述映射关系用于针对所述命令缓存中的所述虚拟返回值确定对应的真实返回值。
- 根据权利要求1至9任一项所述的方法,其中,所述调用信息包括:调用参数;所述对所述第二渲染函数进行调用,包括:通过所述客户端进程,从所述命令缓存中解析得到所述第一渲染函数的调用参数,并将所述第一渲染函数的调用参数转换为第二渲染函数的调用参数;通过所述客户端进程,将所述第二渲染函数的调用参数,传递至所述第二渲染函数,完成将对所述第二渲染函数的调用。
- 一种页面渲染装置,所述装置包括:进程启动模块,配置为响应于针对小程序的启动操作,通过应用程序客户端的客户端进程启动浏览器的浏览器进程,并通过所述浏览器进程执行所述小程序的业务逻辑代码,所述小程序在所述应用程序客户端中运行;请求发送模块,配置为响应于所述浏览器进程执行至所述业务逻辑代码中针对第一渲染函数的调用代码,通过所述浏览器进程向客户端进程发送调用处理请求;其中,所述第一渲染函数是所述浏览器进程调用的图形渲染函数,所述第一渲染函数用于渲染所述小程序的页面帧;调用处理模块,配置为响应于所述调用处理请求,通过所述客户端进程确定所述第一渲染函数相对应的第二渲染函数,并对所述第二渲染函数进行调用;其中,所述第二渲染函数和所述第一渲染函数的图形渲染功能相同;图形渲染模块,配置为通过所述第二渲染函数,对所述小程序的所述页面帧进行图形渲染,得到所述小程序的所述页面帧的渲染结果。
- 一种电子设备,所述电子设备包括:存储器,用于存储计算机可执行指令或计算机程序;处理器,用于执行所述存储器中存储的计算机可执行指令或者计算机程序时,实现 权利要求1至10任一项所述的页面渲染方法。
- 一种计算机可读存储介质,存储有计算机可执行指令或者计算机程序,所述计算机可执行指令被处理器执行时实现权利要求1至10任一项所述的页面渲染方法。
- 一种计算机程序产品,包括计算机程序或计算机可执行指令,,所述计算机程序或计算机可执行指令被处理器执行时实现权利要求1至10任一项所述的页面渲染方法。
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP24825148.0A EP4645122A4 (en) | 2023-06-19 | 2024-06-04 | PAGE RENDERING METHOD AND APPARATUS, ELECTRONIC DEVICE, COMPUTER-READABLE STORAGE MEDIA AND COMPUTER PROGRAM PRODUCT |
| JP2025546965A JP2026510235A (ja) | 2023-06-19 | 2024-06-04 | ページレンダリング方法、装置、電子機器、及びコンピュータプログラム |
| US19/319,494 US20260004384A1 (en) | 2023-06-19 | 2025-09-04 | Page rendering method |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310732158.7A CN119166920A (zh) | 2023-06-19 | 2023-06-19 | 一种页面渲染方法、装置、设备、存储介质及程序产品 |
| CN202310732158.7 | 2023-06-19 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US19/319,494 Continuation US20260004384A1 (en) | 2023-06-19 | 2025-09-04 | Page rendering method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024260252A1 true WO2024260252A1 (zh) | 2024-12-26 |
Family
ID=93885903
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/097277 Ceased WO2024260252A1 (zh) | 2023-06-19 | 2024-06-04 | 一种页面渲染方法、装置、电子设备、计算机可读存储介质及计算机程序产品 |
Country Status (5)
| Country | Link |
|---|---|
| US (1) | US20260004384A1 (zh) |
| EP (1) | EP4645122A4 (zh) |
| JP (1) | JP2026510235A (zh) |
| CN (1) | CN119166920A (zh) |
| WO (1) | WO2024260252A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120255971B (zh) * | 2025-06-06 | 2025-12-05 | 花瓣支付(深圳)有限公司 | 一种交互实现方法和电子设备 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005165873A (ja) * | 2003-12-04 | 2005-06-23 | Masahiro Ito | Web3D画像表示システム |
| CN102254292A (zh) * | 2010-05-20 | 2011-11-23 | 盛乐信息技术(上海)有限公司 | 远程3d指令渲染系统及方法 |
| CN110704136A (zh) * | 2019-09-27 | 2020-01-17 | 北京百度网讯科技有限公司 | 小程序组件的渲染方法、客户端、电子设备及存储介质 |
| CN113791789A (zh) * | 2021-08-13 | 2021-12-14 | 成都中鱼互动科技有限公司 | 一种通用浏览器上检测webgl上下文的方法 |
| CN114371838A (zh) * | 2022-01-10 | 2022-04-19 | 百度在线网络技术(北京)有限公司 | 一种小程序画布渲染方法、装置、设备及存储介质 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9910833B2 (en) * | 2012-11-13 | 2018-03-06 | International Business Machines Corporation | Automatically rendering web and/or hybrid applications natively in parallel |
| CN107832108B (zh) * | 2016-09-14 | 2021-05-07 | 阿里巴巴集团控股有限公司 | 3D canvas网页元素的渲染方法、装置及电子设备 |
| CN112861057B (zh) * | 2021-02-10 | 2024-03-01 | 北京百度网讯科技有限公司 | 基于小程序的页面渲染方法、装置、设备及存储介质 |
-
2023
- 2023-06-19 CN CN202310732158.7A patent/CN119166920A/zh active Pending
-
2024
- 2024-06-04 WO PCT/CN2024/097277 patent/WO2024260252A1/zh not_active Ceased
- 2024-06-04 EP EP24825148.0A patent/EP4645122A4/en active Pending
- 2024-06-04 JP JP2025546965A patent/JP2026510235A/ja active Pending
-
2025
- 2025-09-04 US US19/319,494 patent/US20260004384A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005165873A (ja) * | 2003-12-04 | 2005-06-23 | Masahiro Ito | Web3D画像表示システム |
| CN102254292A (zh) * | 2010-05-20 | 2011-11-23 | 盛乐信息技术(上海)有限公司 | 远程3d指令渲染系统及方法 |
| CN110704136A (zh) * | 2019-09-27 | 2020-01-17 | 北京百度网讯科技有限公司 | 小程序组件的渲染方法、客户端、电子设备及存储介质 |
| CN113791789A (zh) * | 2021-08-13 | 2021-12-14 | 成都中鱼互动科技有限公司 | 一种通用浏览器上检测webgl上下文的方法 |
| CN114371838A (zh) * | 2022-01-10 | 2022-04-19 | 百度在线网络技术(北京)有限公司 | 一种小程序画布渲染方法、装置、设备及存储介质 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4645122A4 * |
Also Published As
| Publication number | Publication date |
|---|---|
| EP4645122A4 (en) | 2026-04-29 |
| EP4645122A1 (en) | 2025-11-05 |
| JP2026510235A (ja) | 2026-04-02 |
| CN119166920A (zh) | 2024-12-20 |
| US20260004384A1 (en) | 2026-01-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20180357085A1 (en) | Method and apparatus for running android application on windows system | |
| US20140053063A1 (en) | User interface control framework for stamping out controls using a declarative template | |
| CN112035172A (zh) | 操作系统启动方法、装置、服务器及存储介质 | |
| US12386599B2 (en) | Page rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product | |
| US20120323950A1 (en) | Embedded query formulation service | |
| CN103179166A (zh) | 在客户端中提供服务的方法和客户端 | |
| CN111625290B (zh) | 一种Android平台下布局文件预加载方法、装置及电子设备 | |
| CN101909082A (zh) | 一种基于模型驱动的网格门户配置系统及配置方法 | |
| CN108319474A (zh) | 一种页面信息生成方法、装置和设备 | |
| US20260004384A1 (en) | Page rendering method | |
| KR101249735B1 (ko) | 범용 운영체제 상에서 안드로이드 어플리케이션을 실행하기 위한 단말장치 및 방법, 그리고 이를 위한 컴퓨터로 판독가능한 기록매체 | |
| CN119011207A (zh) | 一种主应用的集成方法、装置和微前端架构 | |
| CN111984258A (zh) | 页面构建方法和设备 | |
| EP4428675A1 (en) | Cloud technology-based graphic program online development method and system, and related device | |
| CN114911541A (zh) | 配置信息的处理方法、装置、电子设备及存储介质 | |
| US11604662B2 (en) | System and method for accelerating modernization of user interfaces in a computing environment | |
| CN114995847A (zh) | 热更新方法、装置、设备及计算机可读存储介质 | |
| CN112632436B (zh) | 一种网页显示方法、装置、电子设备及存储介质 | |
| CN109960522B (zh) | 一种软件升级方法及装置 | |
| CN118656110A (zh) | 页面配置方法及设备 | |
| CN118642817A (zh) | 资源创建方法、装置、计算机设备、存储介质及程序产品 | |
| CN118001737A (zh) | 一种游戏引擎页面和原生页面的交互方法和装置 | |
| CN116501596A (zh) | 应用程序的测试方法及装置 | |
| CN115268985A (zh) | 一种用于RPC服务的Mock方法、装置及计算机可读存储介质 | |
| CN113590166A (zh) | 应用程序的更新方法、装置以及计算机可读存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24825148 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2024825148 Country of ref document: EP |
|
| ENP | Entry into the national phase |
Ref document number: 2024825148 Country of ref document: EP Effective date: 20250729 |
|
| ENP | Entry into the national phase |
Ref document number: 2024825148 Country of ref document: EP Effective date: 20250729 |
|
| ENP | Entry into the national phase |
Ref document number: 2025546965 Country of ref document: JP Kind code of ref document: A |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2025546965 Country of ref document: JP |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 11202504764U Country of ref document: SG |
|
| WWP | Wipo information: published in national office |
Ref document number: 11202504764U Country of ref document: SG |
|
| WWP | Wipo information: published in national office |
Ref document number: 2024825148 Country of ref document: EP |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |