CN112486620A - Cross-process off-screen rendering method and device, electronic equipment and storage medium - Google Patents

Cross-process off-screen rendering method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112486620A
CN112486620A CN202011409977.0A CN202011409977A CN112486620A CN 112486620 A CN112486620 A CN 112486620A CN 202011409977 A CN202011409977 A CN 202011409977A CN 112486620 A CN112486620 A CN 112486620A
Authority
CN
China
Prior art keywords
view
screen rendering
sub
service
cross
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.)
Pending
Application number
CN202011409977.0A
Other languages
Chinese (zh)
Inventor
欧阳兆贤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202011409977.0A priority Critical patent/CN112486620A/en
Publication of CN112486620A publication Critical patent/CN112486620A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a cross-process off-screen rendering method, a cross-process off-screen rendering device, electronic equipment and a storage medium, wherein the cross-process off-screen rendering comprises the following steps: the method comprises the steps of sending a view file to be rendered and identification information of a view container established in a main process to a sub-process through the main process, calling an off-screen rendering service by the sub-process to perform off-screen rendering on the view file to be rendered to obtain a view corresponding to the view file, sending the view to the view container through an API (application programming interface) by the sub-process through the identification information to display, achieving off-screen rendering in the sub-process and displaying the view obtained by rendering in the sub-process in the main process, reducing the memory pressure of the main process, allocating the memory pressure and the collapse risk, reducing the frequency of OOM (object oriented memory) problems of complex pages in an android system application program, and improving the stability of the complex pages.

Description

Cross-process off-screen rendering method and device, electronic equipment and storage medium
Technical Field
The application relates to the technical field of application of android systems, in particular to a cross-process off-screen rendering method and device, electronic equipment and a storage medium.
Background
With the continuous development of computer technology, functions of an application program APP are more diversified, and a display interface of the current application program tends to be complicated for integrating various functions, such as a complicated first page of a shopping application program or a payment application program on a mobile terminal, and a playing page with a lot of activities in an audio/video application program.
In an Android system, too much system resources are occupied in a complex page, which easily causes an Out Of Memory (Out Of Memory), and the OOM in the Android system means that a program occupies too much Memory, which causes insufficient Memory, and the program cannot continue to run. And because the page is complicated, the integrated service is various, and the integrated service is in the main process and commonly uses the memory. Referring to fig. 1, fig. 1 is a schematic diagram of a corresponding process of each display section of a conventional page, where services including advertisements, categories, recommendations, communities, and popularity, etc., of each display section of the conventional page are all run in a main process. When any one of the services is in a problem, for example, when an advertisement service is in a problem, other services in the main process may be affected, and even the whole application program may be crashed.
Disclosure of Invention
The technical problem mainly solved by the application is to provide a cross-process off-screen rendering method, a cross-process off-screen rendering device, an electronic device and a computer readable storage medium, so that the frequency of OOM (object-oriented modeling) problems of complex pages in an application program of an android system is reduced, and the stability of the complex pages is improved.
In order to solve the above problem, a first aspect of the present application provides a cross-process off-screen rendering method, including: sending the view file to be rendered and the identification information of the view container established in the main process to the sub-process through the main process; calling an off-screen rendering service by using the sub-process to perform off-screen rendering on the view file to be rendered to obtain a view corresponding to the view file; and sending the view to the view container through an API (application programming interface) by using the identification information through the sub-process for displaying.
In order to solve the above problem, a second aspect of the present application provides a cross-process off-screen rendering apparatus, including: the cross-process communication module is used for sending the view file to be rendered and the identification information of the view container established in the main process to the sub-process through the main process; the off-screen rendering module is used for calling an off-screen rendering service by utilizing the subprocess to perform off-screen rendering on the view file to be rendered so as to obtain a view corresponding to the view file; and the display module is used for sending the view to the view container through an API (application programming interface) by utilizing the identification information through the subprocess for displaying.
In order to solve the above problem, a third aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, and the processor is configured to execute program instructions stored in the memory to implement the cross-process off-screen rendering method of the first aspect.
In order to solve the above problem, a fourth aspect of the present application provides a computer-readable storage medium on which program instructions are stored, the program instructions, when executed by a processor, implementing the cross-process off-screen rendering method of the first aspect described above.
The invention has the beneficial effects that: different from the situation in the prior art, according to the cross-process off-screen rendering method provided by the application, the view file to be rendered and the identification information of the view container created in the main process are sent to the sub-process through the main process, off-screen rendering is performed on the view file to be rendered by using the off-screen rendering service called by the sub-process, the view corresponding to the view file is obtained, the view is sent to the view container through the API interface by using the identification information through the sub-process to be displayed, off-screen rendering is performed in the sub-process, the view obtained by rendering in the sub-process is displayed in the main process, the memory pressure of the main process is reduced, the memory pressure and the collapse risk are shared, the frequency of OOM (object oriented mapping) problems of complex pages in an android system application program is reduced, and the stability of the complex pages is improved.
Drawings
FIG. 1 is a diagram illustrating a process corresponding to each display section of a conventional page;
FIG. 2 is a diagram of a specific application scenario of the cross-process off-screen rendering method provided in the present application;
FIG. 3 is a flowchart illustrating an embodiment of a cross-process off-screen rendering method according to the present application;
FIG. 4 is a flowchart illustrating another embodiment of a cross-process off-screen rendering method according to the present application;
FIG. 5 is a flowchart illustrating an embodiment of a cross-process off-screen rendering method according to the present application;
FIG. 6 is a timing diagram of the corresponding embodiment of FIG. 5;
FIG. 7 is a block diagram of an embodiment of a cross-process off-screen rendering apparatus according to the present application;
FIG. 8 is a block diagram of an embodiment of an electronic device of the present application;
FIG. 9 is a block diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The following describes in detail the embodiments of the present application with reference to the drawings attached hereto.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, interfaces, techniques, etc. in order to provide a thorough understanding of the present application.
The terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship. Further, the term "plurality" herein means two or more than two.
Currently, mainstream operating systems of mobile terminals include an iOS system developed by apple and an Android system developed by Google, the technical processing of application programs is different due to different systems, and the cross-process off-screen rendering method provided by the application is suitable for the Android system. In the Android system, Activity is an application component, provides a screen, and a user can interact with the screen provided by the user to perform a certain task, such as making a call, taking a picture, viewing a map or displaying video content, and the like, and can also monitor and process an event of the user to respond.
Because each version of the traditional complex page runs in the main process, each version influences each other and can cause the OOM problem because the main process occupies too large running memory, the application provides a cross-process ion screen rendering service.
Referring to fig. 2 and fig. 3, fig. 2 is a schematic view of a specific application scenario of the cross-process off-screen rendering method provided in the present application, and fig. 3 is a schematic flow diagram of an embodiment of the cross-process off-screen rendering method provided in the present application.
Due to the development of hardware technology, the hardware configuration of the mobile terminal is higher and higher at present, and the method can support the running of multiple processes. The embodiment is applied to many scenes, such as a shopping application program on the mobile terminal and a complicated home page of a payment platform application program, a live broadcast page with a lot of activities in an application program of an audio and video playing platform, and the like. Taking a home page with numerous activities in shopping APP as an example, the main interface container in fig. 2 belongs to a main process, and services corresponding to each plate, such as advertisements, categories, recommendations, communities, popularity, and the like, are all run in sub-processes, such as advertisements run in an advertisement process and categories run in a category process. The main process manages each sub-process. The cross-process off-screen rendering method can be used for running off-screen rendering operation which is required to be run in a main process originally in a complex page in a sub-process through cross-process communication, for example, the advertisement process is required to be subjected to off-screen rendering, the off-screen rendering operation can be carried out in the main process without being carried out like the traditional page, but the off-screen rendering service is run in the advertisement process through cross-process communication, then the advertisement process displays a view in the sub-process in the main process, and finally cross-process off-screen rendering is achieved.
Specifically, the method may include the steps of:
step S31: and sending the view file to be rendered and the identification information of the view container created in the main process to the sub-process through the main process.
And creating a corresponding view container according to the view file to be rendered in the main process, and sending the view file to be rendered and the identification information of the view container, namely the ID of the view container, to the sub-process through the main process. Specifically, the view file to be rendered and the ID of the created view container may be transmitted to the sub-process through the display assistant presentationheppler tool. The PresentationHelper is a tool class, is convenient to call, and provides convenient off-screen rendering service.
Step S32: and calling an off-screen rendering service by using the subprocess to perform off-screen rendering on the view file to be rendered, so as to obtain the view corresponding to the view file.
And the called off-screen rendering service is operated in the subprocess, the off-screen rendering service can also be called an off-screen rendering process, the off-screen rendering service operated in the subprocess performs off-screen rendering according to the view file to be rendered, and a view corresponding to the view file is created and obtained. Specifically, the off-screen rendering service may be an HPService, and a process that needs to use off-screen rendering may start the HPService in advance, so that the HPService runs in advance and serves as a carrier for off-screen rendering. When the service really uses off-screen rendering, the HPService needs to construct a related view, and also includes parameters such as a view resource ID and a related callback.
Step S33: and sending the view to the view container for displaying through the API by using the identification information through the sub-process.
The child process sends the view to the view container through the API interface for display, that is, the view is displayed in the created corresponding container of the host process through the child process, through the identification information of the view container, also called the view container ID, provided by the host process. Specifically, the view is sent to the view container for displaying through an API interface for multi-screen display in the android system, for example, the view may be Presentation in the android system, where the Presentation is an API interface in the android system that provides the capability of displaying on the sub-screen.
In a specific implementation scenario, with reference to fig. 2, a user clicks a display area corresponding to an advertisement process, and needs to display an advertisement, that is, needs to perform off-screen rendering. After the main interface container receives the trigger information, a corresponding advertisement display view container is established in the main process, wherein the advertisement display view container comprises information such as the size and the position of the display container, a view file of a corresponding advertisement to be rendered and the ID of the view container established in the main process are sent to the advertisement process through the main process, off-screen rendering services are called, the off-screen rendering services operated in the advertisement process perform off-screen rendering on the view file to be rendered to obtain a view corresponding to the view file, and then the view is transmitted to the container through the API interface of Presentation by the advertisement process through the ID of the view container, and is displayed in the container, so that the view is displayed in the main process.
According to the cross-process off-screen rendering method provided by the embodiment, the view file to be rendered and the identification information of the view container established in the main process are sent to the sub-process through the main process, off-screen rendering is performed on the view file to be rendered by using an off-screen rendering service called by the sub-process, a view corresponding to the view file is obtained, the view is sent to the view container through the API (application programming interface) interface by using the identification information through the sub-process for displaying, off-screen rendering is performed in the sub-process, the view obtained by rendering in the sub-process is displayed in the main process, the memory pressure of the main process is reduced, the memory pressure and the collapse risk are shared, the frequency of OOM (object oriented mapping) problems of complex pages in an android system application program is reduced, and the stability of the complex pages.
Referring to fig. 4, fig. 4 is a flowchart illustrating a cross-process off-screen rendering method according to another embodiment of the present application. Specifically, the method may include the steps of:
step S41: and binding the sub-process with a service manager in the main process.
The main process has a Service named Manager, namely a Service Manager, which is responsible for managing all services and providing a Service for acquiring a Service proxy object to the Client component, and the Service Manager can have functions including storage, search, keep-alive Service and the like. There is a service named Messenger, namely a Messenger service, in all processes. The Messenger service Messenger mainly functions to communicate with the service Manager in the main process. The Messenger service Messenger of the sub-process is bound with the service Manager in the main process to realize the binding of the sub-process and the service Manager in the main process, and after the sub-process and the main process are bound with each other, the sub-process and the main process can carry out two-way communication with the service Manager through the Messenger service Messenger, such as sending a request, receiving a response, executing inter-process communication (IPC) and the like.
Typically, the service Manager is started when the system is powered on. Specifically, the initiation of the service manager may be initiated by the init process parsing the init.rc file and calling the main () method entry in service _ manager.c when the system is booted.
The Service generally has two starting modes: the start service and the bind service may both be the same. When a Service is started (startService) and bound (bindService), the Service will always run in the background. The Messenger service Messenger in the application can only bind, and can also start the service and bind the service so as to realize running in the background all the time and support the cross-process communication between the main process and the sub-process.
Step S42: and registering the sub-process and the off-screen rendering service into the service manager through the registration interface.
Before off-screen rendering is used, the off-screen rendering service can be started in advance, and is registered in a service Manager of a main process through a registration interface, so that the off-screen rendering service is called conveniently between processes just like calling the interface.
Step S43: and in response to receiving a demand instruction for using the off-screen rendering service, calling the off-screen rendering service to enable the off-screen rendering service to run in the sub-process.
After a demand instruction for using the off-screen rendering service is received, the off-screen rendering service is called by the system through an interface in a service Manager (Manager) registered in the main process by the off-screen rendering service, and the off-screen rendering service runs in the sub-process, so that the risk of OOM (out of order) caused by excessive system resource occupation of the main process is reduced.
Step S44: and sending the view file to be rendered and the identification information of the view container created in the main process to the sub-process through the main process.
This step is the same as the step S31, and please refer to fig. 3 and the related text description of step S31 for details, which are not described herein again.
Step S45: and calling an off-screen rendering service by using the subprocess to perform off-screen rendering on the view file to be rendered, so as to obtain the view corresponding to the view file.
This step is the same as the step S32, and please refer to fig. 3 and the related text description of step S32 for details, which are not described herein again.
Step S46: and sending the view to the view container for displaying through the API by using the identification information through the sub-process.
This step is the same as the step S33, and please refer to fig. 3 and the related text description of step S33 for details, which are not described herein again.
The cross-process off-screen rendering method provided by this embodiment supports cross-process communication between the sub-process and the main process by binding the messenger service in the sub-process with the service manager in the main process. Service components such as off-screen rendering services are registered in a service Manager of the main process through a registration interface, cross-process calling services can be carried out, the inter-process calling services are convenient and fast like calling interfaces, and the realization of the quick cross-process off-screen rendering services is supported. The method comprises the steps of sending identification information of a view file to be rendered and a view container established in a main process to a sub-process, utilizing the sub-process to call an off-screen rendering service to conduct off-screen rendering on the view file to be rendered to obtain a view corresponding to the view file, utilizing the identification information to send the view to the view container through an API (application programming interface) through the sub-process to be displayed, achieving the purposes of conducting off-screen rendering in the sub-process and displaying the view obtained through rendering in the sub-process in the main process, reducing the memory pressure of the main process, sharing the memory pressure and the collapse risk, reducing the frequency of OOM (object oriented memory) problems of complex pages in an android system application program and improving the stability of the complex pages.
Referring to fig. 5 and fig. 6, fig. 5 is a schematic flowchart of an embodiment of a cross-process off-screen rendering method according to the present application, and fig. 6 is a timing diagram of the embodiment corresponding to fig. 5, which specifically includes the following steps:
step S51: and calling an init method in the Servicehelper through the sub-process, starting the Messenger service Messenger, and binding the Messenger service Messenger to a service Manager of the main process.
Before the off-screen rendering service is used, each process using the off-screen rendering service calls an init method in the ServiceHelper, starts Messenger, and binds Messenger to Manager. The cross-process off-screen rendering needs to be based on cross-process communication, and needs each sub-process to be capable of communicating with the main process, and the sub-processes are bound with the Manager through the Messenger, so that the two-way communication between the sub-processes and the main process can be supported. Specifically, when the program is started, the Messenger of the sub-process can be started and bound, so that the Messenger service Messenger always runs in the background, and the sub-process is supported to communicate with the main process in real time.
The service Manager is started when the system is started. Specifically, the initiation of the service manager may be initiated by the init process parsing the init.rc file and calling the main () method entry in service _ manager.c when the system is booted.
Step S52: and registering the interface of the HPservice into the Manager by calling a register interface in the Servicehelper to obtain the AIDL interface of the HPservice.
The service is to be used, and information related to the externally provided service, such as address information or interface information, is required to enable the client to discover the service, so as to obtain the service. Each service can register in the Manager of the host process by calling the register interface. After receiving the relevant trigger event and before the off-screen rendering is required, the off-screen rendering service HPService is registered in a service Manager in the main process through an AIDL interface, and then all processes can obtain the off-screen rendering service through AIDL interface names corresponding to the off-screen rendering service HPService, so that the cross-process calling of the off-screen rendering service is simple and convenient. The service assistant ServiceHelper saves the interfaces of all the services in the sub-process. The aid interface definition language is an interface definition language provided by android, and is used for defining specifications used by an inter-process communication interface in an android system. By aid of AIDL, a convenient IPC communication mechanism can be realized, and interfaces can be flexibly defined according to requirements.
Step S53: in response to receiving a demand instruction for using the off-screen rendering service, calling and starting HPservice through the AIDL interface name as a carrier of off-screen rendering.
In response to receiving a demand instruction for using the off-screen rendering service, sending a request for obtaining the service to a service Manager through cross-process communication, specifically, sending the request for obtaining the off-screen rendering service to the Manager of the main process through a getService function by a client, sending AIDL interface information corresponding to HPservice to the client by the Manager through Messenger in a sub-process, and calling the HPservice by the client through the AIDL interface name corresponding to the HPservice to serve as a carrier of off-screen rendering.
Step S54: and creating a related view container on the page activity, and sending the view file to be rendered and the ID of the view container created in the main process to the sub-process through a display assistant presentationHeapler tool.
The PresentationHelper is a tool class, provides convenient off-screen rendering service, and is convenient to call. The PresentationHelper runs in the main process, and further, the interface information of the HPservice running in the sub-process can be acquired by calling a getPresence function, so that the connection between the PresentationHelper and the HPservice is realized, and the transmission of the information in the rendering process is conveniently supported.
Step S55: and performing off-screen rendering on the view file to be rendered by the HPService in the sub-process to obtain a view corresponding to the view file.
Step S56: and sending the view to the view container for displaying through the API interface of the Presentation by the sub-process by utilizing the ID of the view container.
According to the cross-process off-screen rendering method provided by the embodiment, the init method in the ServiceHelper is called through the sub-process, the Messenger service Messenger is started, and the Messenger service Messenger is bound to the service Manager of the main process, so that cross-process communication between the sub-process and the main process is supported. The method comprises the steps of registering an interface of the HPService into a Manager by calling a register interface in the Servicehelper to obtain an AIDL interface of the HPService, and conveniently calling the off-screen rendering service HPService in a cross-process mode through interface information. The method comprises the steps of sending a view file to be rendered and identification information of a view container created in a main process to a sub-process, utilizing the sub-process to call an off-screen rendering service to perform off-screen rendering on the view file to be rendered to obtain a view corresponding to the view file, sending the view to the view container through an API (application programming interface) of Presentation by utilizing an ID (identity) of the view container through the sub-process to display, achieving off-screen rendering in the sub-process and displaying the view obtained by rendering in the sub-process in the main process, reducing the memory pressure of the main process, allocating the memory pressure and the collapse risk, reducing the frequency of OOM (object oriented modeling) problems of complex pages in an android system application program, and improving the stability of the complex pages.
Referring to fig. 7, fig. 7 is a block diagram illustrating an embodiment of a cross-process off-screen rendering apparatus according to the present application. The cross-process off-screen rendering apparatus 70 includes: a cross-process communication module 71, configured to send, by the host process, the view file to be rendered and the identification information of the view container created in the host process to the child process; the off-screen rendering module 72 is configured to perform off-screen rendering on the view file to be rendered by using a sub-process to call an off-screen rendering service, so as to obtain a view corresponding to the view file; and the display module 73 is used for sending the view to the view container through the API by using the identification information through the sub-process for displaying.
Further, the cross-process communication module 71 can be further configured to, in response to receiving a demand instruction for using the off-screen rendering service, invoke the off-screen rendering service, so that the off-screen rendering service runs in the sub-process, and is configured to bind the sub-process with the service manager in the main process, and specifically, may be configured to bind the Messenger service Messenger of the sub-process with the service manager in the main process, so as to bind the sub-process with the service manager in the main process. The cross-process communication module 71 can also be used to register sub-processes as well as off-screen rendering services into the service manager through the registration interface.
Further, the display module 73 is further configured to send, by using the identification information through the sub-process, the view to the view container through the API interface of the android system for multi-screen display to be displayed. Specifically, the display module 73 is further configured to send the view file to be rendered and the identification information of the created view container to the sub-process through the display assistant presentationheart tool.
In the above scheme, the cross-process communication module 71 sends the view file to be rendered and the identification information of the view container created in the main process to the sub-process through the main process; the off-screen rendering module 72 uses a sub-process to call an off-screen rendering service to perform off-screen rendering on the view file to be rendered, so as to obtain a view corresponding to the view file; the display module 73 sends the view to the view container through the API interface by using the identification information through the sub-process to display, so as to perform off-screen rendering in the sub-process and display the view obtained by rendering in the sub-process in the main process, reduce the memory pressure of the main process, share the memory pressure and the crash risk, reduce the frequency of OOM problem of a complex page in an application program of the android system, and improve the stability of the complex page.
Referring to fig. 8, fig. 8 is a schematic frame diagram of an embodiment of an electronic device according to the present application. The electronic device 80 comprises a memory 81 and a processor 82 coupled to each other, the processor 82 being configured to execute program instructions stored in the memory 81 to implement the steps of any of the above-described embodiments of the cross-process off-screen rendering method. In one particular implementation scenario, the electronic device 80 may include, but is not limited to: microcomputer, server.
In particular, the processor 82 is configured to control itself and the memory 81 to implement the steps of any of the above-described embodiments of the graph data partitioning method. The processor 82 may also be referred to as a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip having signal processing capabilities. The Processor 82 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 82 may be collectively implemented by an integrated circuit chip.
According to the scheme, the processor 82 sends the view file to be rendered and the identification information of the view container created in the main process to the sub-process through the main process, the sub-process calls an off-screen rendering service to perform off-screen rendering on the view file to be rendered to obtain the view corresponding to the view file, the sub-process sends the view to the view container through the API interface by using the identification information to display, off-screen rendering in the sub-process is achieved, the view obtained by rendering in the sub-process is displayed in the main process, the memory pressure of the main process is reduced, the memory pressure and the collapse risk are shared, the frequency of OOM problems of complex pages in an android system application program is reduced, and the stability of the complex pages is improved.
Referring to fig. 8, fig. 8 is a block diagram illustrating an embodiment of a computer-readable storage medium according to the present application. The computer readable storage medium 90 stores program instructions 900 capable of being executed by a processor, the program instructions 900 being for implementing the steps of any of the cross-process off-screen rendering method embodiments described above.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely one type of logical division, and an actual implementation may have another division, for example, a unit or a component may be combined or integrated with another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on network elements. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (10)

1. A cross-process off-screen rendering method is applicable to an android system, and comprises the following steps:
sending a view file to be rendered and identification information of a view container created in a main process to a sub-process through the main process;
calling an off-screen rendering service by utilizing the subprocess to perform off-screen rendering on the view file to be rendered to obtain a view corresponding to the view file;
and sending the view to the view container through an API (application programming interface) by using the identification information through the sub-process for displaying.
2. The cross-process off-screen rendering method according to claim 1, wherein before the step of sending, by the host process, the view file to be rendered and the identification information of the view container created in the host process to the sub-process, the method further comprises:
and in response to receiving a demand instruction for using the off-screen rendering service, calling the off-screen rendering service to run the off-screen rendering service in the sub-process.
3. The cross-process off-screen rendering method of claim 1, wherein the step of sending the view to the view container for display by the sub-process through an API interface using the identification information comprises:
and sending the view to the view container for displaying through an API (application programming interface) of the android system for multi-screen display by utilizing the identification information through the sub-process.
4. The cross-process off-screen rendering method according to any one of claims 1 to 3, wherein before the step of sending the view file to be rendered and the identification information of the view container created in the main process to the sub-process by the main process, the method further comprises:
and binding the sub-process with a service manager in the main process.
5. The cross-process off-screen rendering method of claim 4, wherein the step of binding the sub-process with a service manager in the main process comprises:
and binding the Messenger service Messenger of the sub-process with the service manager in the main process so as to realize the binding of the sub-process with the service manager in the main process.
6. The cross-process off-screen rendering method of claim 4, wherein before the step of sending the view file to be rendered and the identification information of the view container created in the main process to the sub-process, the method further comprises:
registering the sub-process and the off-screen rendering service into the service manager through a registration interface.
7. The cross-process off-screen rendering method according to any one of claims 1 to 3, wherein the step of sending, by the main process, the view file to be rendered and the identification information of the view container created in the main process to the sub-process comprises:
and sending the view file to be rendered and the identification information of the created view container to the sub-process by the display assistant presentationheart tool.
8. A cross-process off-screen rendering apparatus, comprising:
the cross-process communication module is used for sending the view file to be rendered and the identification information of the view container established in the main process to the sub-process through the main process;
the off-screen rendering module is used for calling an off-screen rendering service by utilizing the subprocess to perform off-screen rendering on the view file to be rendered so as to obtain a view corresponding to the view file;
and the display module is used for sending the view to the view container through an API (application programming interface) by utilizing the identification information through the subprocess for displaying.
9. An electronic device comprising a memory and a processor coupled to each other, the processor being configured to execute program instructions stored in the memory to implement the cross-process off-screen rendering method of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon program instructions which, when executed by a processor, implement the cross-process off-screen rendering method of any of claims 1 to 7.
CN202011409977.0A 2020-12-03 2020-12-03 Cross-process off-screen rendering method and device, electronic equipment and storage medium Pending CN112486620A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011409977.0A CN112486620A (en) 2020-12-03 2020-12-03 Cross-process off-screen rendering method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011409977.0A CN112486620A (en) 2020-12-03 2020-12-03 Cross-process off-screen rendering method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112486620A true CN112486620A (en) 2021-03-12

Family

ID=74939452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011409977.0A Pending CN112486620A (en) 2020-12-03 2020-12-03 Cross-process off-screen rendering method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112486620A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032080A (en) * 2021-03-31 2021-06-25 广州虎牙科技有限公司 Page implementation method, application program, electronic device and storage medium
CN113641929A (en) * 2021-08-12 2021-11-12 百度在线网络技术(北京)有限公司 Page rendering method and device, electronic equipment and computer-readable storage medium
CN115052186A (en) * 2022-07-12 2022-09-13 北京字跳网络技术有限公司 Screen projection method and related equipment
WO2023040459A1 (en) * 2021-09-17 2023-03-23 北京字节跳动网络技术有限公司 Graphics rendering method and apparatus, electronic device, and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9614900B1 (en) * 2014-06-19 2017-04-04 Amazon Technologies, Inc. Multi-process architecture for a split browser
WO2017088484A1 (en) * 2015-11-24 2017-06-01 成都赫尔墨斯科技有限公司 Cloud computing based real-time off-screen rendering method, apparatus and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9614900B1 (en) * 2014-06-19 2017-04-04 Amazon Technologies, Inc. Multi-process architecture for a split browser
WO2017088484A1 (en) * 2015-11-24 2017-06-01 成都赫尔墨斯科技有限公司 Cloud computing based real-time off-screen rendering method, apparatus and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032080A (en) * 2021-03-31 2021-06-25 广州虎牙科技有限公司 Page implementation method, application program, electronic device and storage medium
CN113641929A (en) * 2021-08-12 2021-11-12 百度在线网络技术(北京)有限公司 Page rendering method and device, electronic equipment and computer-readable storage medium
CN113641929B (en) * 2021-08-12 2023-08-29 百度在线网络技术(北京)有限公司 Page rendering method, device, electronic equipment and computer readable storage medium
WO2023040459A1 (en) * 2021-09-17 2023-03-23 北京字节跳动网络技术有限公司 Graphics rendering method and apparatus, electronic device, and storage medium
CN115052186A (en) * 2022-07-12 2022-09-13 北京字跳网络技术有限公司 Screen projection method and related equipment
CN115052186B (en) * 2022-07-12 2023-09-15 北京字跳网络技术有限公司 Screen projection method and related equipment

Similar Documents

Publication Publication Date Title
US11513820B2 (en) Method for resource allocation, terminal, and computer-readable storage medium
US10065119B2 (en) Game accessing method and processing method, server, terminal, and system
CN112486620A (en) Cross-process off-screen rendering method and device, electronic equipment and storage medium
US20200204513A1 (en) Message Display Method, Terminal, and Storage Medium
CN113497945B (en) Live broadcast and configuration method based on cloud mobile phone and related device and system
CN112260853B (en) Disaster recovery switching method and device, storage medium and electronic equipment
CN113568699B (en) Content display method, device, equipment and storage medium
CN113784049B (en) Camera calling method of android system virtual machine, electronic equipment and storage medium
CN112437318A (en) Content display method, device and system and storage medium
CN111831947B (en) Application system, data processing method, computer system and storage medium
CN113032080A (en) Page implementation method, application program, electronic device and storage medium
CN113672405A (en) Data interaction system and page display method based on data interaction system
CN113242308A (en) Information pushing method, device, equipment and storage medium
EP2804406A1 (en) Real Time Bidding System For Applications
CN113727129B (en) Live interaction method, device, system, equipment and storage medium
CN110572815A (en) Network access method, device, storage medium and terminal
CN105025320B (en) Operable desktop system with hybrid architecture and implementation method thereof
CN114222003A (en) Service calling method, system, device, equipment and storage medium
CN108289056B (en) Method and device for sharing dynamic chart and computing equipment
CN115237481A (en) Method, device and equipment for driving external equipment and storage medium
CN114726905B (en) Method, device, equipment and storage medium for accessing Tbox network into Android system
CN114385124A (en) Independent page jumping method, device and equipment based on Vue framework
CN110300321B (en) Banner display method and device
CN113961377A (en) Cross-application service method and device, electronic equipment and storage medium
CN111475240A (en) Data processing method and system

Legal Events

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