Rendering process distribution method and device, computer readable storage medium and computer equipment
By receiving webpage feature information to determine the shared identifier and matching the process identifier, the problem of poor rendering process stability is solved, and the flexible allocation and stability improvement of the rendering process are realized.
Patent Information
- Application Number
- CN202410572253.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2025-11-11
AI Technical Summary
In existing technologies, rendering processes are unstable when processing web page data, which can easily lead to process crashes. Furthermore, resource consumption is unknown, and the methods for limiting the amount of web page data that a single rendering process can process are not flexible enough.
By receiving the characteristic information of the webpage, a shared identifier is determined, and the corresponding rendering process identifier is matched based on the process identifier table, so as to realize the flexible allocation and control of the rendering process, avoid process locking, and improve the stability of the rendering process.
It improves the stability of the rendering process, reduces the probability of failure, and enables flexible management and optimized resource allocation of the rendering process.
Smart Images

Figure CN120929231A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and specifically to a rendering process allocation method, apparatus, computer-readable storage medium, and computer device. Background Technology
[0002] Browsers display web pages, making it easier for people to access the information presented on the web pages. The process of displaying web pages is complex. In this process, the rendering process can perform various processing on the web page data. The memory resources allocated to the rendering process by the computer device are fixed. Usually, a rendering process can process multiple web page data, resulting in the display of multiple web page contents. However, the resource consumption of the rendering process for processing a single web page data is unknown. The current technology that limits the amount of web page data that a single rendering process can process easily lead to process crashes and other failures during the processing of web page data, resulting in poor stability of the rendering process. Summary of the Invention
[0003] This application provides a rendering process allocation method, apparatus, computer-readable storage medium, and computer device, which can improve the operational stability of the rendering process.
[0004] This application provides a rendering process allocation method, including:
[0005] Receive the feature information of the first webpage;
[0006] If the feature information includes the target keyword, determine the first shared identifier corresponding to the first webpage;
[0007] Obtain the process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier;
[0008] Based on the process identifier table, determine the first process identifier corresponding to the first shared identifier. The first process identifier is used to identify the first rendering process.
[0009] The first webpage is rendered using the first rendering process to load the first webpage in the user interface.
[0010] Accordingly, this application provides a rendering process allocation device, comprising:
[0011] The receiving module is used to receive the feature information of the first webpage;
[0012] The determination module is used to determine the first shared identifier corresponding to the first webpage if the feature information includes the target keyword.
[0013] The acquisition module is used to acquire the process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier.
[0014] The identification module is used to determine the first process identifier corresponding to the first shared identifier based on the process identifier table. The first process identifier is used to identify the first rendering process.
[0015] The rendering module is used to render the first webpage through the first rendering process so that the first webpage can be loaded in the user interface.
[0016] In some embodiments of this application, the identification module includes a determination submodule and a creation submodule, wherein,
[0017] The determination submodule is used to determine the preset process identifier corresponding to the preset shared identifier as the first process identifier if the process identifier table contains a preset shared identifier that is the same as the first shared identifier.
[0018] Create a submodule to create a first process identifier corresponding to the first shared identifier if the process identifier table does not exist in the preset shared identifier that is the same as the first shared identifier.
[0019] In some embodiments of this application, the rendering process allocation device further includes a storage module, wherein,
[0020] The storage module is used to save the correspondence between the first shared identifier and the first process identifier to the process identifier table.
[0021] In some embodiments of this application, the rendering process allocation device further includes a release module, wherein,
[0022] The release module is used to release the first process lock if the first rendering process corresponds to the first process lock, so that any webpage corresponding to the first shared identifier can be loaded through the first rendering process.
[0023] In some embodiments of this application, the determining submodule may be specifically used for:
[0024] If the process identifier table contains a preset shared identifier that is the same as the first shared identifier, the preset process identifier corresponding to the preset shared identifier is determined to be the initial process identifier.
[0025] Obtain the process domain name table, which includes multiple process identifiers and at least one domain name corresponding to each process identifier;
[0026] Get the first domain name of the first webpage;
[0027] If there is a correspondence between the first domain name and the initial process identifier in the process domain name table, the initial process identifier is determined to be the first process identifier.
[0028] In some embodiments of this application, the determining module may be specifically used for:
[0029] If the feature information includes the target keyword, obtain the keyword identifier table. The keyword identifier table includes multiple keywords and a preset shared identifier corresponding to the keyword.
[0030] Find the first shared identifier corresponding to the target keyword from the keyword identifier table.
[0031] In some embodiments of this application, the determining module may be specifically used for:
[0032] If the feature information includes the target keyword, the target keyword is determined to be the first shared identifier corresponding to the first webpage.
[0033] Accordingly, this application also provides a computer device, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the steps in the rendering process allocation method provided in this application.
[0034] Accordingly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps in the rendering process allocation method provided in embodiments of this application.
[0035] Accordingly, embodiments of this application also provide a computer program product, including a computer program or instructions, which are executed by a processor to implement the steps in the rendering process allocation method provided in embodiments of this application.
[0036] This application embodiment can receive feature information of a first webpage, and if the feature information includes target keywords, determine a first shared identifier corresponding to the first webpage. The process identifier table includes at least one preset shared identifier and a process identifier of the rendering process corresponding to the preset shared identifier. This application embodiment can determine the first process identifier of the first rendering process corresponding to the first shared identifier based on the process identifier table, and then render the first webpage through the first rendering process, so that the first webpage can finally be loaded in the user interface. Therefore, the webpage corresponding to the shared identifier can be flexibly set, and the webpage corresponding to the rendering process can also be controlled under the function of the process identifier table, thereby reducing the probability of rendering process failure and improving the running stability of the rendering process. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a schematic diagram of a scenario illustrating the rendering process allocation method provided in an embodiment of this application;
[0039] Figure 2 This is a flowchart illustrating the rendering process allocation method provided in an embodiment of this application;
[0040] Figure 3 This is another flowchart illustrating the rendering process allocation method provided in the embodiments of this application;
[0041] Figure 4 This is a schematic diagram of the rendering process allocation device provided in the embodiments of this application;
[0042] Figure 5 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation
[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0044] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0045] It is understood that in some embodiments of this application, data such as user information are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0046] This application provides a rendering process allocation method, apparatus, computer-readable storage medium, and computer device. The rendering process allocation apparatus can be integrated into a rendering process allocation system, and the rendering process allocation system can be integrated into at least one computer device, which may include at least one of a terminal and a server.
[0047] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not restricted herein.
[0048] See Figure 1 The rendering process allocation system can be integrated into the browser of a computer device. The rendering process allocation system can receive the feature information of the first webpage; if the feature information includes target keywords, determine the first shared identifier corresponding to the first webpage; obtain a process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier; based on the process identifier table, determine the first process identifier corresponding to the first shared identifier, which is used to identify the first rendering process; render the first webpage through the first rendering process to load the first webpage in the user interface.
[0049] Figure 1 This is an example of an application scenario for the rendering process allocation system of this application. It is mainly used to introduce, and not to limit, the rendering process allocation system of this application. In the actual application of the technical solutions described in the embodiments of this application, the computer devices included in the rendering process allocation system and the steps performed by each computer device can be flexibly adjusted, and it is not limited to... Figure 1 The content described in the text.
[0050] The rendering process allocation method of this application will be further described below with reference to embodiments. It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments. The rendering process allocation method can be integrated into a rendering process allocation device, and the rendering process allocation device can be integrated into a rendering process allocation system. Figure 2 A flowchart illustrating the rendering process allocation method of this application is shown, as follows: Figure 2 The methods for allocating rendering processes can include:
[0051] 110. Receive the feature information of the first webpage.
[0052] The feature information can include information that reflects the characteristics of a webpage, such as the Uniform Resource Locator (URL), IP address, and webpage code of the first webpage. This feature information can be received from domain name servers, business servers, network devices, etc.
[0053] 120. If the feature information includes the target keyword, determine the first shared identifier corresponding to the first webpage.
[0054] The target keyword is used to determine the shared identifier corresponding to the webpage. The target keyword can be in string form and may include information set by the developer within the feature information specifically for determining the shared identifier corresponding to the webpage. For example, the target keyword may be added to the webpage code. The target keyword may also include existing content in the feature information, which is used in existing solutions to implement related functions. For example, the feature information may include information identifying the webpage type / webpage display content type; this information is the target keyword in this embodiment. The shared identifier can be used to identify several webpages that will share the same rendering process, and the shared identifier can be in string form.
[0055] In some embodiments of this application, all web pages with a certain target keyword will be assigned to the same rendering process. In this case, the target keyword can be used as a shared identifier. That is, after determining that the feature information includes the target keyword, the target keyword is determined as the first shared identifier of the first web page.
[0056] For example, receive the webpage code of webpage 1, traverse the webpage code to determine the target keyword, and identify the target keyword as the shared identifier of webpage 1.
[0057] In some embodiments of this application, web pages with different target keywords are assigned to the same rendering process. In this case, a keyword identifier table can be preset and obtained. The keyword identifier table may include multiple keywords and preset shared identifiers corresponding to the keywords. The correspondence between the preset shared identifiers and keywords can be one-to-one, one-to-many, etc. At this time, after determining the target keyword in the feature information, the first shared identifier corresponding to the target keyword can be queried in the keyword identifier table.
[0058] For example, after receiving the Uniform Resource Locator (URL) of webpage 2 and determining that it includes target keyword 2, the preset shared identifier 2 corresponding to target keyword 2 can be found in the keyword identifier table. This preset shared identifier 2 is the shared identifier of webpage 2.
[0059] 130. Obtain the process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier.
[0060] The process identifier table can include the correspondence between shared identifiers and process identifiers. A process identifier can include information that uniquely identifies a rendering process. A rendering process can include a type of process in the browser used to handle webpage rendering and interaction. The correspondence between shared identifiers and process identifiers in the process identifier table...
[0061] The process identification table can be pre-stored locally on the computer device, or it can be retrieved by sending a request to other computer devices.
[0062] 140. Based on the process identifier table, determine the first process identifier corresponding to the first shared identifier. The first process identifier is used to identify the first rendering process.
[0063] Specifically, there are several ways to determine the process identifier corresponding to the shared identifier based on the process identifier table. For example, the first process identifier corresponding to the first shared identifier can be found from the process identifier table.
[0064] In some embodiments of this application, if no process identifier corresponding to the first shared identifier is found in the process identifier table, that is, if no process identifier corresponding to the first shared identifier exists in the process identifier table, a first process identifier can be created, and the correspondence between the first process identifier and the first shared identifier can be determined and saved to the process identifier table. Then, subsequently, the first process identifier corresponding to other web pages with the first shared identifier can be directly searched from the process identifier table.
[0065] In some embodiments of this application, other information introduced into the first webpage can also be used. The other information and the feature information together determine the first process identifier corresponding to the first webpage. Specifically, the other information may be such as the domain name of the webpage. The first domain name of the first webpage and the process domain name table can be obtained. The process domain name table includes multiple process identifiers and the domain names corresponding to the process identifiers. Here, the correspondence between the process identifiers and the domain names can be one-to-one, one-to-many, many-to-one, etc.
[0066] The execution process here may include: firstly, querying the process identifier table to find the initial process identifier corresponding to the first shared identifier, and then querying the process domain name table to find whether there is a correspondence between the initial process identifier and the first domain name of the first webpage. If there is a correspondence, the initial process identifier is determined to be the first process identifier.
[0067] For example, query the process identifier table to find the initial process identifier A corresponding to the shared identifier of webpage 2, and query the process domain name table to find whether the process identifier corresponding to the domain name of webpage 2 is the initial process identifier A. If so, determine that webpage 2 corresponds to process identifier A.
[0068] If there is no direct correspondence between the initial process identifier in the process domain table and the first domain of the first webpage, the candidate process identifier corresponding to the first domain can be queried from the process domain table. Based on the current status of the initial process identified by the initial process identifier and the candidate processes identified by the candidate process identifiers, the first process identifier corresponding to the first webpage is determined from the two process identifiers. The current status of the process can be quantified by factors such as resource utilization and process state. The identifier of the process with the better current status is selected as the first process identifier from the initial process and candidate processes. For example, the identifier of the process with lower resource utilization can be selected as the first process identifier, or the identifier of the process with a better process state can be selected as the first process identifier, and so on.
[0069] For example, query the process identifier table to find the initial process identifier A corresponding to the shared identifier of webpage 2, query the process domain name table to find the candidate process identifier B corresponding to the domain name of webpage 2, and determine the process identifier B corresponding to the process with lower resource utilization rate B based on the resource utilization rate of process A and process B.
[0070] 150. Render the first webpage through the first rendering process to load the first webpage in the user interface.
[0071] For example, process B performs a series of processes such as parsing the code of webpage 2, enabling the browser user interface to display webpage 2.
[0072] In related technologies, after the rendering process processes the code data of a webpage (corresponding to a domain name), it will restrict the rendering process to only process the code data of the webpage corresponding to the domain name through a process lock. However, the webpages identified by the shared identifier in this application may correspond to the same domain name or different domain names. Therefore, this application can release the process lock of the rendering process, so that all webpages whose shared identifier corresponds to the rendering process can be processed by the rendering process.
[0073] This application embodiment can receive feature information of a first webpage, and if the feature information includes target keywords, determine a first shared identifier corresponding to the first webpage. The process identifier table includes at least one preset shared identifier and a process identifier of the rendering process corresponding to the preset shared identifier. This application embodiment can determine the first process identifier of the first rendering process corresponding to the first shared identifier based on the process identifier table, and then render the first webpage through the first rendering process, so that the first webpage can finally be loaded in the user interface. Therefore, the webpage corresponding to the shared identifier can be flexibly set, and the webpage corresponding to the rendering process can also be controlled under the function of the process identifier table, thereby reducing the probability of rendering process failure and improving the running stability of the rendering process.
[0074] The rendering process allocation method of this application will be further described below with reference to embodiments. The rendering process allocation method of this application can be integrated into the terminal. See the flowchart of the rendering process allocation method. Figure 3 The methods for allocating rendering processes include:
[0075] 210. The terminal receives the feature information of the first webpage.
[0076] For example, feature information may include webpage code, webpage URL, etc.
[0077] For example, a shared identifier `render_share_key` can be added to the WebContents object and `cef_browser_setting` in the webpage code. When the terminal calls `CreateBrowser` to create a browser object, the shared identifier `render_share_key` can be passed to `cef_browser_setting`. The shared identifier `render_share_key` can be passed from `cef_browser_setting` to WebContents, and then passed to `SiteInstanceImpl` when it is created.
[0078] 220. If the feature information includes the target keyword, the terminal determines the first shared identifier corresponding to the first webpage.
[0079] For example, target keywords can include information that reflects the specific module to which the webpage belongs in the virtual application. For instance, if the code of webpage 1 includes target keyword 1, target keyword 1 can indicate that webpage 1 is a page in the online document module of the virtual application.
[0080] In this embodiment of the application, multiple web pages corresponding to the same rendering process can be determined through various strategies. For example, multiple web pages can be directly determined to correspond to one rendering process. In this case, specific keywords can be directly added to the feature information of these web pages. When the terminal determines that the feature information of a certain web page includes specific keywords, it can directly determine that the feature keyword is the shared identifier of the web page.
[0081] For example, for a certain virtual application, all web pages of at least one module can be associated with a rendering process. The feature information of the web page includes module keywords that represent the module to which it belongs. After the terminal determines that the feature information of a web page includes module keywords, it can query the preset shared identifier corresponding to the module keyword from the keyword identifier table. The preset shared identifier is the shared identifier corresponding to the web page.
[0082] For example, the target keyword in the feature information of webpage 1 can be determined by calling the GetRenderHostProcessForSiteInstance function. This target keyword is the shared identifier render_share_key1 of webpage 1.
[0083] 230. The terminal obtains a process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier.
[0084] For example, developers can create a process identifier table called MergeKeyToProcessMap, which maps shared identifiers (render_share_key) to process identifiers (which can be determined via the RenderProcessHost pointer). The terminal can then access this process identifier table.
[0085] 240. If a preset shared identifier exists in the process identifier table that is the same as the first shared identifier, the terminal determines the preset process identifier corresponding to the preset shared identifier as the first process identifier.
[0086] 250. If the process identifier table does not exist in the preset shared identifier that is the same as the first shared identifier, the terminal creates a first process identifier corresponding to the first shared identifier and saves the correspondence between the first shared identifier and the first process identifier to the process identifier table.
[0087] First, check if render_share_key1 has a corresponding RenderProcessHost pointer in the process identifier table. If it exists, determine the process identifier 1 corresponding to webpage 1 through the RenderProcessHost pointer. If it does not exist, create the RenderProcessHost pointer corresponding to render_share_key1 and the process identifier 1, and save the correspondence between render_share_key1 and process identifier 1 to the process identifier table MergeKeyToProcessMap through the RegisterProcess function.
[0088] 260. The terminal renders the first webpage through the first rendering process to load the first webpage in the user interface.
[0089] This application can also avoid locking the rendering process, thus preventing the rendering process from crashing due to process locking when multiple web page domains corresponding to the rendering process are different, and effectively improving the stability of the rendering process.
[0090] This application embodiment can receive feature information of a first webpage, and if the feature information includes target keywords, determine a first shared identifier corresponding to the first webpage. The process identifier table includes at least one preset shared identifier and a process identifier of the rendering process corresponding to the preset shared identifier. This application embodiment can determine the first process identifier of the first rendering process corresponding to the first shared identifier based on the process identifier table, and then render the first webpage through the first rendering process, so that the first webpage can finally be loaded in the user interface. Therefore, the webpage corresponding to the shared identifier can be flexibly set, and the webpage corresponding to the rendering process can also be controlled under the function of the process identifier table, thereby reducing the probability of rendering process failure and improving the running stability of the rendering process.
[0091] To better implement the above methods, embodiments of this application also provide a rendering process allocation device, such as... Figure 4 As shown, the rendering process allocation device may include a receiving module 310, a determining module 320, an acquiring module 330, an identifying module 340, and a rendering module 350. Specifically,
[0092] The receiving module 310 is used to receive the feature information of the first webpage;
[0093] The determination module 320 is used to determine the first shared identifier corresponding to the first webpage if the feature information includes the target keyword.
[0094] The acquisition module 330 is used to acquire a process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier.
[0095] The identification module 340 is used to determine the first process identifier corresponding to the first shared identifier based on the process identifier table. The first process identifier is used to identify the first rendering process.
[0096] Rendering module 350 is used to render the first webpage through the first rendering process so as to load the first webpage in the user interface.
[0097] In some embodiments of this application, the identification module includes a determination submodule and a creation submodule, wherein,
[0098] The determination submodule is used to determine the preset process identifier corresponding to the preset shared identifier as the first process identifier if the process identifier table contains a preset shared identifier that is the same as the first shared identifier.
[0099] Create a submodule to create a first process identifier corresponding to the first shared identifier if the process identifier table does not exist in the preset shared identifier that is the same as the first shared identifier.
[0100] In some embodiments of this application, the rendering process allocation device further includes a storage module, wherein,
[0101] The storage module is used to save the correspondence between the first shared identifier and the first process identifier to the process identifier table.
[0102] In some embodiments of this application, the rendering process allocation device further includes a release module, wherein,
[0103] The release module is used to release the first process lock if the first rendering process corresponds to the first process lock, so that any webpage corresponding to the first shared identifier can be loaded through the first rendering process.
[0104] In some embodiments of this application, the determining submodule may be specifically used for:
[0105] If the process identifier table contains a preset shared identifier that is the same as the first shared identifier, the preset process identifier corresponding to the preset shared identifier is determined to be the initial process identifier.
[0106] Obtain the process domain name table, which includes multiple process identifiers and at least one domain name corresponding to each process identifier;
[0107] Get the first domain name of the first webpage;
[0108] If there is a correspondence between the first domain name and the initial process identifier in the process domain name table, the initial process identifier is determined to be the first process identifier.
[0109] In some embodiments of this application, the determining module may be specifically used for:
[0110] If the feature information includes the target keyword, obtain the keyword identifier table. The keyword identifier table includes multiple keywords and a preset shared identifier corresponding to the keyword.
[0111] Find the first shared identifier corresponding to the target keyword from the keyword identifier table.
[0112] In some embodiments of this application, the determining module may be specifically used for:
[0113] If the feature information includes the target keyword, the target keyword is determined to be the first shared identifier corresponding to the first webpage.
[0114] In this embodiment, the rendering process allocation device can receive feature information of a first webpage, and if the feature information includes target keywords, determine a first shared identifier corresponding to the first webpage. The process identifier table includes at least one preset shared identifier and a process identifier of the rendering process corresponding to the preset shared identifier. Based on the process identifier table, the first process identifier corresponding to the first shared identifier of the first rendering process can be determined, and then the first webpage is rendered through the first rendering process, so that the first webpage can be loaded in the user interface. Therefore, the webpage corresponding to the shared identifier can be flexibly set, and the webpage corresponding to the rendering process can be controlled under the function of the process identifier table, thereby reducing the probability of rendering process failure and improving the running stability of the rendering process.
[0115] This application also provides a computer device, such as... Figure 5 As shown, it illustrates a structural schematic diagram of a computer device involved in an embodiment of this application. This computer device can be a terminal or a server, etc. Specifically:
[0116] The computer device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 5 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0117] The processor 401 is the control center of the computer device, connecting various parts of the computer device through various interfaces and lines. It performs various functions and processes data by running or executing computer programs and / or modules stored in the memory 402, and by calling data stored in the memory 402. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and computer programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.
[0118] The memory 402 can be used to store computer programs and modules. The processor 401 executes various functional applications and data processing by running the computer programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0119] The computer device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0120] The computer device may also include an input unit 404, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0121] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the computer device loads the executable files corresponding to the processes of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402 to realize various functions, as follows:
[0122] Receive feature information of the first webpage; if the feature information includes target keywords, determine the first shared identifier corresponding to the first webpage; obtain a process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier; based on the process identifier table, determine the first process identifier corresponding to the first shared identifier, which is used to identify the first rendering process; render the first webpage through the first rendering process to load the first webpage in the user interface.
[0123] This application embodiment can receive feature information of a first webpage, and if the feature information includes target keywords, determine a first shared identifier corresponding to the first webpage. The process identifier table includes at least one preset shared identifier and a process identifier of the rendering process corresponding to the preset shared identifier. This application embodiment can determine the first process identifier of the first rendering process corresponding to the first shared identifier based on the process identifier table, and then render the first webpage through the first rendering process, so that the first webpage can finally be loaded in the user interface. Therefore, the webpage corresponding to the shared identifier can be flexibly set, and the webpage corresponding to the rendering process can also be controlled under the function of the process identifier table, thereby reducing the probability of rendering process failure and improving the running stability of the rendering process.
[0124] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0125] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0126] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute steps in any of the rendering process allocation methods provided in embodiments of this application. For example, the computer program can execute the following steps:
[0127] Receive feature information of the first webpage; if the feature information includes target keywords, determine the first shared identifier corresponding to the first webpage; obtain a process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier; based on the process identifier table, determine the first process identifier corresponding to the first shared identifier, which is used to identify the first rendering process; render the first webpage through the first rendering process to load the first webpage in the user interface.
[0128] This application embodiment can receive feature information of a first webpage, and if the feature information includes target keywords, determine a first shared identifier corresponding to the first webpage. The process identifier table includes at least one preset shared identifier and a process identifier of the rendering process corresponding to the preset shared identifier. This application embodiment can determine the first process identifier of the first rendering process corresponding to the first shared identifier based on the process identifier table, and then render the first webpage through the first rendering process, so that the first webpage can finally be loaded in the user interface. Therefore, the webpage corresponding to the shared identifier can be flexibly set, and the webpage corresponding to the rendering process can also be controlled under the function of the process identifier table, thereby reducing the probability of rendering process failure and improving the running stability of the rendering process.
[0129] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0130] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the rendering process allocation methods provided in the embodiments of this application, the beneficial effects that any of the rendering process allocation methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0131] This application also provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the methods provided in various optional implementations of the rendering process allocation method described above.
[0132] The above provides a detailed description of a rendering process allocation method, apparatus, computer-readable storage medium, and computer device provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for allocating rendering processes, characterized in that, include: Receive the feature information of the first webpage; If the feature information includes target keywords, determine the first shared identifier corresponding to the first webpage; Obtain a process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier; Based on the process identifier table, the first process identifier corresponding to the first shared identifier is determined, and the first process identifier is used to identify the first rendering process. The first webpage is rendered using the first rendering process to load the first webpage in the user interface.
2. The method according to claim 1, characterized in that, The step of determining the first process identifier corresponding to the first shared identifier based on the process identifier table includes: If the process identifier table contains a preset shared identifier that is the same as the first shared identifier, then the preset process identifier corresponding to the preset shared identifier is determined to be the first process identifier; If the process identifier table does not exist in a preset shared identifier that is the same as the first shared identifier, a first process identifier corresponding to the first shared identifier is created.
3. The method according to claim 2, characterized in that, After creating the first process identifier corresponding to the first shared identifier, the method further includes: The correspondence between the first shared identifier and the first process identifier is saved to the process identifier table.
4. The method according to claim 1, characterized in that, The method further includes: If the first rendering process corresponds to the first process lock, release the first process lock so that any webpage corresponding to the first shared identifier can be loaded through the first rendering process.
5. The method according to claim 3, characterized in that, If the process identifier table contains a preset shared identifier that is the same as the first shared identifier, determining the preset process identifier corresponding to the preset shared identifier as the first process identifier includes: If the process identifier table contains a preset shared identifier that is the same as the first shared identifier, the preset process identifier corresponding to the preset shared identifier is determined to be the initial process identifier; Obtain a process domain name table, which includes multiple process identifiers and at least one domain name corresponding to the process identifiers; Obtain the first domain name of the first webpage; If the first domain name and the initial process identifier have a corresponding relationship in the process domain name table, the initial process identifier is determined to be the first process identifier.
6. The method according to claim 1, characterized in that, If the feature information includes a target keyword, determining the first shared identifier corresponding to the first webpage includes: If the feature information includes a target keyword, obtain a keyword identifier table, which includes multiple keywords and a preset shared identifier corresponding to the keyword; From the keyword identifier table, find the first shared identifier corresponding to the target keyword.
7. The method according to claim 1, characterized in that, If the feature information includes a target keyword, determining the first shared identifier corresponding to the first webpage includes: If the feature information includes a target keyword, the target keyword is determined to be the first shared identifier corresponding to the first webpage.
8. A rendering process allocation device, characterized in that, include: The receiving module is used to receive the feature information of the first webpage; The determination module is used to determine the first shared identifier corresponding to the first webpage if the feature information includes the target keyword; The acquisition module is used to acquire a process identifier table, which includes at least one preset shared identifier and the process identifier of the rendering process corresponding to the preset shared identifier. The identification module is used to determine the first process identifier corresponding to the first shared identifier based on the process identifier table, wherein the first process identifier is used to identify the first rendering process. A rendering module is used to render the first webpage through the first rendering process so as to load the first webpage in the user interface.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the steps of the rendering process allocation method according to any one of claims 1 to 7.
10. A computer device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor runs the application program within the memory to perform the steps of the rendering process allocation method according to any one of claims 1 to 7.