Method for managing browser engine kernel plug-in, embedded device for household appliance and household appliance
Through the microkernel plug-in architecture, the browser engine loads components on demand, which solves the problems of large size and high resource usage of the existing browser engine architecture, achieves lightweight and fast response, and improves user experience and operating efficiency.
Patent Information
- Application Number
- CN202410683388.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-17
AI Technical Summary
The existing browser engine architecture is integrated, resulting in large software size and high resource usage, making it difficult to meet users' needs for lightweight and fast response.
Adopting a microkernel plug-in architecture, the browser engine loads components on demand through the kernel plug-in list, achieving modular design and function expansion, reducing resource usage and improving operating efficiency.
It realizes the lightweight and fast response of the browser engine, reduces the file size and memory usage, provides flexible function expansion and efficient operation, and improves the user experience.
Smart Images

Figure CN118656141A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of home appliances and network technology, and in particular to a method for managing a browser engine kernel plug-in, an embedded device for home appliances, and the home appliances. Background Art
[0002] With the development of Internet technology and user needs, mobile terminals and home appliances have higher and higher requirements for browsers. However, most browser engine architectures are currently integrated heavyweight architectures with large software volumes, which are difficult to meet users' needs for lightweight and fast response.
[0003] Therefore, a solution for the browser engine is needed that can reduce the software size, optimize performance, and achieve the purpose of easy configuration and improved response speed. Summary of the invention
[0004] The present application aims to provide a method for managing browser engine kernel plug-ins, an embedded device for home appliances, and a method for loading plug-ins for a microkernel browser engine in home appliances, which can reduce file size, flexibly load and unload functional components, and achieve the purpose of easy configuration and improved response speed. The technical solution according to the present invention can efficiently run kernel plug-ins, flexibly expand browser functions, reduce resource usage, and improve operating efficiency.
[0005] According to one aspect of the present invention, a method for managing a browser engine kernel plug-in is provided, wherein the browser engine is a microkernel plug-in architecture including a microkernel and a kernel plug-in, and the kernel plug-in is a component loaded into the microkernel on demand, and the method comprises:
[0006] When the browser engine starts, it scans the kernel plug-in directory, registers the identified kernel plug-ins and records them in the kernel plug-in list;
[0007] If the microkernel encounters a function that cannot be processed during the rendering process, the microkernel scans the kernel plug-in list to determine whether there is a kernel plug-in with the corresponding function, and if so, loads the kernel plug-in, wherein the microkernel regards the kernel plug-in as a part of itself;
[0008] The kernel plug-in is called to perform related processing.
[0009] According to some embodiments, registering the identified kernel plug-in and recording it in the kernel plug-in list includes:
[0010] The registration interface is called, and if the call is successful, the core plug-in is recorded in the core plug-in list, wherein the registration interface provides function information, version information and unique additional information for the browser engine.
[0011] According to some embodiments, after the file of the kernel plug-in is deleted, if the browser engine cannot scan the file of the kernel plug-in when it is started, the kernel plug-in will no longer be used.
[0012] According to some embodiments, loading the kernel plug-in includes:
[0013] A bidirectional data channel is established between the microkernel and the kernel plug-in.
[0014] According to some embodiments, calling the kernel plug-in to perform relevant processing includes:
[0015] Between the microkernel and the kernel plug-in, a callback function is used to implement notification and response of asynchronous operations.
[0016] According to some embodiments, the microkernel includes a typesetting engine, a 2D graphics library, a JS parsing engine and a network protocol stack, and the kernel plug-in calls the interface of the microkernel, directly interacts with the JS parsing engine, or directly calls other plug-ins during the execution of related processing.
[0017] According to some embodiments, the operation mode of the browser engine is a single-process multi-threaded mode.
[0018] According to some embodiments, the kernel plug-in provides a registration interface, an initialization interface, a startup interface, a data transfer interface, a suspension interface, and an uninstallation interface.
[0019] According to another aspect of the present invention, there is provided an embedded device for household electrical appliances, comprising:
[0020] Processor; and
[0021] A memory stores a computer program, and when the computer program is executed by the processor, any of the methods described above is implemented.
[0022] According to another aspect of the present invention, a household appliance is provided, comprising the aforementioned embedded device.
[0023] According to another aspect of the present invention, there is provided a non-transitory computer-readable storage medium having computer-readable instructions stored thereon, and when the instructions are executed by a processor, the processor is caused to execute any of the above methods.
[0024] According to some embodiments, the present invention adopts an architecture combining a microkernel and a kernel plug-in, and proposes a method for managing a browser engine kernel plug-in. The browser engine will select a suitable kernel plug-in from a kernel plug-in list to load and initialize as needed, thereby expanding the core functions of the browser and providing a richer Web experience. In addition, in this way, the browser can load the kernel plug-in according to the actual needs and scenarios of the user, thereby reducing resource usage and improving operating efficiency.
[0025] The present invention adopts modular design, and the browser engine can be flexibly expanded while keeping the core part simple and efficient, providing users with a richer and safer Web experience. The browser engine can efficiently and safely manage and run the kernel plug-in, ensuring that the kernel plug-in can flexibly expand the browser function without affecting the system performance and security.
[0026] According to some embodiments, in a microkernel plug-in architecture, application logic is divided into independent plug-in modules and core systems, providing features of scalability, flexibility, functional isolation and custom processing logic, which can streamline file size, reduce distribution costs, and reduce consumption of hardware resources such as system memory, so as to achieve the purpose of lightweight, streamlined, configurable and detachable, and realize ultra-small file size and ultra-low memory usage.
[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for describing the embodiments are briefly introduced below.
[0029] Figure 1 A schematic diagram of the existing browser technology application architecture is shown.
[0030] Figure 2 A schematic diagram of a microkernel plug-in browser technology architecture according to an example embodiment is shown.
[0031] Figure 3 A schematic diagram showing the internal interactions of a microkernel plug-in architecture browser according to an example embodiment.
[0032] Figure 4 A schematic diagram showing the overall flow of the browser engine operation according to an example embodiment.
[0033] Figure 5 A flow chart of a method for managing browser engine kernel plug-ins according to an exemplary embodiment is shown.
[0034] Figure 6 A schematic diagram showing the operation of a video kernel plug-in according to an example embodiment is shown.
[0035] Figure 7 A block diagram illustrating an embedded device for a home appliance according to an exemplary embodiment. DETAILED DESCRIPTION
[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0037] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0038] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0039] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0040] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the present inventive concept. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.
[0041] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0042] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present invention, and therefore cannot be used to limit the protection scope of the present invention.
[0043] Existing browser engines are all integrated architectures, with file sizes exceeding 200M and running memory usage of hundreds of megabytes. For example, existing Chromium-based products are built based on Chromium's existing public interface layer (ContentPublic API), using the original complete kernel part of Chromium, but removing the upper-level process resource scheduling and interface parts, which can be simply understood as "Chromium reskinning". This architecture is a very heavy architecture with high resource requirements. Regardless of whether the user needs all the functions, the integrated architecture usually loads all components at startup, which leads to high memory and CPU usage, especially on resource-constrained devices, which may seriously affect performance. Users are also unable to selectively install or uninstall functional modules according to their own needs, which reduces the degree of personalization of the user experience. The integrated architecture is not easy to add or remove functional modules, and all components are bundled together. If you want to add new functions or support new technical standards, you may need to significantly reconstruct the entire system. If a component has a security vulnerability, it may threaten the security of the entire system.
[0044] The browser engine with microkernel plug-in architecture is more adaptable to the needs of market and technological development. Microkernel plug-in architecture is also called plug-in architecture pattern, and its core idea requires improved modularization and service separation. In the microkernel plug-in architecture, the application logic is divided into independent plug-in modules and core systems, providing scalability, flexibility, functional isolation and custom processing logic.
[0045] The present invention proposes a method for managing browser engine kernel plug-ins, which simplifies file size, reduces distribution costs, and reduces consumption of hardware resources such as system memory, so as to achieve the purpose of lightweight, streamlined, configurable, and detachable, and realize ultra-small file size and ultra-low memory occupancy.
[0046] Before describing the embodiments of the present invention, some terms or concepts involved in the embodiments of the present invention are explained.
[0047] Web rendering engine: also known as browser engine or layout engine, is the core component of modern Web browsers. Its function is to convert external HTML code into text, pictures, animation effects, audio, video and other interface presentation content visible to human eyes. It also includes various feedback effects given by the interface when people operate the mouse and keyboard, such as the text on the interface becomes bolder and changes color when the mouse is clicked or moved. This conversion process is called rendering.
[0048] CC layer: CC rendering synthesis layer, CC refers to Chromium Compositing, which is the component of the Chromium project responsible for handling the synthesis layer technology.
[0049] DOM (Document Object Model): is a programming interface defined in the W3C standard, used to represent the standard data structure of documents such as XML or HTML. DOM regards a document as a tree structure, in which each node is an object, allowing programs and scripts to dynamically update, add, delete and retrieve document content and structure.
[0050] Layer: The interface rendered by the web engine is essentially a large picture that is constantly updated. This large picture is composed of several or even dozens of parts, each of which can be called a layer.
[0051] Exemplary embodiments of the present invention are described below with reference to the accompanying drawings.
[0052] Figure 1 A schematic diagram of the existing browser technology application architecture is shown.
[0053] See also Figure 1 The overall architecture diagram of the Chromium project includes a UI interface, a renderer, a rendering engine, and a third-party library, etc. The Chromium browser is connected to the rendering engine through an embedded interface.
[0054] Products such as CEF (Chromium Embedded Framework) and Electron are built based on Chromium's Content Public API, using the complete kernel portion of Chromium and only making changes to the upper-layer process resource scheduling and interface parts to implement customized user interfaces in their respective applications.
[0055] The browser technology using this architecture has a large memory usage and high complexity. Since the Chromium architecture is designed as a multi-process and contains many components, each process requires a certain amount of memory space. Especially when running multiple tabs or applications, the high memory usage will increase the difficulty of development and maintenance, and may cause performance problems and security vulnerabilities. In addition, the Chromium architecture relies on many external libraries and components, so it becomes difficult to update and maintain compatibility, which will also limit its availability and portability on different platforms.
[0056] While being compatible with the powerful functions and good performance of the Chromium architecture, the present invention adopts a microkernel plug-in architecture design to achieve better scalability, maintainability and performance optimization.
[0057] Figure 2 A schematic diagram showing the architecture of a microkernel plug-in browser technology according to an example embodiment.
[0058] Figure 3 A schematic diagram showing internal interactions of a microkernel plug-in browser according to an example embodiment is shown.
[0059] See also Figure 2 This application adopts a microkernel plug-in architecture design to overcome the defects of the Chromium architecture. The architecture of this example embodiment separates the microkernel of core functions from the extensible kernel plug-in, thereby achieving better extensibility, maintainability and performance optimization.
[0060] The core of the microkernel plug-in architecture design according to the example embodiment is to divide the system into two main parts, namely the microkernel and the kernel plug-in library. The microkernel is a basic, minimal set of core functions, including the Blink typesetting engine, 2D graphics library, JS parsing engine and network protocol stack. The kernel plug-in library is a set of extensible functional modules, including audio, video, WebRTC, WebGL, printing, PDF and hardware acceleration. The microkernel is responsible for basic rendering and parsing functions, including text layout, image decoding and network requests, while the kernel plug-ins provide additional functions such as audio and video playback, WebRTC communication, WebGL graphics rendering, etc. These kernel plug-ins can interact with the microkernel through the API interface to achieve functional expansion and enhancement.
[0061] The advantage of adopting a microkernel plug-in architecture is that it can achieve modularity and scalability, and kernel plug-ins can be added or removed as needed to meet different needs. In addition, the separation between the microkernel and the kernel plug-in library also helps to improve the stability and security of the system.
[0062] See also Figure 3, the microkernel provides basic rendering and parsing capabilities for the entire system, and the kernel plug-in library contains various additional functional modules. The kernel plug-in interacts with the microkernel through an API interface to achieve functional expansion and enhancement. In addition, some core components, such as the JS parsing engine, can achieve dynamic switching between high- and low-performance and low-power engines, and thus can better adapt to hardware devices with different performances. This can be called "elastic scaling" technology. "Elastic scaling" technology allows the system to adjust the working mode of core components according to the performance of hardware devices. The JS parsing engine can achieve dynamic switching between high- and low-performance and low-power engines to adapt to hardware devices with different performances. This technology helps to improve the adaptability and efficiency of the system and ensure the best user experience in different hardware environments.
[0063] According to the example embodiment, the microkernel plug-in architecture divides the system into two parts: core functions and extended functions. The core functions are provided by the microkernel, ensuring the basic stability and reliability of the system. The extended functions are provided in the form of a kernel plug-in library, which can be added or deleted according to actual needs, enhancing the flexibility and scalability of the system. At the same time, through the "elastic scaling" technology, the system can adjust the working mode according to the performance of the hardware device, improving the adaptability and efficiency of the system.
[0064] The architecture according to the example embodiment is based on the Blink typesetting engine for addition. Based on the idea of addition, many functional components or modules are combined together to make the core of coordinated operation the Content layer (content scheduling layer). The Content layer can be understood as the "scheduling code" that effectively combines various functional modules to work together, which can realize the reconstruction of a new Web engine, so that the system can expand and adjust functions according to actual needs, improving the flexibility and scalability of the system.
[0065] In terms of memory operation mode, the engine according to the example embodiment adopts a single-process multi-threaded mode, that is, the entire system runs in one process, but there are multiple threads working together inside. This mode is conducive to saving resources and is particularly suitable for situations where resources are limited, such as mobile scenarios and home appliances. As the scheduling center of the entire engine, the Content layer mainly maintains the operation of two core threads-the typesetting thread and the UI thread. The typesetting thread and UI thread are responsible for page rendering and user interface updating, respectively. In addition to the two core threads, there are other working threads and sub-threads in the system, such as network threads. In addition, each kernel plug-in runs in an independent thread, such as a multimedia thread.
[0066] According to the example embodiment, the single-process multi-threaded operation mode not only ensures efficient operation of the system, but also saves resources, and is particularly suitable for scenarios with limited resources such as mobile devices. Through the scheduling of the Content layer, the system can reasonably allocate and utilize resources, ensure the coordinated operation of various functional modules, and thus provide a smooth user experience.
[0067] Figure 4 A schematic diagram showing the overall flow of the browser engine operation according to an example embodiment.
[0068] In a microkernel rendering engine, the rendering process is usually completed by multiple threads in collaboration to improve efficiency and concurrent processing capabilities. Figure 4 The overall working process of the browser engine involves the network layer, Blink engine, Content layer, CC layer, etc.
[0069] According to an example embodiment, the browser engine rendering process includes a main thread, a composition thread, multiple task threads and a rasterization thread, and the multiple threads work together.
[0070] In the process of web page loading and parsing, the main thread undertakes the important task of building the DOM tree. The main thread is responsible for parsing the received HTML text stream and converting it into a DOM structure, which is a tree-like data structure in which each node represents an element on the page.
[0071] When the network thread completes downloading the HTML document, it will pass the received HTML text data to the main thread. The main thread converts the received HTML text content into a series of DOM nodes through the HTML parser. Each tag corresponds to a DOM node, and the text content is encapsulated in the text node. DOM, as an interface provided by the browser, allows Web developers to dynamically update and control the content, structure, and style of the web page. This dynamism enables the web page to respond to user interaction and program logic changes, thereby realizing rich Web application functions.
[0072] When encountering external resources during the construction of the DOM tree, the browser will start a network request thread to load these resources. For CSS (affecting style calculation) and JS (which may change the DOM structure or style) resources, the browser will pause DOM parsing and prioritize CSS and blocking JS.
[0073] When images, videos, style sheets, JavaScript scripts and other resources are referenced in an HTML document, the browser will load the resources in a certain order and strategy. When parsing a resource reference, the browser will first search in the local cache. If there is a corresponding resource in the cache, it will be loaded directly from the cache; otherwise, the browser will create a new task thread and send an HTTP request over the network to obtain the resource. For style sheets and script resources, the browser will determine the loading order based on their location and attributes in the HTML document. When the script is loaded and executed, it can access and modify the currently constructed DOM tree structure, or dynamically generate new DOM elements according to the script logic.
[0074] Style calculation is a key step in the browser's processing of web page styles. When parsing a page, the browser will calculate the style of the node according to the CSS code. The browser calculates the final style of each DOM node based on the CSSOM (CSS Object Model), taking into account factors such as style inheritance and cascading order. The browser draws based on the layout information, filling in colors, backgrounds, texts, images, and other content. The final visual effect presented to the user is the actual expression of each element after style calculation.
[0075] The essence of layout calculation is to calculate the geometric relationship between elements. The main thread will traverse the DOM tree and related element styles, generate the page coordinate information of each element, and build a layout tree structure described by the box model. The browser recursively determines the layout information of each visible element, such as width, height, line height, margin, padding, border, etc., starting from the root element, to form a layout structure with precise geometric position relationship.
[0076] After completing the layout calculation, the main thread has obtained detailed layout information, including the exact style information of each element. In the drawing stage, the main thread will create a drawing order list based on the layout tree and the style attributes of each element. This list not only contains which elements need to be drawn, but also specifies the priority and order of drawing. In order to improve efficiency and correctly handle stacking contexts and stacking orders, the browser needs to arrange the drawing order reasonably. The browser calls the graphics rendering engine of the GPU or CPU to convert these elements into pixel matrices on the screen according to the drawing order table. This step involves a series of complex graphics processing technologies such as color filling, texture mapping, and synthesis operations.
[0077] The Compositor Thread works independently of the main thread and is responsible for managing these layers and their transformations. It is not directly involved in the drawing of actual pixels. The Compositor Thread will rasterize each layer separately according to the relationship of the layer tree and generate its own bitmap in memory; rasterization is the process of converting vector graphics or layers into a pixel matrix on the screen. This process is usually performed by a dedicated rasterization thread pool, which divides the layer into multiple small blocks - tiles (Tiles) according to the instructions provided by the compositor, and rasterizes each tile independently. When all related layer tiles have been rasterized, the Compositing Thread will collect these rasterized tiles and merge them into a complete frame according to the correct stacking order and transparency factors. Finally, the Compositing Thread will submit this composite frame to the GPU and display it on the user interface through hardware acceleration.
[0078] In a web browser environment, events are generated from user interactions, passed to the browser kernel through the operating system, and then distributed to the corresponding DOM elements. The main responsibility of event processing is to respond to user interactions and other non-user-triggered events. The response to external mouse and keyboard events is implemented by JS code, and the JS code is executed in the main thread. The main thread will find the target object based on the coordinates of the event occurrence through the drawing order table generated in the drawing phase, and run the event processing function bound to the target object. The work of identifying the location of the event, finding the corresponding DOM element, and executing the corresponding event processing function is all completed in the main thread where the JavaScript engine is located. With the help of the already constructed DOM structure and rendering context, the main thread can accurately associate the relationship between events and DOM elements to ensure that the events are responded to correctly.
[0079] According to the example embodiment, the collaboration between threads is based on message passing and queue mechanisms. The main thread schedules the work of other threads according to changes in page content and synchronizes data and status when appropriate to ensure that a consistent and efficient rendering result is ultimately presented to the user.
[0080] According to the example embodiment, the CC layer is responsible for managing the synthesis and rendering of layers, including operations such as merging, displacement, and scaling of layers; the core that combines many functional components or modules together to enable them to operate in an effective and coordinated manner is the Content layer. The Content layer is the "scheduling code" that effectively combines various functional modules together to work together. On the one hand, the Content layer is responsible for processing content-related tasks, such as color correction and image decoding. On the other hand, the Content layer is responsible for overall scheduling and providing external interfaces. As the scheduling center of the entire engine, the Content layer mainly maintains the operation of two core threads, the typesetting thread and the UI thread.
[0081] Figure 5 A flow chart of a method for managing browser engine kernel plug-ins according to an exemplary embodiment is shown.
[0082] In S501, when the browser engine is started, a kernel plug-in directory is scanned, and the identified kernel plug-ins are registered and recorded in a kernel plug-in list.
[0083] According to the exemplary embodiment, the core plug-in in the browser engine adopts a modular design, and the core plug-in is designed as an independent and replaceable functional unit. Each core plug-in is responsible for a specific function, such as rendering engine extension, JavaScript engine enhancement, multimedia support, security protection, network optimization, etc.
[0084] Through modular design, kernel plug-in developers do not need to deeply understand all the details of the browser engine. They only need to develop according to the specified interfaces and specifications to achieve docking with the browser kernel. For example, the kernel plug-in can provide registration interface, initialization interface, startup interface, data transmission interface, suspension interface and uninstallation interface.
[0085] When the browser engine is started, the system will scan the kernel plug-in directory according to the predetermined path. This process is mainly to discover and identify the kernel plug-ins that have been installed in the system. When identifying the kernel plug-in, the browser engine will check the kernel plug-in's file format, version information, digital signature and other metadata to ensure the legitimacy, compatibility and security of the kernel plug-in. After the kernel plug-in's file is deleted, the browser engine will not scan the kernel plug-in's file when it is started, and will no longer use the kernel plug-in.
[0086] According to an example embodiment, once a kernel plug-in is identified, a registration interface may be called, and the registration interface provides the browser engine with function information, version information, and unique additional information; if the call is successful, the kernel plug-in is recorded in the kernel plug-in list, that is, the basic information of these kernel plug-ins is registered in the kernel plug-in list, such as kernel plug-in ID, version, name, description, function, etc. The kernel plug-in list is a core data structure used to manage and schedule the operation of kernel plug-ins, which can dynamically reflect the status of currently available kernel plug-ins. Later, when the browser renders a web page or performs a specific function, the browser engine will select a suitable kernel plug-in from the kernel plug-in list as needed, thereby expanding the core functions of the browser and providing a richer Web experience. According to some embodiments, the kernel plug-in can directly affect and change the basic behavior of the browser, including improving or replacing the original rendering engine, network requests, extending or modifying the script execution environment, etc.
[0087] In S503, if the microkernel encounters a function that cannot be processed during the rendering process, the kernel plug-in list is scanned to determine whether there is a kernel plug-in with the corresponding function, and if so, the kernel plug-in is loaded.
[0088] When the microkernel is performing rendering work, if it encounters a function that the kernel itself cannot handle, it will scan the kernel plug-in list to determine whether there is a kernel plug-in with the corresponding function. If not, it will inform the kernel that the function is unavailable, and the kernel will do the corresponding processing. If there is such a kernel plug-in, it will load the kernel plug-in, and the microkernel will regard the kernel plug-in as a part of itself.
[0089] According to some embodiments, the browser engine initializes the kernel plug-in and allocates memory space so that the kernel plug-in can store data and execute code when running. The memory allocation process is usually reasonably planned and arranged according to the size and resource requirements of the kernel plug-in to ensure that the kernel plug-in will not conflict with other system resources when running. The information recorded after the initialization includes the function description, version information, current status and dependent resources executed by the kernel plug-in.
[0090] According to some embodiments, the browser engine calls the initialization interface of the core plug-in, which is implemented by the core plug-in developer according to the specifications provided by the browser engine and is responsible for starting the core functions of the core plug-in, setting the initial state, loading necessary resources, and establishing a connection with the browser kernel. The initialization process includes but is not limited to setting callback functions, initializing internal data structures, registering event handlers, etc.
[0091] According to some embodiments, after the kernel plug-in is initialized, the browser engine will update the kernel plug-in's initialization information, such as memory address, status of loaded resources, kernel plug-in functional characteristics, current running status and other key data, to the kernel plug-in list. In subsequent operations, the browser engine accurately manages and schedules each kernel plug-in based on the information in the kernel plug-in list to ensure smooth execution of browser functions and performance optimization. According to some embodiments, the kernel plug-in list also facilitates the management of kernel plug-in updates, uninstallations, enabling and disabling operations.
[0092] Unlike application-level plug-ins, which generally run relatively independently and do not interact much with the system itself. The kernel plug-in of this Web engine belongs to the kernel level. Once a plug-in is determined to be used, the microkernel will regard the plug-in as a part of itself. After loading and initialization, a two-way data channel will be established between the microkernel and the kernel plug-in, and the plug-in will also participate in the rendering process of the above-mentioned microkernel. The microkernel includes a typesetting engine, a 2D graphics library, a JS parsing engine, and a network protocol stack. The kernel plug-in calls the interface of the microkernel, interacts directly with the JS parsing engine, or directly calls other plug-ins during the execution of related processing. Taking the video plug-in as an example, in addition to calling the kernel interface during its operation, it will also interact directly with the JS engine. Depending on the function of the plug-in, it will also directly call other modules, such as the WebRTC conference plug-in will also directly call the network module.
[0093] At S505, the kernel plug-in is called to perform related processing.
[0094] As mentioned above, during the rendering process of the browser engine, since the kernel only contains the most basic typesetting functions, all other functions are implemented by the kernel plug-in. Whenever it encounters content that requires specific kernel plug-in function support, it will scan the recorded kernel plug-in list according to the current rendering requirements. This process is actually a dynamic search and matching process. The engine will search for kernel plug-ins with corresponding functions in the kernel plug-in list according to the requirements of the page content or rendering task. Once a kernel plug-in with matching functions is found in the kernel plug-in list and loaded, the browser engine will call the interface or method of the kernel plug-in and hand over the rendering task to the kernel plug-in for processing. After receiving the call, the kernel plug-in performs the corresponding functional operations, such as parsing special web page elements, rendering special graphic effects, processing multimedia content, etc., and returns the processing results to the browser engine.
[0095] According to some embodiments, a bidirectional data channel is established between the microkernel and the kernel plug-in. In the design of the bidirectional data channel, boundary checking, permission control, encrypted transmission and other methods may be added. The data channel may be implemented in the form of memory sharing, message queues and the like, to ensure that information and instructions can be exchanged between the microkernel and the kernel plug-in. According to some embodiments, between the microkernel and the kernel plug-in, a callback function is used to implement notification and response of asynchronous operations.
[0096] According to some embodiments, the microkernel passes the results of the kernel plug-in to the CC synthesis layer in the form of drawing instructions. The CC synthesis layer receives the drawing instructions, performs rasterization operations, and converts them into pixels or layers. Finally, the UI thread of the Content layer displays the pixels or layers on the screen.
[0097] Through this example embodiment, the browser engine can make full use of the kernel plug-in extension function while keeping the core part simple and efficient. Through the kernel plug-in library system, the browser can easily cope with the rapid development and diversified needs of Web technology, ensuring that various complex Web content can be smoothly processed during the rendering process.
[0098] The kernel plug-in management method of this embodiment makes the development and use of kernel plug-ins more flexible and convenient. Developers only need to follow the unified API interface standard to develop kernel plug-ins suitable for this Web engine. At the same time, the engine can choose which kernel plug-ins to load according to actual needs, avoiding unnecessary waste of resources and improving the operating efficiency of the system.
[0099] The present invention can achieve functional expansion and enhancement to meet the needs of different users. Through the cooperation of the microkernel and the kernel plug-in library, the system can expand and adjust functions according to actual needs, thereby improving the flexibility and scalability of the system.
[0100] Figure 6 A schematic diagram showing the operation of a video kernel plug-in according to an example embodiment is shown.
[0101] The kernel plug-ins involved in the browser engine work at every stage of the rendering process. Application-level kernel plug-ins generally run relatively independently and do not interact much with the system itself. The kernel plug-ins described in this Web engine are kernel-level, which is different from application-level kernel plug-ins. Once a kernel plug-in is determined to be used, the microkernel will regard the kernel plug-in as a part of itself. After initialization, it will establish a two-way data channel and build a kernel plug-in operating environment. The kernel plug-in will also participate heavily in the rendering process of the above-mentioned microkernel.
[0102] See also Figure 6 , taking the video kernel plug-in as an example, when the video kernel plug-in is running, in addition to calling the kernel interface, it will also interact directly with the JS engine. This is because the video kernel plug-in may need to process logic related to JavaScript. For example, when playing a video on a web page, it is necessary to interact with JavaScript code to implement functions such as play and pause. In addition, the video kernel plug-in can also directly call other modules. For example, the WebRTC conference kernel plug-in may need to directly call the network module to implement the video conferencing function. This is because video conferencing requires real-time transmission of video data and requires the support of the network module.
[0103] This method of directly calling other modules enables the core plug-in to implement functions more flexibly. The modular and core plug-in design allows the browser functions to be flexibly expanded, and each core plug-in can work closely with different modules of the core as needed to provide users with a rich Web experience.
[0104] Figure 7 A block diagram showing an embedded device for home appliances according to an exemplary embodiment of the present invention is shown.
[0105] like Figure 7 As shown, the embedded device 30 for home appliances includes a processor 12 and a memory 14. The embedded device 30 for home appliances may also include a bus 22, a network interface 16, and an I / O interface 18. The processor 12, the memory 14, the network interface 16, and the I / O interface 18 may communicate with each other through the bus 22.
[0106] The processor 12 may include one or more general-purpose CPUs (Central Processing Units, processors), microprocessors, or application-specific integrated circuits, etc., for executing relevant program instructions.
[0107] The memory 14 may include a machine system readable medium in the form of a volatile memory, such as a random access memory (RAM), a read-only memory (ROM) and / or a cache memory. The memory 14 is used to store one or more programs including instructions and data. The processor 12 can read the instructions stored in the memory 14 to execute the above-mentioned method according to the embodiment of the present invention.
[0108] The embedded device 30 for home appliances can also communicate with one or more networks through the network interface 16. The network interface 16 can be a wireless network interface.
[0109] The bus 22 may include an address bus, a data bus, a control bus, etc. The bus 22 provides a path for exchanging information between components.
[0110] It should be noted that, in the specific implementation process, the embedded device 30 for household appliances may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above-mentioned device may also only include components necessary for implementing the embodiments of this specification, and does not necessarily include all the components shown in the figure.
[0111] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a microdrive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), a network storage device, a cloud storage device, or any type of medium or device suitable for storing instructions and / or data.
[0112] An embodiment of the present invention also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any method recorded in the above method embodiments.
[0113] Those skilled in the art can clearly understand that the technical solution of the present invention can be implemented with the help of software and / or hardware. "Unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array, an integrated circuit, etc.
[0114] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0115] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0116] In the several embodiments provided by the present invention, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0117] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0118] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0119] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.
[0120] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0121] The exemplary embodiments of the present invention are specifically shown and described above. It should be understood that the present invention is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present invention is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended clauses.
Claims
1. A method for managing a browser engine kernel plug-in, characterized in that: The browser engine is a microkernel plug-in architecture including a microkernel and a kernel plug-in, wherein the kernel plug-in is a component loaded into the microkernel on demand, and the method comprises: When the browser engine starts, it scans the kernel plug-in directory, registers the identified kernel plug-ins and records them in the kernel plug-in list; If the microkernel encounters a function that cannot be processed during the rendering process, the microkernel scans the kernel plug-in list to determine whether there is a kernel plug-in with the corresponding function, and if so, loads the kernel plug-in, wherein the microkernel regards the kernel plug-in as a part of itself; The kernel plug-in is called to perform related processing.
2. The method according to claim 1, characterized in that: Register the identified kernel plug-ins and record them in the kernel plug-in list, including: The registration interface is called, and if the call is successful, the core plug-in is recorded in the core plug-in list, wherein the registration interface provides function information, version information and unique additional information for the browser engine.
3. The method according to claim 1, characterized in that After the file of the core plug-in is deleted, the browser engine cannot scan the file of the core plug-in when it is started, and the core plug-in is no longer used.
4. The method according to claim 1, characterized in that: Loading the kernel plug-in includes: A bidirectional data channel is established between the microkernel and the kernel plug-in.
5. The method according to claim 1, characterized in that Calling the kernel plug-in to perform related processing includes: Between the microkernel and the kernel plug-in, a callback function is used to implement notification and response of asynchronous operations.
6. The method according to claim 4, characterized in that The microkernel includes a typesetting engine, a 2D graphics library, a JS parsing engine and a network protocol stack. The kernel plug-in calls the interface of the microkernel, directly interacts with the JS parsing engine, or directly calls other plug-ins during the execution of related processing.
7. The method according to claim 1, characterized in that The operating mode of the browser engine is a single-process multi-threaded mode.
8. The method according to claim 1, characterized in that The kernel plug-in provides a registration interface, an initialization interface, a startup interface, a data transmission interface, a suspension interface and an uninstallation interface.
9. An embedded device for household appliances, characterized in that: include: processor; as well as Case Number: A memory storing a computer program, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 8 is implemented.
10. A household appliance, characterized in that: include: The embedded device according to claim 9.
Citation Information
Patent Citations
Embedded browser and implement method thereof
CN103177095A
Method and equipment of loading plugins of terminal network application based on browser
CN107066295A
Plug-in management method and device, electronic equipment and storage medium
CN114968406A
