Method for managing browser engine microkernel component, embedded device for household appliance and household appliance
Through the dynamic replacement technology of the microkernel plug-in architecture, the problems of large browser engine size and high resource usage are solved, and a lightweight and efficient browser engine is realized, which can adapt to different hardware environments and improve user experience and energy management.
Patent Information
- Application Number
- CN202410683385.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-30
AI Technical Summary
The existing browser engine adopts an integrated architecture, which results in large size, complicated update and maintenance, limits user customization and compatibility, and consumes a high amount of resources, affecting performance and security.
It adopts a microkernel plug-in architecture and dynamically replaces microkernel components to achieve elastic scaling and adapt to different hardware performance. It provides a configurable and detachable web engine, reduces resource usage, and improves system adaptability and efficiency.
It achieves the lightweight, flexibility and efficiency of the browser engine, adapts to different hardware environments, improves user experience and energy management, and enhances system stability and security.
Smart Images

Figure CN118567747A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of household appliances and network technology, and in particular to a method for managing a browser engine microkernel component, an embedded device for household appliances, and the household 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. At present, most browsers adopt an integrated architecture. Although browsers with an integrated architecture have many advantages in terms of feature richness, user experience and convenience, they also have some disadvantages. All functional components and modules of the integrated architecture are completely packaged together, resulting in an overly bloated and large size, complex updates and maintenance, file sizes usually exceeding 200 megabytes, and running memory usage of hundreds of megabytes. The integrated browser function design may limit the user's degree of customization and freedom of choice, and the flexibility of use is low. In addition, the browser may use some non-standard or unique technical solutions, which will affect the compatibility with some web pages or applications.
[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 invention aims to provide a method for managing a browser engine microkernel component and an embedded device for home appliances, which can better adapt to the balanced management of user experience and energy consumption in actual usage scenarios.
[0005] According to one aspect of the present invention, a method for managing a browser engine microkernel component is provided, which is used for a browser engine. The browser engine is a microkernel plug-in architecture including a microkernel and a plug-in. The microkernel includes a typesetting engine and multiple microkernel components. The multiple microkernel components include a first microkernel component. The first microkernel component is a dynamically replaceable component. The method includes:
[0006] Reading the global configuration at startup, and loading the first microkernel component according to the version of the first microkernel component running written in the global configuration;
[0007] Monitoring a first microkernel component replacement instruction;
[0008] Reading the switching configuration information in the global configuration according to the monitored first microkernel component replacement instruction;
[0009] The replacement version of the first microkernel component is run according to the switching configuration information to replace the previously running version of the first microkernel component.
[0010] According to some embodiments, the first microkernel component includes at least two versions; the first microkernel component is stored in a dedicated path;
[0011] When the browser engine is started, the first microkernel component is registered and the registration result is stored in a list.
[0012] According to some embodiments, the application interfaces of the at least two versions of the first microkernel component remain consistent.
[0013] According to some embodiments, the first microkernel component replacement instruction is generated by user triggering and / or system triggering.
[0014] According to some embodiments, the browser engine generates the first microkernel component replacement instruction in response to a user's operation of changing configuration.
[0015] According to some embodiments, when the browser engine detects that the resource usage rate is high and / or low, it generates the first microkernel component replacement instruction to adaptively switch the first microkernel component to be used.
[0016] According to some embodiments, generating the first microkernel component replacement instruction further includes: modifying the global configuration to generate the switching configuration information.
[0017] According to some embodiments, the plurality of microkernel components include: a 2D graphics library, a JS parsing engine, and a network protocol stack.
[0018] According to another aspect of the present invention, there is provided an embedded device for household electrical appliances, comprising:
[0019] Processor; and
[0020] A memory stores a computer program, and when the computer program is executed by the processor, the method described in any one of the above items is implemented.
[0021] According to another aspect of the present invention, a household appliance is provided, comprising the aforementioned embedded device.
[0022] 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.
[0023] According to an embodiment of the present invention, by developing a microkernel component, the browser can dynamically replace the microkernel component during the engine operation after receiving the microkernel component replacement instruction. The architecture used in the present invention is a configurable, detachable, new generation, new form of Web engine, which can better adapt to the complex scenarios of modern IT applications. 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.
[0024] According to some embodiments, dynamic replacement can dynamically switch modules to different versions during system operation without restarting, thereby achieving switching between full performance and low power consumption modes, which can better adapt to the balanced management of user experience and energy consumption in actual usage scenarios.
[0025] According to some embodiments, the present invention adopts an architecture that combines microkernel and plug-in. Microkernel is a design concept that minimizes the functions of the operating system kernel, including the most basic services, and the remaining services originally in the traditional kernel are moved to independent processes or modules in user mode to run, making the kernel smaller, more stable, and more secure, while enhancing the scalability and modularity of the system. Plug-ins can be installed or uninstalled when needed without affecting the basic operation of the main program, which can flexibly add new functions to the application, and is also convenient for maintenance and updating.
[0026] 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
[0027] 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.
[0028] Figure 1 A schematic diagram of the existing browser technology application architecture is shown.
[0029] Figure 2 A schematic diagram showing the architecture of a microkernel plug-in browser technology according to an example embodiment.
[0030] Figure 3 A schematic diagram showing internal interactions of a microkernel plug-in browser according to an example embodiment is shown.
[0031] Figure 4 A schematic diagram showing the overall working process of a Web engine according to an example embodiment.
[0032] Figure 5 A flow chart showing a method of microkernel component operation according to an example embodiment.
[0033] Figure 6A block diagram illustrating an embedded device for a home appliance according to an exemplary embodiment. DETAILED DESCRIPTION
[0034] 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.
[0035] 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.
[0036] 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.
[0037] 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.
[0038] 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.
[0039] 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.
[0040] 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.
[0041] Since the all-in-one architecture integrates a large number of functions and services, the browser may be larger in terms of installation package size, memory usage, CPU utilization, etc., and has high requirements for hardware configuration. In the integrated architecture, if a part has a vulnerability or is maliciously exploited, it may affect the security of the entire system. For example, cloud service integration may increase the risk of privacy data leakage.
[0042] 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.
[0043] 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.
[0044] In order to reduce the cost of distribution and the overhead of hardware resources during operation, and to adapt to various application scenarios, including mobile terminals and smart home appliances, the present invention proposes a method for managing the microkernel component of the browser engine. By developing the microkernel component, the browser can dynamically replace the microkernel component during the operation of the engine after receiving the microkernel component replacement instruction, providing a configurable, detachable, new generation, and new form of Web engine. The microkernel provides basic rendering and parsing capabilities for the entire system, and some core components, such as the JS parsing engine, can realize dynamic switching of high-low performance and low-power engines, and thus can better adapt to hardware devices with different performances, which can be called "elastic scaling" technology. "Elastic scaling" technology allows the system to adjust the working mode of the core components according to the performance of the hardware device. The JS parsing engine can realize dynamic switching of high-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.
[0045] Before describing the embodiments of the present invention, some terms or concepts involved in the embodiments of the present invention are explained.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] Exemplary embodiments of the present invention are described below with reference to the accompanying drawings.
[0051] Figure 1 A schematic diagram of the existing browser technology application architecture is shown.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] 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.
[0056] Figure 2 A schematic diagram showing the architecture of a microkernel plug-in browser technology according to an example embodiment.
[0057] Figure 3 A schematic diagram showing internal interactions of a microkernel plug-in browser according to an example embodiment is shown.
[0058] 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.
[0059] 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.
[0060] 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.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] 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.
[0065] 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 to ensure the coordinated operation of various functional modules, thereby providing a smooth user experience.
[0066] Figure 4 A schematic diagram showing the overall working process of a Web engine according to an example embodiment.
[0067] 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.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] 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.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] 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.
[0077] 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.
[0078] 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.
[0079] 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.
[0080] Figure 5 A flow chart showing a method of microkernel component operation according to an example embodiment.
[0081] See also Figure 5 , at S501, the global configuration is read at startup.
[0082] According to some embodiments, the first microkernel component includes replaceable first microkernel component versions, so that each version of the microkernel component can be flexibly selected according to resources to achieve maximum resource utilization and agile effectiveness of processing.
[0083] According to some embodiments, the microkernel component is stored in a dedicated path, and the first microkernel component is registered and stored in a list when the browser engine starts. The replaceable elastic microkernel component can be placed in a special directory, and the Web engine can read the global configuration when it starts, load the first microkernel component according to the running version of the first microkernel component written in the global configuration, register the first microkernel component, and store the registration result in a list. In addition, according to some embodiments, the Web engine can register components that support elastic scaling and record them in a list, but will not initialize other registered components and will not allocate memory to reduce resource overhead.
[0084] According to some embodiments, the replacement version of the first microkernel component encapsulates a layer of the application interface of the first microkernel component. The replacement version of the first microkernel component is consistent with the application interface of the first microkernel component. For the caller, as long as the interface is consistent, it does not specify which engine implements the specific interface function. If the application interface function is not unified, the function of the application interface is rewritten or increased or decreased as required.
[0085] At S503, a microkernel component replacement instruction is monitored.
[0086] According to some embodiments, the first microkernel component replacement instruction is used for dynamic replacement between various microkernel components.
[0087] According to some embodiments, the microkernel component replacement instruction is generated by user triggering or system triggering. The system generates the microkernel component replacement instruction in response to a user's operation of changing a configuration, or generates the microkernel component replacement instruction when the system detects that the browser engine resource usage is high and / or low, so as to adaptively switch the microkernel component to be used.
[0088] Users can choose or switch the microkernel components to use. Specific operations can usually be achieved through interface options, such as drop-down menus, settings panels, etc., which clearly display the list of optional microkernel components and corresponding description information. After the user clicks to select according to their own needs, the system background will receive instructions to replace the microkernel component and perform the corresponding microkernel component switching and loading work. This design gives users a higher degree of freedom and personalized experience, but also requires the product to have good compatibility and management capabilities for each microkernel component.
[0089] The browser engine framework used in the present invention has a technical framework that can dynamically select different versions of microkernel components according to the current system resource status. The system can automatically optimize according to the resource status, such as reducing the resource consumption of inactive tabs when resources are tight. When designing the browser engine, the developer configures different versions of microkernel components in the configuration file. For example, in its internal logic, when it is detected that the browser memory usage is too high, the microkernel component replacement instruction is triggered to switch the engine to a rendering mode with a lower occupancy rate, so as to automatically use a lighter rendering mode on a low-memory device and use a memory recycling mechanism to more frequently release memory resources that are no longer used.
[0090] At S505, according to the monitored first microkernel component replacement instruction, the switching configuration information in the global configuration is read.
[0091] According to some embodiments, when executing the first microkernel component replacement instruction to perform the replacement operation, the configuration file may be modified. After the configuration file is modified, the microkernel component replacement instruction is sent to the browser engine.
[0092] According to some embodiments, the configuration file format is a json file, and the microkernel component reads this configuration file when loading.
[0093] In S507, the replacement version of the first microkernel component is started according to the switching configuration information to replace the previously running version of the first microkernel component.
[0094] According to some embodiments, when starting the replacement version of the first microkernel component, the replacement version of the first microkernel component can be initialized and loaded. The browser engine allocates a thread management variable to the first microkernel component, and the browser engine uses the first microkernel component by default. When the browser engine receives the first microkernel component replacement instruction, the browser engine initializes and loads the replacement version of the first microkernel component to the memory. The browser engine allocates the necessary resources that the replacement version of the first microkernel component depends on, and points the thread management variable to the replacement version of the first microkernel component. Then, the first microkernel component is switched to a suspended state.
[0095] According to some embodiments, after the replacement of the first microkernel component with the new replacement version is successful, the previous first microkernel component may not be completely uninstalled, and the browser engine will release the memory, network, file and other resources previously applied for by the first microkernel component during operation, but will not call the uninstall interface of the first microkernel component. The system will still retain other modules that the first microkernel component declares to depend on when it is initialized, and will not be deleted and / or released. The first microkernel component will enter a suspended waiting state, and when the thread management variable of the browser engine is redirected to use the first microkernel component, the first microkernel component can be quickly started and run.
[0096] Figure 6 A block diagram showing an embedded device for home appliances according to an exemplary embodiment of the present invention is shown.
[0097] like Figure 6 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.
[0098] 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. According to some embodiments, the embedded device 30 for home appliances may also include a high-performance graphics card (GPU) 20 for accelerating the processor 12.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] 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.
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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 microkernel component, used in a browser engine, characterized in that: The browser engine is a microkernel plug-in architecture including a microkernel and a plug-in, the microkernel includes a typesetting engine and multiple microkernel components, the multiple microkernel components include a first microkernel component, the first microkernel component is a dynamically replaceable component, and the method includes: Reading the global configuration at startup, and loading the first microkernel component according to the version of the first microkernel component running written in the global configuration; Monitoring a first microkernel component replacement instruction; Reading the switching configuration information in the global configuration according to the monitored first microkernel component replacement instruction; The first microkernel component of a replacement version is run according to the switching configuration information to replace the first microkernel component of a previously run version.
2. The method according to claim 1, characterized in that The first microkernel component includes at least two versions; The first microkernel component is stored in a dedicated path; When the browser engine is started, the first microkernel component is registered and the registration result is stored in a list.
3. The method according to claim 2, characterized in that The application interfaces of the at least two versions of the first microkernel component remain consistent.
4. The method according to claim 1, characterized in that: The first microkernel component replacement instruction is generated by user triggering and / or system triggering.
5. The method according to claim 1, characterized in that The browser engine generates the first microkernel component replacement instruction in response to a user's operation of changing configuration.
6. The method according to claim 1, characterized in that When the browser engine detects that the resource usage rate is high and / or low, it generates the first microkernel component replacement instruction to adaptively switch the first microkernel component to be used.
7. The method according to any one of claims 4 to 6, characterized in that: Generating the first microkernel component replacement instruction also includes: The global configuration is modified to generate the switching configuration information.
8. The method according to claim 1, characterized in that: The multiple microkernel components include: a 2D graphics library, a JS parsing engine and a network protocol stack.
9. An embedded device for household appliances, characterized in that: include: processor; as well as 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
Cited By
Component dynamic degradation method and device, storage medium and computer equipment
CN121433787A
