Plug-in running method and device, desktop operating system and electronic equipment

CN117472462BActive Publication Date: 2026-09-25ZHONGKE FANGDE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311309708.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-10
Publication Date
2026-09-25
Estimated Expiration
2043-10-10

AI Technical Summary

Technical Problem

[0003]现有技术中,插件主要作为任务栏管理器的一部分进行管理和调度,没有独立的生命周期管理,如果插件需要更新或出现错误,可能会影响整个任务栏的功能及稳定性

Benefits of technology

[0030]本申请实施例公开的插件运行方法,通过在桌面操作系统中增加插件管理器,与任务栏管理器协作控制插件运行。本方法通过由任务栏管理器将插件加载操作以事件的形式推送给插件管理器,由插件管理器以动态链接库的形式加载插件,并由插件管理器控制插件运行,从程序代码和运行角度双重解耦插件与任务栏管理器,通过创建独立的插件管理器,可以对插件进行清晰、明确的配置、加载、实例化和生命周期管理,使得插件管理功能与任务栏管理功能分离,降低了系统的复杂度和维护难度,从而提升桌面操作系统中任务栏运行的稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117472462B_ABST
    Figure CN117472462B_ABST
Patent Text Reader

Abstract

The application discloses a plug-in running method and device, a desktop operating system and electronic equipment, and belongs to the technical field of computers. The method is applied to a desktop operating system comprising a taskbar manager and a plug-in manager, obtains associated information of a plug-in to be loaded based on a plug-in loading event through the taskbar manager, generates event data corresponding to the plug-in loading event, and then pushes the plug-in loading event and the event data to the plug-in manager; the plug-in manager updates a plug-in management configuration file according to the event data in response to the plug-in loading event pushed by the taskbar manager, preloads the plug-in by using a dynamic link library loading mechanism according to the plug-in management configuration file, then instantiates the plug-in and starts the plug-in, and controls the plug-in to run. The method manages plug-in running by creating an independent plug-in manager, decouples the plug-in from the taskbar manager, and improves the stability of taskbar running in the desktop operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to plug-in running methods, apparatus, desktop operating systems, electronic devices, and computer-readable storage media. Background Technology

[0002] A plugin is a program written according to a specific application programming interface (API). Plugins can only run within the defined scope of a program and cannot run independently. In desktop operating systems, plugins are used to implement a single function, such as a calendar. In desktop operating systems, the taskbar is a docking and display area for user interaction, such as application window switching, application launcher docking, and network status display. Plugins can serve as functionalities or extensions of applications docked or displayed in the taskbar and are invoked by the taskbar manager.

[0003] In existing technologies, plugins are mainly managed and scheduled as part of the taskbar manager, without independent lifecycle management. If a plugin needs to be updated or encounters an error, it may affect the functionality and stability of the entire taskbar.

[0004] It is evident that the existing plug-in operation methods still need improvement. Summary of the Invention

[0005] This application provides a desktop operating system, a plug-in running method and apparatus, an electronic device, and a storage medium, which can at least improve one or more of the above-mentioned defects, thereby improving the stability of the taskbar operation in the desktop operating system.

[0006] In a first aspect, embodiments of this application provide a plug-in running method applied to a desktop operating system, the desktop operating system including a taskbar manager and a plug-in manager, the method including:

[0007] After the taskbar manager and the plugin manager are started, the taskbar manager obtains the association information of the plugins to be loaded based on the plugin loading event;

[0008] The taskbar manager generates event data corresponding to the plugin loading event based on the association information, and pushes the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager.

[0009] The plugin manager responds to the plugin loading event pushed by the taskbar manager and updates the plugin management configuration file according to the event data corresponding to the plugin loading event;

[0010] The plugin manager preloads plugins using a dynamic link library loading mechanism based on the plugin management configuration file.

[0011] The plugin manager performs an instantiation operation on the pre-loaded plugins to obtain the plugin instances of the pre-loaded plugins;

[0012] The plugin manager will register the obtained plugin instance into the second plugin list;

[0013] The plugin manager schedules the execution of the plugins corresponding to the plugin instances based on the second plugin list.

[0014] Secondly, embodiments of this application provide a plug-in running device applied to a desktop operating system, the desktop operating system including a taskbar manager and a plug-in manager, the device including:

[0015] The module for obtaining the association information of plugins to be loaded is used to obtain the association information of plugins to be loaded based on the plugin loading event after the taskbar manager and the plugin manager are started.

[0016] The event push module is used by the taskbar manager to generate event data corresponding to the plugin loading event based on the association information, and push the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager.

[0017] The plugin management configuration file update module is used by the plugin manager to update the plugin management configuration file according to the event data corresponding to the plugin loading event in response to the plugin loading event pushed by the taskbar manager.

[0018] The plugin preloading module is used by the plugin manager to preload plugins according to the plugin management configuration file using a dynamic link library loading mechanism.

[0019] The plugin instance acquisition module is used by the plugin manager to perform an instantiation operation on the pre-loaded plugins and obtain the plugin instances of the pre-loaded plugins.

[0020] The plugin instance registration module is used by the plugin manager to register the obtained plugin instances into the second plugin list;

[0021] The plugin execution module is used by the plugin manager to schedule the execution of the plugin corresponding to the plugin instance based on the second plugin list.

[0022] Thirdly, embodiments of this application provide a desktop operating system, including: a taskbar manager and a plugin manager, wherein...

[0023] The taskbar manager is used to obtain the associated information of the plugins to be loaded based on the plugin loading event;

[0024] The taskbar manager is also used to generate event data corresponding to the plugin loading event based on the association information, and push the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager;

[0025] The plugin manager is used to respond to the plugin loading event pushed by the taskbar manager and update the plugin management configuration file according to the event data corresponding to the plugin loading event.

[0026] The plugin manager is also used to preload plugins according to the plugin management configuration file using a dynamic link library loading mechanism, and to perform an instantiation operation on the preloaded plugins to obtain plugin instances of the preloaded plugins, and to register the obtained plugin instances to a second plugin list.

[0027] The plugin manager is also used to schedule the execution of the plugin corresponding to the plugin instance based on the second plugin list.

[0028] Fourthly, embodiments of this application also disclose an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the plug-in running method described in embodiments of this application.

[0029] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, contains the steps of the plug-in running method disclosed in embodiments of this application.

[0030] The plugin operation method disclosed in this application adds a plugin manager to the desktop operating system, which collaborates with the taskbar manager to control plugin operation. This method involves the taskbar manager pushing plugin loading operations to the plugin manager as events. The plugin manager then loads the plugin as a dynamic link library and controls its operation. This decouples the plugin from the taskbar manager from both the program code and runtime perspectives. By creating an independent plugin manager, clear and explicit configuration, loading, instantiation, and lifecycle management of plugins can be achieved. This separation of plugin management and taskbar management functions reduces system complexity and maintenance difficulty, thereby improving the stability of taskbar operation in the desktop operating system.

[0031] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description

[0032] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] Figure 1 This is one of the flowcharts illustrating the plug-in operation method disclosed in the embodiments of this application;

[0034] Figure 2 This is a second flowchart illustrating the plug-in operation method disclosed in the embodiments of this application;

[0035] Figure 3 This is a schematic diagram of the structure of the desktop operating system disclosed in the embodiments of this application;

[0036] Figure 4 This is one of the logical relationship diagrams of the plug-in manager and taskbar manager in the desktop operating system disclosed in the embodiments of this application;

[0037] Figure 5 This is one of the structural schematic diagrams of the plug-in running device disclosed in the embodiments of this application;

[0038] Figure 6 This is a second schematic diagram of the plug-in running device disclosed in the embodiments of this application;

[0039] Figure 7 A block diagram schematically illustrates an electronic device for performing the method according to this application; and

[0040] Figure 8 A storage unit for holding or carrying program code implementing the method according to this application is illustrated schematically. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0042] This application discloses a plugin execution method, which is applied to, for example... Figure 3 The desktop operating system shown. (As shown) Figure 1 As shown, the method includes steps 101 to 107.

[0043] Step 101: After the taskbar manager and the plugin manager are started, the taskbar manager obtains the associated information of the plugins to be loaded based on the plugin loading event.

[0044] Optionally, the preset plugin loading event can be an event triggered by a plugin loading operation; the associated information includes, but is not limited to, one or more of the following: plugin identifier, plugin configuration information, display information, and behavior information.

[0045] During the startup process of the aforementioned desktop operating system, the main program will launch the taskbar manager and the plugin manager. Afterward, the taskbar manager and the plugin manager will each perform corresponding operations according to their respective designs.

[0046] For example, the taskbar manager reads the system's taskbar configuration file based on the triggering of a preset plugin loading event, and obtains the plugin identifier, plugin name, display information, and behavior information of the plugin to be loaded.

[0047] The taskbar configuration file is primarily used to define and control various attributes and behaviors of the taskbar manager. For example, it can control the taskbar's position, size, color, transparency, displayed application icons, the list of quick-launch applications, and the behavior of the system tray. Furthermore, the taskbar configuration file also includes the names of any plugins that need to be loaded, as well as plugin configuration information that controls the plugin's display on the taskbar and the desktop behaviors it performs. For example, it controls the display order and size of plugin icons, and the behavior information that controls the plugin's desktop actions. This behavior information includes, but is not limited to, the interactive behaviors that the plugin can respond to, such as clicking, dragging, and deleting.

[0048] The taskbar manager reads the plugin configuration file of the plugin to be loaded based on the plugin name, and obtains the plugin configuration information.

[0049] Specifically, the taskbar manager reads the plugin configuration files of each plugin that needs to be loaded according to the plugin name and the preset configuration file path information, so as to obtain the independent plugin configuration information of each plugin by the developer.

[0050] In one optional embodiment, plugin developers write a plugin configuration file for each plugin, describing the plugin's runtime environment, runtime parameters, and other information. These configuration files are named according to desktop operating system specifications (e.g., named after the plugin itself) and placed in a designated path on the desktop operating system. This allows the taskbar manager to locate the corresponding plugin configuration file for each plugin based on its name.

[0051] In some embodiments of this application, the plugin configuration information in the plugin configuration file includes, but is not limited to, one or more of the following: general information, scheduling strategy, execution method, parameters, file path, plugin dependency list and conflict list, conflict handling strategy, which plugins need to be called or responded to, shared memory requirements, size, etc. The general information includes, but is not limited to, one or more of the following: identifier, description, display requirements, etc.; the scheduling strategy includes, but is not limited to, one or more of the following: plugin scheduling strategy and priority; the execution method includes, but is not limited to, one or more of the following: synchronous, asynchronous, etc.; the parameters include, but are not limited to, one or more of the following: interface address, runtime parameters, etc.; the file path includes, but is not limited to, one or more of the following: the storage location of the plugin, the storage location of the plugin's dynamic link library file (such as a .so file), etc. The dependency list describes the list of libraries that the plugin depends on during execution, and the conflict list describes the list of plugins that cannot be executed simultaneously with the plugin.

[0052] Step 102: The taskbar manager generates event data corresponding to the plugin loading event based on the association information, and pushes the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager.

[0053] The taskbar manager generates event data corresponding to the plugin loading event based on one or more of the plugin identifier, plugin name, plugin configuration information, display information, and behavior information, and pushes the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager.

[0054] The taskbar manager will read the plugin configuration information of each plugin that needs to be loaded from the plugin configuration file, as well as the display information and behavior information of each plugin that needs to be loaded from the taskbar configuration file, and push them to the plugin manager in the form of event data, so that the plugin manager can perform plugin management based on this information.

[0055] In some optional embodiments, after the taskbar manager and the plugin manager are started, the method further includes: the plugin manager creating shared memory; correspondingly, the step of pushing the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager includes: the taskbar manager storing the plugin loading event and the event data corresponding to the plugin loading event in the shared memory; and the plugin manager retrieving the plugin loading event and the event data corresponding to the plugin loading event from the shared memory.

[0056] Optionally, event flags for different plugin events can be set in shared memory. The taskbar manager or plugin manager can listen to changes in these event flags to obtain the corresponding plugin loading events and their corresponding event data in a timely manner.

[0057] The desktop operating system disclosed in this application embodiment has a shared memory mechanism. For example, the shmget() function can be called to allocate specific memory regions for various plugins that need to communicate. These memory regions are visible to all plugins and can be used for data exchange and / or signal transmission. The plugin manager requests shared memory and uses the shared memory mechanism for interaction between plugins, as well as for data exchange and / or signal transmission between the plugin manager and the taskbar manager. Specific methods for creating shared memory are described in existing technologies and will not be repeated in this application embodiment.

[0058] The plugin operation method disclosed in this application involves a plugin manager creating and managing a shared memory area, which all plugins can read and write. This allows plugins to interact and communicate via shared memory. Furthermore, the plugin manager provides a standard interface, enabling plugins to easily read and write to the shared memory. Thus, plugin developers do not need to concern themselves with the specific implementation of the shared memory; they only need to read and write data through the interface provided by the plugin manager. This eliminates the need for each plugin to handle related logic individually, greatly simplifying plugin development complexity.

[0059] Furthermore, by creating shared memory and providing a unified memory access interface and services, the plugin manager enables signal and data transmission between plugins, between plugins and the plugin manager, and between the plugin manager and the taskbar manager through shared memory, thereby improving the overall operating efficiency of the system.

[0060] Taking the weather forecast plugin included in a desktop operating system as an example, the weather forecast plugin can obtain real-time weather information and display it on the taskbar. However, if other plugins in the desktop operating system, such as the calendar plugin, want to display the current weather information, the weather forecast plugin and the calendar plugin can share the weather information through shared memory created by the plugin manager.

[0061] For example, the shared memory area includes a field called "Current Weather". When the weather forecast plugin obtains new weather information, it can write the newly obtained weather information into the "Current Weather" field of the shared memory area through the interface provided by the plugin manager. At the same time, when the calendar plugin updates its interface, it can read the value of the "Current Weather" field in the shared memory area through the interface provided by the plugin manager, obtain the latest weather information, and display this information on the calendar interface.

[0062] Furthermore, shared memory areas can be used not only for data interaction but also for signal transmission. For example, if a weather forecast plugin needs to trigger a "weather change" event after obtaining new weather information, it can do so by setting a specific flag (e.g., a "weather change flag") in the shared memory area. Other plugins that are interested in this event can listen to the flag to receive relevant event notifications.

[0063] Step 103: The plugin manager responds to the plugin loading event pushed by the taskbar manager and updates the plugin management configuration file according to the event data corresponding to the plugin loading event.

[0064] After receiving a plugin loading event pushed by the taskbar manager, the plugin manager parses the event data corresponding to the plugin loading event to obtain the associated information of the plugin to be loaded. This associated information includes, but is not limited to, one or more of the following: plugin identifier, plugin configuration information, display information, and behavior information. Then, based on the plugin configuration information, display information, behavior information, and plugin identifier in the event data, the plugin manager generates a plugin management record and appends it to the locally stored plugin management configuration file for subsequent plugin management operations based on the configuration file.

[0065] Step 104: The plugin manager preloads plugins according to the plugin management configuration file using a dynamic link library loading mechanism.

[0066] As described in the previous section on generating the plugin management configuration file, the configuration file includes one or more pieces of plugin management information. Each piece of information may include: plugin identifier, plugin execution order, display location, dependencies, conflict list, execution parameters, execution method, and the location of the plugin's dynamic link library file. The plugin management configuration file is primarily used to control the behavior of the plugin manager and the loading of plugins. For example, it can define which plugins to load, the loading order, and plugin parameters. Furthermore, the plugin management configuration file can define how the plugin manager handles the plugin lifecycle, such as defining loading, initialization, startup, stopping, and uninstallation of plugins. The plugin management configuration file is fundamental for the plugin manager and plugins to work together correctly and achieve their intended functions and behaviors.

[0067] After generating the plugin management configuration file, the plugin manager first loads the plugins based on the location of the dynamic link library files of the plugin code in the plugin management configuration file.

[0068] As mentioned above, the plugin management configuration file includes the location of the dynamic link library (DLL) files for the plugin code. In some optional embodiments, the plugin manager preloads the plugin using a dynamic link library loading mechanism based on the plugin management configuration file. This includes: the plugin manager executing a preset DLL loading instruction based on the location of the DLL files for the plugin code, loading the DLL files into the memory of the desktop operating system. The preset DLL loading instruction could, for example, be executing the `dlopen()` function.

[0069] In some optional embodiments, the plugin manager executes a preset dynamic link library loading instruction based on the storage location of the dynamic link library file of the plugin's plugin code, and loads the dynamic link library file into the memory of the desktop operating system, including: sub-steps A1-A4.

[0070] In sub-step A1, the plugin manager initializes the first plugin list of plugins that need to be preloaded according to the plugin management configuration file.

[0071] When the plugin manager starts, it first creates an empty first plugin list, which is used to store information about the plugins that need to be loaded.

[0072] After the plugin manager receives the plugin configuration information and other data from the taskbar manager and generates a plugin management configuration file, it first updates the first plugin list based on the plugins that need to be preloaded and their information recorded in the configuration file. For example, it stores the names of the plugins, the location of their dynamic link library files, and their dependencies in the first plugin list.

[0073] In sub-step A2, the plugin manager checks whether the dynamic link library file corresponding to each plugin in the first plugin list exists, and checks whether the dependency library of each plugin in the first plugin list has been correctly linked according to the dependency relationship, and obtains the check result.

[0074] During the plugin preloading process, the plugin manager can sequentially check each plugin in the first plugin list, verifying whether the dynamic link library files of each plugin's code are in the specified storage location, and checking whether the dependency libraries required by each plugin's dependencies have been correctly installed and linked, obtaining the check results. Optionally, the "ldd plugin.so" command can be executed to view the libraries that a plugin depends on, i.e., the dependency libraries, and further confirm whether each dependency library has been correctly installed and linked to the desktop operating system.

[0075] In sub-step A3, in response to the check result indicating that the dynamic link library file corresponding to the plugin exists and the plugin's dependent libraries have been correctly linked, the plugin manager executes a preset dynamic link library loading instruction based on the storage location of the dynamic link library file of the plugin's plugin code, and loads the dynamic link library file into the memory of the desktop operating system.

[0076] In an optional embodiment, for a plugin1, if the dynamic link library file corresponding to plugin1 is found in a specified location on the desktop operating system (e.g., the location where the dynamic link library file of plugin1's plugin code is stored in the manager configuration file), then the dynamic link library file corresponding to plugin1 is considered to exist. Further, a preset command is executed to check whether the dependency libraries of plugin1 have been correctly linked. Optionally, the dependency libraries can be obtained according to the dependency list of plugin1 recorded in the manager configuration file, and the dependency library can be checked by executing a command such as `ldd plugin.so` to see if it has been correctly installed and linked. For specific commands and methods for querying whether a dynamic link library or static link library has been correctly installed and linked, please refer to the prior art; these will not be repeated in this embodiment.

[0077] If the dynamic link library file corresponding to plugin1 exists, and it is found that all the dependent libraries of plugin1 have been correctly installed and correctly linked to the desktop operating system, it means that plugin1 has the conditions for execution. The plugin manager executes the preset dynamic link library loading instruction based on the storage location of the dynamic link library file of the plugin code, and loads the dynamic link library file into the memory of the desktop operating system.

[0078] In sub-step A4, in response to the check result indicating that the dynamic link library file corresponding to the plugin does not exist or the plugin's dependent libraries are not correctly linked, the plugin manager removes the plugin's information from the first plugin list.

[0079] If the dynamic link library file corresponding to plugin1 does not exist, or if the dynamic link library file corresponding to plugin1 exists but not all of plugin1's dependent libraries are installed correctly, or if not all of plugin1's dependent libraries are correctly linked to the desktop operating system, then plugin1 will not be able to execute. Therefore, the plugin manager will skip loading plugin1 and remove plugin1's relevant information from the first plugin list.

[0080] In some embodiments of this application, the plugin manager can output loading error information to the taskbar manager to notify the taskbar manager to perform corresponding operations based on the plugin loading result, such as prompting the user that the plugin failed to load, the name of the missing plugin, etc.

[0081] Step 105: The plugin manager performs an instantiation operation on the pre-loaded plugins to obtain the plugin instances of the pre-loaded plugins.

[0082] After the aforementioned steps are performed, the plugin does not start executing; it merely loads the plugin's code into the desktop operating system's memory. Preloading the plugin's code into memory reduces the loading time of the plugin code during subsequent plugin execution.

[0083] Next, using the pre-loaded dynamic link library file of the plugin code, the addresses of the executable plugin's interface, methods, and events are obtained. Based on these addresses, a plugin object is instantiated and initialized to the initial state defined within the plugin code. The plugin object includes all of the plugin's methods and properties.

[0084] Based on the obtained addresses of the plugin interface, methods, and events, the specific method for instantiating the plugin object is described in the prior art and will not be repeated in this embodiment.

[0085] In some optional embodiments, the plugin manager performs an instantiation operation on the pre-loaded plugins to obtain plugin instances of the pre-loaded plugins, including: the plugin manager obtains a reference to the pre-loaded plugin and stores the reference to the plugin registry; the plugin manager obtains the addresses of the interface, methods, and events of the plugin corresponding to each reference according to the reference in the plugin registry, and instantiates the plugin object according to the addresses of the interface, methods, and events to obtain plugin instances of the pre-loaded plugins.

[0086] The reference to a preloaded plugin is the handle obtained when the plugin is preloaded, used to operate on the plugin. For example, the reference to a preloaded plugin is the return value of the dlopen() function when the plugin's dynamic link library file is loaded using the dlopen() function.

[0087] Then, the plugin manager executes the dlsym() function based on the reference in the plugin registry to read the addresses of the interface, methods, and events of the plugin corresponding to that reference.

[0088] After plugin preloading is complete, a reference is created for each preloaded plugin, and these references are stored in the "plugin registry". This allows for quick retrieval and operation of these plugins during subsequent plugin execution and management.

[0089] Step 106: The plugin manager registers the obtained plugin instance into the second plugin list.

[0090] In some alternative embodiments, the plugin manager can manage instantiated plugin objects by setting a second plugin list and a management engine, and provide the operation interfaces of the plugins in the second plugin list to the taskbar manager or other plugins for invocation. For example, the plugin's methods can be made available to the taskbar manager or other plugins for invocation.

[0091] When the plugin manager initially runs, the second plugin list is initialized to empty. Subsequently, as plugins are instantiated, plugin instances are continuously registered to this second plugin list. Each element in this second plugin list points to an instantiated plugin object.

[0092] The management engine is responsible for updating the second plugin list and processing data pushed by the taskbar management.

[0093] Step 107: The plugin manager schedules the plugin corresponding to the plugin instance to run based on the second plugin list.

[0094] In some optional embodiments, the plugin manager schedules the execution of the plugin corresponding to the plugin instance based on the second plugin list, including: the plugin manager schedules the execution of the plugin corresponding to the plugin instance based on the scheduling policy recorded in the plugin management configuration file.

[0095] For example, the management engine in the plugin manager iterates through the plugin instances in the second plugin list. For each plugin instance, based on the scheduling policy recorded in the plugin management configuration file, it checks whether its defined interfaces and methods meet the execution conditions constrained by the scheduling policy. If they do, the interface or method is executed; or, based on the triggering of an event, a specific plugin operation is executed. For example, if a user requests a specific function, the plugin manager will call the corresponding method of the plugin instance that provides that function to execute it.

[0096] For a specific example, the management engine in the plugin manager iterates through the second plugin list, checks each plugin instance, retrieves the scheduling policy for each plugin from the plugin management configuration file, and determines when and how to schedule the plugin instance's interface based on the determined scheduling policy. The scheduling policy includes, but is not limited to, any of the following: priority rules, time rules, event rules, etc. Optionally, if there is no scheduling policy in the plugin management configuration file, the time rule is used. After performing the above checks on each plugin instance, for plugin instances that are determined to meet the scheduling policy, the management engine calls the specific interface of that plugin instance to control the execution of the corresponding plugin. Finally, the management engine outputs the execution results of each plugin, as well as any possible error messages. This information needs to be correctly recorded and processed.

[0097] For example, if the plugin manager implements a time-driven scheduling strategy, then the optional plugin scheduling process is as follows:

[0098] Input: Current system time, a list of second-level plugins, and the next scheduled execution time for each plugin. The next scheduled execution time is calculated based on the scheduling strategy or the plugin execution order.

[0099] Scheduling process: The management engine iterates through the second plugin list, checking the next scheduled run time for each plugin. If this time is equal to or less than the current system time, the management engine calls the plugin's run() method and executes the plugin.

[0100] Output: The result of the plugin's execution, the new scheduled next run time, and possible error messages.

[0101] The management engine performs the above scheduling process for each plugin instance to ensure that all plugins that need to run can run on time.

[0102] For example, when a user's operation request or other system event is detected by the taskbar manager, the taskbar manager can directly call the methods of the plugin instances provided in the second plugin list to control the plugins to perform related operations.

[0103] The following example demonstrates how a plugin works.

[0104] Taking a weather forecast plugin as an example, this plugin can obtain weather information from the network and display it in a window on the desktop operating system's taskbar. Developers write the weather forecast plugin code according to the desktop operating system's interface specifications and compile it into a dynamic link library file, such as weatherPlugin.so. This dynamic link library file is then stored in a specific path on the desktop operating system. Simultaneously, developers need to write a plugin configuration file for the weather forecast plugin, for example, stored as weatherPlugin.ini. This configuration file will contain information such as: the plugin identifier, description, priority, execution method (synchronous / asynchronous), parameters, the location of the dynamic link library file, dependency list, and conflict list.

[0105] At the same time, developers need to write taskbar configuration files based on the plugin functions supported by the desktop operating system, describing the display position, order, and behavior information of plugins (such as weather forecast plugins) in the taskbar configuration files.

[0106] Simultaneously, the desktop operating system needs to be modified to add a plugin manager. This plugin manager provides a plugin operation interface through a second plugin list for the taskbar manager to call. The plugin manager reads the configuration file to obtain the plugins to be loaded, such as the configuration information of the weather forecast plugin, preloads it, and instantiates plugin objects to obtain plugin instances. These plugin instances are then registered in the second plugin list to provide a plugin operation interface to the caller.

[0107] The existing code that calls the weather forecast plugin in the taskbar manager is modified so that the taskbar manager calls the plugin operation interface provided by the plugin manager through the second plugin list.

[0108] After completing the above code development, compile the desktop operating system code to generate an executable file. Execute the executable file to start the desktop operating system.

[0109] During the desktop operating system startup process, the desktop operating system launches the taskbar manager and the plugin manager. The taskbar manager reads the taskbar configuration file to obtain the plugin name, display information, and behavior information of the plugins to be loaded (such as the weather forecast plugin). Based on the plugin name, it reads the plugin configuration file of the plugin to be loaded (such as the weatherPlugin.ini configuration file of the weather forecast plugin) to obtain the plugin configuration information. Then, it sends the plugin configuration information, the display information, and the behavior information to the plugin manager.

[0110] Next, the plugin manager generates a plugin management configuration file based on the plugin configuration information, display information, and behavior information sent by the taskbar manager, and begins preloading and instantiating plugins. For example, the name of the weather forecast plugin and the path to its .so file are added to the "Plugin Registry," and then the weatherPlugin.so dynamic link library file is loaded into memory using the dlopen() function. Next, the addresses of the weather forecast plugin's interfaces, methods, and events need to be obtained, which can be achieved using the dlsym() function. For example, if the weather forecast plugin has a "Get Weather" method, the address of that method can be obtained using this specified method. Finally, the weather forecast plugin object is instantiated and initialized to the initial state defined within the plugin code. At this point, the weather forecast plugin has been loaded into memory, and the plugin object has been created and initialized.

[0111] Then, the plugin manager creates a second list of plugins, where each element is an instantiated plugin object. For the weather forecast plugin, suppose there's an interface called `get_weather()`, which returns the current weather information after being called.

[0112] Then, a plugin object is created for the weather forecast plugin based on the plugin's configuration file, and an instance of this object is registered in the second plugin list. Simultaneously, the address of the weather forecast plugin's `get_weather` API is obtained, and this address will be called in subsequent steps.

[0113] Next, the plugin layer can be managed and scheduled. For example, when the taskbar manager detects a "refresh weather" event, it generates a corresponding interface event, which carries the weather forecast plugin's identifier and specific event data, and sends the event to the plugin manager. After receiving the event, the plugin manager responds by calling the get_weather() interface of the corresponding plugin instance in the second plugin list to obtain weather information, retrieves the return result, and then controls the weather forecast plugin to refresh its display based on the returned result.

[0114] In some optional embodiments, the plugin manager schedules the execution of the plugin corresponding to the plugin instance based on the second plugin list, including: the plugin manager traversing the second plugin list and obtaining the conflict list of the plugin corresponding to the current plugin instance in the plugin management configuration file; the plugin manager checking whether the plugin instance of the plugin in the conflict list is included in the second plugin list; in response to the plugin instance of the plugin in the conflict list being included in the second plugin list, the plugin manager scheduling the execution of the plugin corresponding to the current plugin instance according to the conflict handling strategy of the plugin corresponding to the current plugin instance in the plugin management configuration file; in response to the plugin instance of the plugin in the conflict list not being included in the second plugin list, the plugin manager scheduling the execution of the plugin corresponding to the current plugin instance according to the scheduling strategy of the plugin corresponding to the current plugin instance in the plugin management configuration file.

[0115] For example, the plugin manager iterates through the second plugin list. During the iteration, for the current plugin instance, it retrieves the conflict list of the plugins corresponding to the current plugin instance in the plugin management configuration file. The conflict list records the plugin identifiers of plugins that cannot run simultaneously with the current plugin. The plugin identifier can be a plugin name. The plugin manager further determines whether each plugin in the conflict list is running, that is, whether each plugin instance in the conflict list is recorded in the second plugin list.

[0116] If a plugin instance in the conflict list is included in the second plugin list, the plugin manager needs to schedule the plugin corresponding to the current plugin instance to run according to the conflict handling strategy in the plugin management configuration file. The conflict handling strategy is configured by the plugin developer or the desktop operating system developer. For example, the conflict handling strategy could be: abandoning execution after outputting a conflict warning, or determining whether to abandon or continue execution based on plugin priority. This embodiment does not limit the specific content of the conflict handling strategy.

[0117] If the plugin instance of the plugin in the conflict list is not included in the second plugin list, the plugin manager needs to schedule the plugin corresponding to the current plugin instance to run according to the scheduling policy of the plugin corresponding to the current plugin instance in the plugin management configuration file. The scheduling policy is configured by the plugin developer. For example, the scheduling policy can be to execute according to a preset period, or to execute after certain conditions are met. The specific content of the scheduling policy is not limited in this embodiment.

[0118] For a specific example, if two weather forecast plugins simultaneously attempt to write to the "Current Weather" field, the plugin manager needs to decide which plugin should execute first and how to handle the write requests from other plugins. The plugin manager's decision is based on the conflict handling strategy in its configuration file. If the conflict handling strategy is configured to execute according to priority, the plugin manager will schedule the higher-priority weather forecast plugin to write to the "Current Weather" field and ignore the write requests from lower-priority plugins.

[0119] Based on the foregoing embodiments, refer to Figure 2 In some optional embodiments of this application, after the taskbar manager and the plugin manager are started, the method further includes steps 108 to 110.

[0120] Step 108: The taskbar manager generates event data for the plugin running event based on the plugin identifier of the target plugin for the plugin running event of the preset operation type.

[0121] Optionally, the preset operation types include, but are not limited to, one or more of the following: plugin uninstallation operation type, plugin update operation type, and interactive behavior operation type; the interactive behavior operation type can be further subdivided according to specific operations, such as: click operation type, drag and drop operation type, refresh operation type, etc. For example, when a user uninstalls a plugin on the desktop operating system, the taskbar manager will detect a plugin running event of the plugin uninstallation operation type. As another example, when a user updates a plugin on the desktop operating system, the taskbar manager will detect a plugin running event of the plugin update operation type. Yet another example, when a user clicks on the interface of a plugin on the desktop operating system to interact with the plugin, the taskbar manager will detect a plugin running event of the interactive behavior operation type.

[0122] For details on how the taskbar manager obtains plugin running events, please refer to the prior art; these details will not be repeated in this application embodiment.

[0123] After the taskbar manager detects the aforementioned types of plugin running events, it further obtains the plugin targeted by the plugin running event as the target plugin, and generates event data for the plugin running event based on the plugin identifier of the target plugin. Optionally, the information included in the generated event data may differ for different types of plugin running events. For example, for a plugin uninstallation operation type plugin running event, the event data may only include the plugin identifier; for a plugin update operation type plugin running event, the event data may include the plugin identifier and plugin version information; as another example, for an interactive behavior operation type plugin running event, the event data may include the plugin identifier, the coordinate information corresponding to the interactive operation, input data, etc.

[0124] The information that needs to be included in the event data of different types of plugin running events is determined according to the specific plugin and the plugin's function. This application embodiment does not impose any restrictions on this.

[0125] Step 109: The taskbar manager pushes the plugin running event and the event data of the plugin running event to the plugin manager.

[0126] In some optional embodiments, the taskbar manager pushes the plugin running events and their event data to the plugin manager through pre-created shared memory. As mentioned earlier, the plugin manager creates shared memory for data and signal transmission. Furthermore, the plugin manager also provides a shared memory access interface for plugins or the taskbar manager to call. Optionally, the taskbar manager pushes the plugin running events and their event data to the plugin manager by calling the shared memory access interface provided by the plugin manager.

[0127] Step 110: The plugin manager controls the target plugin to run based on the plugin running event, the event data of the plugin running event, and / or the second plugin list.

[0128] The plugin manager can obtain events and event data pushed by the taskbar manager based on event monitoring or other mechanisms, and execute corresponding plugin scheduling.

[0129] In some optional embodiments, the plugin manager controls the execution of the target plugin based on the plugin execution event, the event data of the plugin execution event, and / or the second plugin list, including any one or more of the following scheduling operations.

[0130] In the first scenario, in response to a plugin runtime event matching the plugin uninstallation operation type, the plugin manager closes the target plugin, uninstalls the target plugin's dynamic link library files, and clears the target plugin's management data in the plugin manager. This management data includes: the plugin registry and plugin data associated with the target plugin in the second plugin list.

[0131] In some alternative embodiments, the plugin manager can close the target plugin by calling the uninstallation method provided by the target plugin. The uninstallation method can check dependencies to ensure that no references are currently calling the target plugin. Afterward, the plugin manager calls a specific function or method to uninstall the target plugin's code from memory, making its memory space reusable. For example, the `dlclose()` function can be used to uninstall the target plugin's dynamic link library (.so file). Specifically, the handle returned when calling `dlopen()` preloads the target plugin's dynamic link library is used as the parameter for the `dlclose()` function, which then uninstalls the target plugin's dynamic link library file.

[0132] Furthermore, the plugin manager also needs to delete the data of the corresponding entry of the target plugin in the plugin registry, delete the data of the plugin instance of the target plugin in the second plugin list, and delete the configuration information of the target plugin in the plugin manager configuration file.

[0133] In some optional embodiments, the plugin manager pushes the uninstallation result of the target plugin to the taskbar manager, which then executes the corresponding uninstallation prompt message.

[0134] The second method involves responding to the plugin runtime event and matching the plugin update operation type, by updating the dynamic link library file of the target plugin and updating the management data of the target plugin in the plugin manager based on the updated dynamic link library file.

[0135] In some optional embodiments, the plugin manager may first load the dynamic link library file of the updated version of the target plugin and instantiate the new version of the target plugin. After instantiation is complete, the plugin manager uninstalls the old version of the target plugin. After the old version of the target plugin is successfully uninstalled, the plugin manager starts and runs the plugin instance of the new version of the target plugin, thereby ensuring that only one version of the target plugin is running in the desktop operating system. This achieves the effect of updating the old version of the dynamic link library file with the new version of the plugin, and ensuring that the management data of the target plugin in the plugin registry, the second plugin list, and the plugin management configuration file matches the updated dynamic link library file. The plugin loading and uninstallation processes are described above and will not be repeated here.

[0136] The third method involves responding to the plugin running event by matching the interactive behavior operation type. Based on the event data of the plugin running event and the plugin instance in the second plugin list, the plugin manager calls the interface corresponding to the target plugin and the plugin behavior event to control the target plugin to run.

[0137] After receiving a plugin run event of an interactive behavior operation type, the plugin manager can determine which target plugin instance in the second plugin list needs to be called based on the plugin identifier. Then, based on the specific interactive behavior operation type of the plugin run event, it can further determine which interface of the target plugin instance to call. With the event data as input, it calls the interface of the determined target plugin instance, thereby controlling the target plugin to run and respond to the corresponding interactive behavior.

[0138] The plugin running method disclosed in this application is applied to a desktop operating system. It adds a plugin manager to the desktop operating system, which collaborates with the taskbar manager to control plugin operation. Specifically, after the taskbar manager and the plugin manager start, the taskbar manager obtains the association information of the plugins to be loaded based on plugin loading events; the taskbar manager generates event data corresponding to the plugin loading event based on the association information, and pushes the plugin loading event and the event data to the plugin manager; the plugin manager responds to the plugin loading event pushed by the taskbar manager, and updates the plugin management configuration file based on the event data corresponding to the plugin loading event; the plugin manager preloads plugins using a dynamic link library loading mechanism based on the plugin management configuration file; the plugin manager performs instantiation operations on the preloaded plugins to obtain plugin instances of the preloaded plugins; the plugin manager registers the obtained plugin instances to a second plugin list; and the plugin manager schedules the plugins corresponding to the plugin instances to run based on the second plugin list. This method pushes the plugin loading operation to the plugin manager in the form of an event by the taskbar manager. The plugin manager then loads the plugin as a dynamic link library and controls its operation. This decouples the plugin from the taskbar manager from both the program code and runtime perspectives. By creating an independent plugin manager, plugins can be clearly and explicitly configured, loaded, instantiated, and their lifecycle managed. This separation of plugin management and taskbar management functions reduces system complexity and maintenance difficulty, thereby improving the stability of the taskbar in the desktop operating system.

[0139] On the other hand, by setting up a plugin manager within the desktop operating system, plugins exist as independent dynamic link libraries. The plugin manager loads, updates, and uninstalls plugins as needed, resulting in faster system response and thus optimizing the user experience. Furthermore, because plugins and the main desktop operating system are independent, even if a plugin malfunctions, it will not affect the main system, contributing to improved system security.

[0140] The plugin manager manages the dependencies and conflicts between plugins and executes plugin scheduling strategies to make plugins run more orderly and efficiently, which helps improve system stability.

[0141] Furthermore, by preloading plugins, creating plugin objects, and instantiating plugins, allocating corresponding space in memory for each plugin can significantly improve plugin loading speed and enhance system response speed.

[0142] like Figure 3 As shown in the embodiment of this application, a desktop operating system 30 is disclosed, which includes a taskbar manager 310 and a plugin manager 320.

[0143] The taskbar manager 310 is used to obtain the associated information of the plugin to be loaded based on the plugin loading event.

[0144] The taskbar manager 310 is also used to generate event data corresponding to the plugin loading event based on the association information, and push the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager.

[0145] The plugin manager 320 is used to respond to the plugin loading event pushed by the taskbar manager and update the plugin management configuration file according to the event data corresponding to the plugin loading event.

[0146] The plugin manager 320 is also used to preload plugins according to the plugin management configuration file using a dynamic link library loading mechanism, and to perform an instantiation operation on the preloaded plugins to obtain plugin instances of the preloaded plugins, and to register the obtained plugin instances to a second plugin list.

[0147] The plugin manager 320 is also used to schedule the execution of the plugin corresponding to the plugin instance based on the second plugin list.

[0148] Optionally, the preset plugin loading event can be an event triggered by a plugin loading operation; the associated information includes, but is not limited to, one or more of the following: plugin identifier, plugin configuration information, display information, and behavior information.

[0149] The plugin code for a plugin loaded in a desktop operating system, as disclosed in this application, needs to be compiled into a dynamic link library. Therefore, the plugin can be implemented using C or C++, and the plugin's program code can be compiled into a dynamic link library, i.e., a .so format library file.

[0150] Furthermore, the plugin needs to be developed in accordance with the software development specifications of the desktop operating system and provide a set of interfaces that conform to the plugin manager standard. These interfaces are the main way for the plugin manager and the plugin to communicate, so that the written plugin code can be loaded, called and executed by the plugin manager in the desktop operating system.

[0151] Each plugin needs to provide a plugin configuration file, which must include information such as plugin identifier, description, execution method, parameters, file path, plugin scheduling strategy, dependency list, conflict list, and priority. This plugin configuration file must be readable by the plugin manager and must support updates.

[0152] This application does not limit the specific functions or development process of the plugin.

[0153] The desktop operating system disclosed in this application embodiment, wherein the specific implementation of the taskbar manager 310 refers to the prior art, the difference being that the management of plug-ins is decoupled.

[0154] The taskbar manager 310 manages the taskbar's own behavior and, in conjunction with the plugin manager 320, manages plugins. This system architecture design ensures the basic functionality of the taskbar while optimizing plugin management and updates, thus improving the overall efficiency and stability of the desktop operating system.

[0155] For example, the taskbar manager 310 is used for window management, task switching management, system status display and notifications, etc. As another example, the taskbar manager 310 is used, through the plugin manager 320, to manage the loading, updating, uninstallation, execution, and display of plugins, as well as the interaction between plugins and the user, and between plugins and the operating system.

[0156] The taskbar manager 310 obtains the association information of the plugin to be loaded based on the plugin loading event, generates event data corresponding to the plugin loading event according to the association information, and pushes the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager. For a detailed implementation of this method, please refer to the description in the plugin running method embodiment below, which will not be repeated here.

[0157] To achieve the above functionality, the existing taskbar manager needs to be modified as follows:

[0158] (1) Modify the existing technology where the plugin code is directly embedded into the code of the taskbar manager to load the plugin, so that the taskbar manager calls the interface provided by the plugin manager to load and manage the plugin.

[0159] (2) Modify the existing technology of processing plugin events serially by the taskbar manager, such as loading and processing each plugin event in sequence, to: processing plugin events in parallel by the plugin manager to achieve more efficient plugin management.

[0160] (3) Modify the logic in the existing technology that the taskbar manager calls the plugin to handle user interface operations to: unify the logic that the plugin manager calls the plugin to handle user interface operations.

[0161] (4) The taskbar manager needs to add a new plugin handling mechanism to push plugin addresses to the plugin manager, which will then handle plugin dependencies and updates. The taskbar manager only needs to call the corresponding interfaces provided by the plugin manager.

[0162] For a specific example, suppose there's a clock widget on the taskbar that displays the current time. Before the modification, this clock widget was directly embedded in the Taskbar Manager, loading and running automatically upon Taskbar Manager startup. When the clock widget needed updating or encountered errors, the Taskbar Manager's code had to be modified. After the modification to the Taskbar Manager, the clock widget became an independent dynamic link library file with its own configuration file and interface. User interface operations are no longer handled directly by the Taskbar Manager but are instead accomplished by calling the widget manager's interface. This way, the Taskbar Manager no longer needs to worry about clock widget updates and error handling; these tasks are handled by the widget manager. Furthermore, when loading widgets, the Taskbar Manager no longer processes them sequentially but can handle multiple widgets simultaneously, improving efficiency.

[0163] After the above modifications, the taskbar manager 310 interacts with the plug-in manager 320 via shared memory to exchange data and / or control signals.

[0164] For example, pushing the plugin loading event and its corresponding event data to the plugin manager includes: the taskbar manager storing the plugin loading event and its corresponding event data in the shared memory; and the plugin manager retrieving the plugin loading event and its corresponding event data from the shared memory. The shared memory is created by the plugin manager after startup.

[0165] The taskbar manager 310 is also used to generate event data for the plugin running event based on the plugin identifier of the target plugin for a preset operation type of plugin running event; and to push the plugin running event and the event data of the plugin running event to the plugin manager.

[0166] Accordingly, the plugin manager 320 is used to control the operation of the target plugin based on the plugin running event, the event data of the plugin running event, and / or the second plugin list.

[0167] The plugin manager 320 controls the operation of the target plugin based on the plugin running event, the event data of the plugin running event, and / or the second plugin list. For a specific implementation method, please refer to the description in the plugin running method embodiment below, which will not be repeated here.

[0168] The following is combined Figure 4 The logical relationship between the taskbar manager 310 and the plugin manager 320 is shown, and the specific implementation of the plugin manager 320 is further explained.

[0169] like Figure 4 As shown, the taskbar manager 310 and the plugin manager 320 transmit data and signals through an interface. The taskbar manager 310 needs to manage the plugins displayed on the taskbar. Therefore, it needs to obtain the plugin identification, display information, behavior information, and other plugin association information of the plugins to be loaded through the taskbar configuration file, and push the above information to the plugin manager 320 through the interface provided by the plugin manager 320.

[0170] Taskbar Manager 310 pushes corresponding events and event data to Plugin Manager 320 through the interface provided by Plugin Manager 320 based on events related to plugins. As mentioned earlier, the events responded to by Taskbar Manager 310 include, but are not limited to: plugin loading events and plugin running events of preset operation types.

[0171] In some optional embodiments, the taskbar manager 310 is also used to receive signals and / or data returned by the plugin manager 320 through an interface provided by the plugin manager 320, and to perform window operations based on the returned signals and / or data. For example, if the taskbar manager 310 receives a plugin uninstallation result from the plugin manager 320, it deletes the icon of the corresponding plugin from the taskbar.

[0172] The plugin manager 320, as an independent module of the desktop operating system that works in conjunction with the taskbar manager 310, requires the development of program code to implement various functions of the plugin manager 320. The program code for various functions of the plugin manager 320 will be compiled into the executable program of the desktop operating system, so that after the desktop operating system is started, the plugin manager 320 can manage plugins and control plugin operation based on the events and data called or pushed by the taskbar manager 310.

[0173] The plugin manager 320 responds to the plugin loading event pushed by the taskbar manager and updates the plugin management configuration file according to the event data corresponding to the plugin loading event. For details on the specific implementation of this method, please refer to the relevant description below, which will not be repeated here.

[0174] The Plugin Manager 320 manages plugin management configuration files to preload plugins based on the storage location of dynamic link library files in the plugin management configuration file, and to schedule plugin execution based on configured plugin execution methods, priorities, dependency lists, conflict lists, scheduling strategies, conflict handling strategies, and other data during plugin operation.

[0175] The plugin manager 320 preloads plugins according to the plugin management configuration file using a dynamic link library loading mechanism, and performs an instantiation operation on the preloaded plugins to obtain plugin instances of the preloaded plugins. The specific implementation of registering the obtained plugin instances to the second plugin list is described in the relevant description below, and will not be repeated here.

[0176] During the instantiation process of the pre-loaded plugin by the plugin manager 320, in obtaining the plugin instance of the pre-loaded plugin, the plugin manager 320 obtains a reference to the pre-loaded plugin and stores the reference in the plugin registry. Then, based on the references in the plugin registry, the plugin manager 320 obtains the addresses of the interface, methods, and events corresponding to each reference, and instantiates the plugin object based on the addresses of the interface, methods, and events to obtain the plugin instance of the pre-loaded plugin. The plugin registry stores plugin references, through which the addresses of the plugin's interface, methods, and events can be obtained to run the corresponding plugin.

[0177] The management engine of Plugin Manager 320 is based on management data in the plugin registry, the second plugin list, and the plugin management configuration file. It responds to events pushed by the taskbar manager and API calls to manage plugin operation.

[0178] For example, the plugin manager 320 is used to schedule the execution of the plugin corresponding to the plugin instance based on the second plugin list.

[0179] For example, the plugin manager 320 is used to control the operation of the target plugin based on the plugin running event, the event data of the plugin running event, and / or the second plugin list.

[0180] For a detailed description of the implementation of the plugin manager 320, please refer to the relevant description in the embodiments below, which will not be repeated here.

[0181] In existing desktop operating systems, the taskbar manager loads plugins by directly embedding the plugin code into the taskbar manager's code, making plugin installation, updates, and uninstallation inflexible. Furthermore, plugin stability directly impacts taskbar performance stability. The desktop operating system disclosed in this application improves the system architecture by adding a plugin manager, migrating plugin management tasks from the taskbar manager to the plugin manager. Plugin code is developed and compiled independently from the desktop operating system code, and plugin code is dynamically loaded. Correspondingly, to address this system architecture improvement, the plugin management process is redesigned. The plugin manager provides an interface for the taskbar manager to call, enabling the taskbar manager to manage plugins. Furthermore, the plugin manager executes corresponding plugin management operations based on events or interface calls pushed by the taskbar manager. Plugin running status does not affect taskbar manager execution, further improving the stability of the desktop operating system. Simultaneously, the plugin code is loaded into the desktop operating system via a dynamic link library, not bound to the taskbar manager during compilation, making plugin installation, updates, and uninstallation more flexible.

[0182] Furthermore, the plugin manager executes corresponding plugin management operations based on events or API calls pushed by the taskbar manager. Different plugins can run in parallel, achieving more efficient plugin management and improving the flexibility of interaction with plugins.

[0183] This application also discloses a plug-in running device applied to a desktop operating system, the desktop operating system including a taskbar manager and a plug-in manager. For example... Figure 5 As shown, the device includes:

[0184] The module 510 for obtaining the association information of plugins to be loaded is used to obtain the association information of plugins to be loaded based on the plugin loading event after the taskbar manager and the plugin manager are started.

[0185] The event push module 520 is used by the taskbar manager to generate event data corresponding to the plugin loading event based on the association information, and push the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager.

[0186] The plugin management configuration file update module 530 is used by the plugin manager to update the plugin management configuration file according to the event data corresponding to the plugin loading event in response to the plugin loading event pushed by the taskbar manager.

[0187] The plugin preloading module 540 is used by the plugin manager to preload plugins according to the plugin management configuration file using a dynamic link library loading mechanism.

[0188] The plugin instance acquisition module 550 is used by the plugin manager to perform an instantiation operation on the pre-loaded plugins and obtain the plugin instances of the pre-loaded plugins.

[0189] The plugin instance registration module 560 is used by the plugin manager to register the obtained plugin instance into the second plugin list;

[0190] The plugin execution module 570 is used by the plugin manager to schedule the execution of the plugin corresponding to the plugin instance based on the second plugin list.

[0191] Optionally, the plugin management configuration file includes: the location of the dynamic link library file of the plugin code; the plugin preloading module 540 is further used for:

[0192] The plugin manager executes a preset dynamic link library loading instruction based on the location of the dynamic link library file of the plugin's plugin code, and loads the dynamic link library file into the memory of the desktop operating system.

[0193] Optionally, the plugin management configuration file also includes: plugin dependencies; the plugin manager, based on the location of the dynamic link library file of the plugin's plugin code, executes a preset dynamic link library loading instruction to load the dynamic link library file into the memory of the desktop operating system, including:

[0194] The plugin manager initializes the first plugin list of plugins that need to be preloaded according to the plugin management configuration file;

[0195] The plugin manager checks whether the dynamic link library file corresponding to each plugin in the first plugin list exists, and checks whether the dependency library of each plugin in the first plugin list has been correctly linked according to the dependency relationship, and obtains the check result.

[0196] In response to the inspection result indicating that the dynamic link library file corresponding to the plugin exists and the plugin's dependent libraries have been correctly linked, the plugin manager executes a preset dynamic link library loading instruction based on the storage location of the dynamic link library file of the plugin's plugin code, and loads the dynamic link library file into the memory of the desktop operating system.

[0197] In response to the inspection result indicating that the dynamic link library file corresponding to the plugin does not exist or the plugin's dependent libraries are not correctly linked, the plugin manager removes the plugin's information from the first plugin list.

[0198] Optionally, the plugin instance acquisition module 550 is further used for:

[0199] The plugin manager obtains a reference to the pre-loaded plugin and stores the reference in the plugin registry;

[0200] The plugin manager obtains the addresses of the interface, methods, and events of the plugin corresponding to each reference based on the references in the plugin registry, and instantiates the plugin object based on the addresses of the interface, methods, and events to obtain the plugin instance of the pre-loaded plugin.

[0201] Optionally, after the taskbar manager and the plugin manager are started, the device further includes:

[0202] A shared memory creation module (not shown in the figure) is used by the plug-in manager to create shared memory;

[0203] The step of pushing the plugin loading event and the corresponding event data to the plugin manager includes:

[0204] The taskbar manager stores the plugin loading event and the event data corresponding to the plugin loading event in the shared memory;

[0205] The plugin manager retrieves the plugin loading event and the corresponding event data from the shared memory.

[0206] Optionally, the plug-in running module 570 is further configured to:

[0207] The plugin manager traverses the second plugin list and obtains the conflict list of the plugins corresponding to the current plugin instance in the plugin management configuration file.

[0208] The plugin manager checks whether the plugin instance of the plugin in the conflict list is included in the second plugin list;

[0209] In response to the fact that the plugin instance of the plugin in the conflict list is included in the second plugin list, the plugin manager schedules the plugin corresponding to the current plugin instance to run according to the conflict handling strategy of the plugin corresponding to the current plugin instance in the plugin management configuration file.

[0210] If a plugin instance in the conflict list is not included in the second plugin list, the plugin manager schedules the plugin corresponding to the current plugin instance to run according to the scheduling policy of the plugin corresponding to the current plugin instance in the plugin management configuration file.

[0211] Optionally, after the taskbar manager and the plugin manager are launched, such as Figure 6 As shown, the device further includes:

[0212] The plugin running event push module 580 is used by the taskbar manager to generate event data of the plugin running event based on the plugin identifier of the target plugin for the preset operation type of the plugin running event.

[0213] The plugin running event push module 580 is also used for the taskbar manager to push the plugin running event and the event data of the plugin running event to the plugin manager;

[0214] The plugin operation control module 590 is used by the plugin manager to control the operation of the target plugin based on the plugin operation event, the event data of the plugin operation event, and / or the second plugin list.

[0215] Optionally, the plugin manager controls the execution of the target plugin based on the plugin execution event, the event data of the plugin execution event, and / or the second plugin list, including:

[0216] In response to the plugin running event matching the plugin uninstallation operation type, the plugin manager closes the target plugin, uninstalls the target plugin's dynamic link library files, and clears the target plugin's management data in the plugin manager;

[0217] In response to the plugin runtime event matching the plugin update operation type, the plugin manager updates the dynamic link library file of the target plugin, and updates the management data of the target plugin in the plugin manager based on the updated dynamic link library file;

[0218] In response to the plugin running event matching the interactive behavior operation type, the plugin manager, based on the event data of the plugin running event and the plugin instance in the second plugin list, calls the interface corresponding to the target plugin and the plugin behavior event to control the target plugin to run.

[0219] The plug-in running device disclosed in this application is used to implement the plug-in running method described in this application. The specific implementation methods of each module of the device will not be repeated here, but can be found in the specific implementation methods of the corresponding steps in the method embodiments.

[0220] The plug-in running device disclosed in this application adds a plug-in manager to the desktop operating system, which collaborates with the taskbar manager to control plug-in operation. Specifically, after the taskbar manager and the plug-in manager are started, the taskbar manager obtains the association information of the plug-in to be loaded based on the plug-in loading event; the taskbar manager generates event data corresponding to the plug-in loading event according to the association information, and pushes the plug-in loading event and the event data corresponding to the plug-in loading event to the plug-in manager; the plug-in manager responds to the plug-in loading event pushed by the taskbar manager, and updates the plug-in management configuration file according to the event data corresponding to the plug-in loading event; the plug-in manager preloads plug-ins using a dynamic link library loading mechanism according to the plug-in management configuration file; the plug-in manager performs an instantiation operation on the preloaded plug-in to obtain the plug-in instance of the preloaded plug-in; the plug-in manager registers the obtained plug-in instance to a second plug-in list; and the plug-in manager schedules the plug-in corresponding to the plug-in instance to run based on the second plug-in list. This device pushes plugin loading operations to the plugin manager in the form of events through the taskbar manager. The plugin manager then loads the plugin as a dynamic link library and controls its operation. This decouples the plugin from the taskbar manager from both the program code and runtime perspectives. By creating an independent plugin manager, plugins can be clearly and explicitly configured, loaded, instantiated, and their lifecycle managed. This separation of plugin management and taskbar management functions reduces system complexity and maintenance difficulty, thereby improving the stability of the taskbar in the desktop operating system.

[0221] On the other hand, by setting up a plugin manager within the desktop operating system, plugins exist as independent dynamic link libraries. The plugin manager loads, updates, and uninstalls plugins as needed, resulting in faster system response and thus optimizing the user experience. Furthermore, because plugins and the main desktop operating system are independent, even if a plugin malfunctions, it will not affect the main system, contributing to improved system security.

[0222] The plugin manager manages the dependencies and conflicts between plugins and executes plugin scheduling strategies to make plugins run more orderly and efficiently, which helps improve system stability.

[0223] Furthermore, by preloading plugins, creating plugin objects, and instantiating plugins, allocating corresponding space in memory for each plugin can significantly improve plugin loading speed and enhance system response speed.

[0224] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus embodiments, since they are fundamentally similar to the method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0225] The above provides a detailed description of a plug-in running method and apparatus provided by this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method of this application and its core idea. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the idea of ​​this application. Therefore, the content of this specification should not be construed as a limitation of this application.

[0226] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0227] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the electronic device according to the embodiments of this application. This application can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such a program implementing this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0228] For example, Figure 7An electronic device is shown that can implement the methods according to this application. The electronic device may be a PC, mobile terminal, personal digital assistant, tablet computer, etc. The electronic device conventionally includes a processor 710 and a memory 720, and program code 730 stored in the memory 720 and executable on the processor 710. When the processor 710 executes the program code 730, it implements the methods described in the above embodiments. The memory 720 may be a computer program product or a computer-readable medium. The memory 720 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. The memory 720 has a storage space 7201 for the program code 730 of a computer program for performing any of the method steps described above. For example, the storage space 7201 for the program code 730 may include various computer programs for implementing the various steps in the above methods. The program code 730 is computer-readable code. These computer programs can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, CDs, memory cards, or floppy disks. The computer program includes computer-readable code that, when executed on an electronic device, causes the electronic device to perform the method according to the above embodiments.

[0229] This application also discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the plug-in running method as described in this application.

[0230] Such a computer program product can be a computer-readable storage medium, which can have the same characteristics as... Figure 7 The memory 720 in the illustrated electronic device is similarly arranged with storage segments, storage spaces, etc. Program code can be stored, for example, in a compressed form on the computer-readable storage medium. The computer-readable storage medium is typically as shown in the reference... Figure 8 The portable or fixed storage unit is described above. Typically, the storage unit includes computer-readable code 730', which is code read by a processor and, when executed by the processor, implements the various steps of the method described above.

[0231] The terms "an embodiment," "embodiment," or "one or more embodiments" as used herein mean that a particular feature, structure, or characteristic described in connection with an embodiment is included in at least one embodiment of this application. Furthermore, please note that the examples of the phrase "in one embodiment" do not necessarily all refer to the same embodiment.

[0232] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0233] In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0234] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A plug-in running method, applied to a desktop operating system, characterized in that, The desktop operating system includes a taskbar manager and a plugin manager, and the method includes: After the taskbar manager and the plugin manager are started, the taskbar manager obtains the association information of the plugins to be loaded based on the plugin loading event; The taskbar manager generates event data corresponding to the plugin loading event based on the association information, and pushes the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager. The plugin manager responds to the plugin loading event pushed by the taskbar manager and updates the plugin management configuration file according to the event data corresponding to the plugin loading event; The plugin manager preloads plugins using a dynamic link library loading mechanism based on the plugin management configuration file. The plugin manager performs an instantiation operation on the pre-loaded plugins to obtain the plugin instances of the pre-loaded plugins; The plugin manager will register the obtained plugin instance into the second plugin list; The plugin manager schedules the execution of the plugins corresponding to the plugin instances based on the second plugin list.

2. The method according to claim 1, characterized in that, The plugin management configuration file includes: the location of the dynamic link library file of the plugin code; The plugin manager preloads plugins using a dynamic link library loading mechanism based on the plugin management configuration file, including: The plugin manager executes a preset dynamic link library loading instruction based on the location of the dynamic link library file of the plugin's plugin code, and loads the dynamic link library file into the memory of the desktop operating system.

3. The method according to claim 2, characterized in that, The plugin management configuration file also includes: plugin dependencies; The plugin manager, based on the location of the dynamic link library files of the plugin's plugin code, executes a preset dynamic link library loading instruction to load the dynamic link library files into the memory of the desktop operating system, including: The plugin manager initializes the first plugin list of plugins that need to be preloaded according to the plugin management configuration file; The plugin manager checks whether the dynamic link library file corresponding to each plugin in the first plugin list exists, and checks whether the dependency library of each plugin in the first plugin list has been correctly linked according to the dependency relationship, and obtains the check result. In response to the inspection result indicating that the dynamic link library file corresponding to the plugin exists and the plugin's dependent libraries have been correctly linked, the plugin manager executes a preset dynamic link library loading instruction based on the storage location of the dynamic link library file of the plugin's plugin code, and loads the dynamic link library file into the memory of the desktop operating system. In response to the inspection result indicating that the dynamic link library file corresponding to the plugin does not exist or the plugin's dependent libraries are not correctly linked, the plugin manager removes the plugin's information from the first plugin list.

4. The method according to claim 1, characterized in that, The plugin manager performs instantiation operations on pre-loaded plugins to obtain plugin instances of the pre-loaded plugins, including: The plugin manager obtains a reference to the pre-loaded plugin and stores the reference in the plugin registry; The plugin manager obtains the addresses of the interface, methods, and events of the plugin corresponding to each reference based on the references in the plugin registry, and instantiates the plugin object based on the addresses of the interface, methods, and events to obtain the plugin instance of the pre-loaded plugin.

5. The method according to claim 1, characterized in that, After the taskbar manager and the plugin manager are launched, the following are also included: The plug-in manager creates shared memory; The step of pushing the plugin loading event and the corresponding event data to the plugin manager includes: The taskbar manager stores the plugin loading event and the event data corresponding to the plugin loading event in the shared memory; The plugin manager retrieves the plugin loading event and the corresponding event data from the shared memory.

6. The method according to claim 1, characterized in that, The plugin manager, based on the second plugin list, schedules the execution of the plugins corresponding to the plugin instances, including: The plugin manager traverses the second plugin list and obtains the conflict list of the plugins corresponding to the current plugin instance in the plugin management configuration file. The plugin manager checks whether the plugin instance of the plugin in the conflict list is included in the second plugin list; In response to the fact that the plugin instance of the plugin in the conflict list is included in the second plugin list, the plugin manager schedules the plugin corresponding to the current plugin instance to run according to the conflict handling strategy of the plugin corresponding to the current plugin instance in the plugin management configuration file. If a plugin instance in the conflict list is not included in the second plugin list, the plugin manager schedules the plugin corresponding to the current plugin instance to run according to the scheduling policy of the plugin corresponding to the current plugin instance in the plugin management configuration file.

7. The method according to claim 1, characterized in that, After the taskbar manager and the plugin manager are launched, the method further includes: The taskbar manager generates event data for the plugin running events based on the plugin identifier of the target plugin for the preset operation type of the plugin running event; The taskbar manager pushes the plugin running event and the event data of the plugin running event to the plugin manager; The plugin manager controls the execution of the target plugin based on the plugin execution event, the event data of the plugin execution event, and / or the second plugin list.

8. The method according to claim 7, characterized in that, The plugin manager controls the execution of the target plugin based on the plugin execution event, the event data of the plugin execution event, and / or the second plugin list, including: In response to the plugin running event matching the plugin uninstallation operation type, the plugin manager closes the target plugin, uninstalls the target plugin's dynamic link library files, and clears the target plugin's management data in the plugin manager; In response to the plugin runtime event matching the plugin update operation type, the plugin manager updates the dynamic link library file of the target plugin, and updates the management data of the target plugin in the plugin manager based on the updated dynamic link library file; In response to the plugin running event matching the interactive behavior operation type, the plugin manager, based on the event data of the plugin running event and the plugin instance in the second plugin list, calls the interface corresponding to the target plugin and the plugin behavior event to control the target plugin to run.

9. A plug-in runtime device, applied to a desktop operating system, characterized in that, The desktop operating system includes a taskbar manager and a widget manager, and the device includes: The module for obtaining the association information of plugins to be loaded is used to obtain the association information of plugins to be loaded based on the plugin loading event after the taskbar manager and the plugin manager are started. The event push module is used by the taskbar manager to generate event data corresponding to the plugin loading event based on the association information, and push the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager. The plugin management configuration file update module is used by the plugin manager to update the plugin management configuration file according to the event data corresponding to the plugin loading event in response to the plugin loading event pushed by the taskbar manager. The plugin preloading module is used by the plugin manager to preload plugins according to the plugin management configuration file using a dynamic link library loading mechanism. The plugin instance acquisition module is used by the plugin manager to perform an instantiation operation on the pre-loaded plugins and obtain the plugin instances of the pre-loaded plugins. The plugin instance registration module is used by the plugin manager to register the obtained plugin instances into the second plugin list; The plugin execution module is used by the plugin manager to schedule the execution of the plugin corresponding to the plugin instance based on the second plugin list.

10. A desktop operating system, characterized in that, include: Taskbar Manager and Plugin Manager, among which, The taskbar manager is used to obtain the associated information of the plugins to be loaded based on the plugin loading event; The taskbar manager is also used to generate event data corresponding to the plugin loading event based on the association information, and push the plugin loading event and the event data corresponding to the plugin loading event to the plugin manager; The plugin manager is used to respond to the plugin loading event pushed by the taskbar manager and update the plugin management configuration file according to the event data corresponding to the plugin loading event. The plugin manager is also used to preload plugins according to the plugin management configuration file using a dynamic link library loading mechanism, and to perform an instantiation operation on the preloaded plugins to obtain plugin instances of the preloaded plugins, and to register the obtained plugin instances to a second plugin list. The plugin manager is also used to schedule the execution of the plugin corresponding to the plugin instance based on the second plugin list.

11. An electronic device, comprising a memory, a processor, and program code stored in the memory and executable on the processor, characterized in that, When the processor executes the program code, it implements the plug-in running method according to any one of claims 1 to 8.

12. A computer-readable storage medium having program code stored thereon, characterized in that, When the program code is executed by the processor, it implements the steps of the plug-in running method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Taskbar plug-in loading method for automatically processing exceptions under Linux

    CN108304226A

  • Service method and device based on micro-core model plug-in mode, equipment and storage medium

    CN111897599A