Method and system for updating interface plug-in and demonstrator
By employing parallel operation of new and old plugins in industrial control software, combined with a foreground/background switching mechanism, the problem of production interruption caused by plugin updates was solved. Dynamic updates and rapid rollback of plugins were achieved, ensuring production continuity and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU HIKROBOT TECH CO LTD
- Filing Date
- 2026-01-06
- Publication Date
- 2026-04-28
AI Technical Summary
Traditional industrial control software plugin updates cause the main program to restart, affecting production continuity and making it difficult to achieve a quick rollback.
By loading the new version of the plugin in the background of the host computer and running it in parallel with the old version, combined with the foreground-background switching mechanism, the plugin can be dynamically updated. The new and old plugins keep the data synchronized when switching between the foreground and background, avoiding the main program restarting and the plugin white screen and lag.
Ensure the continuity of the production process, avoid interruptions when switching plugins, support rapid rollback and A/B testing, and improve plugin development efficiency.
Smart Images

Figure CN121934860A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial control software technology, and in particular to a method, system and teach pendant for updating interface plugins. Background Technology
[0002] In industrial control software, upgrades and functional expansions of process packages are typically achieved through plug-in design. This approach can improve the development and maintenance efficiency of industrial control software.
[0003] In daily use, due to needs such as function iteration, process optimization, hardware adaptation, and main program version upgrade compatibility, it is inevitable to update plugins periodically or irregularly. Traditional plugin update methods typically involve directly replacing the old plugin after version number verification, followed by a restart of the industrial control software for the changes to take effect. This process is relatively cumbersome, and if the main program of the industrial control software starts slowly, it will consume even more time. This plugin update method is prone to production interruptions due to main program restarts, potentially causing industrial production line shutdowns and affecting production continuity. Furthermore, when rollback is required, the process of restarting the industrial control software must be repeated, resulting in low rollback efficiency.
[0004] Therefore, it is necessary to provide a plugin update method that enables dynamic plugin updates and rapid rollback. Summary of the Invention
[0005] The purpose of this application is to solve the problem that traditional industrial control software plug-in updates cause the main program to restart, affecting production continuity, and that traditional industrial control software plug-in update methods are difficult to roll back quickly.
[0006] Based on the above objectives, in a first aspect, this application provides a method for updating an interface plugin, which is applied to a host computer and includes the following steps: The process package is parsed to obtain the updated configuration information of the specified plugin; Upon receiving the plugin update instruction, and based on the update configuration information, initialize and load the second version plugin in the second layer container in the host computer background. Update the plugin data of the second version plugin in the background. The plugin data includes: plugin configuration information obtained from receiving the configuration of the first version plugin, and feedback data from the lower computer executing the function of the first version plugin. The first version plugin is located in the first layer container of the host computer front-end display interface. The host computer displays an interface that switches between the first and second layer containers. When the second layer container is in the foreground, control of the lower-level device is transferred to the second version plugin. The elements in the host computer display are modified according to the updated plugin data of the second version plugin. The first version plugin runs silently in the background. The plugin data of the first version plugin is updated according to the plugin configuration information obtained from the second version plugin configuration and the feedback data of the lower-level device executing the second version plugin function. If there is a need to roll back the plugin, the foreground / background switching operation between the first layer container and the second layer container is executed again, and the control of the lower-level machine is transferred to the first version plugin. The upper-level machine display interface is modified according to the plugin data updated during the background operation of the first version plugin.
[0007] Furthermore, the update methods also include: When the second version of the plugin is initialized and loaded, the plugin configuration information of the first version of the plugin is pushed. The second-version plugin checks the version information of the obtained plugin configuration information. If the version of the plugin configuration information is higher than the version of the second-version plugin, the second-version plugin extracts the parameters it needs from the obtained plugin configuration information as its own configuration parameters. If the version of the plugin configuration information is lower than the version of the second-version plugin, the second-version plugin decides to use the default parameters or the parameters obtained by converting through the preset conversion relationship to replace the missing configuration parameters based on its own version information.
[0008] Furthermore, the update methods also include: Set up a first cache area and store the updated configuration information obtained from parsing the process package into the first cache area according to the plugin name; During plugin initialization and loading, a callback function is registered with the module that manages and updates configuration information. Based on the registration list, a mapping relationship between plugin names and plugin versions is generated. When the plugin configuration information stored under any plugin name changes, the layer container state corresponding to different plugin versions of the plugin name is obtained according to the mapping relationship, and the updated plugin configuration information is pushed to the plugins in the background of the layer container to realize the synchronization of configuration information of the background plugins.
[0009] Furthermore, the update methods also include: When the host computer display interface performs a foreground / background switching operation between the first and second layer containers, and the second layer container switches from the host computer background to the foreground display interface, the second version plugin stops receiving updated plugin configuration information from the first cache. Establish communication between the second-version plugin and the human-computer interaction port, and modify the update configuration information for the second-version plugin through the human-computer interaction port; The configuration write permissions of the first cache area are transferred to the second version plugin. The second version plugin will update the configuration information and write it to the first cache area for the plugins switched to the background to synchronize parameter configurations.
[0010] Furthermore, the update methods also include: A second buffer is set up in the host computer, and the second buffer is configured to receive feedback data from the lower computer when executing plug-in functions; During plugin initialization, the plugins are registered in the second buffer, and the lower-level machine feedback data in the second buffer is pushed to the registered plugins to improve their data information.
[0011] Furthermore, the update methods also include: The process package is parsed, and the parsing results are checked for completeness and security. If the checks pass, it is determined whether the process package already exists in the host computer. If the process package does not exist or the process package version is inconsistent, the plugin configuration file is created based on the updated configuration information obtained from parsing the process package. The second version of the plugin is initialized and loaded in the second layer container in the host computer background according to the configuration file. If the process package exists and the version is consistent, the process package is deleted.
[0012] Furthermore, the update methods also include: The importPlugin method of qqmlEnginer is used to implement dynamic hot reloading of the plugin library.
[0013] Furthermore, the update method also includes: when initializing and loading the second version plugin, using the interface QML loader container to asynchronously load the second layer container, in the second layer container, the information of the second version plugin is initialized and loaded by instantiating the business class, and after the second version plugin is initialized and loaded, a signal is sent to the host computer display interface to indicate that the foreground and background switching operation is allowed.
[0014] According to the interface plugin update method provided in the first aspect of this application, by running the old and new versions of the plugin in parallel in the foreground and background respectively, and combining the foreground / background switching mechanism, dynamic updates of the plugin are achieved. During the update process, the main program of the industrial control software does not need to be restarted, avoiding production interruptions and ensuring production continuity. Furthermore, when a plugin is switched to the background, it is not terminated but enters a silent running state. Plugin switching is achieved by showing / hiding it on the display interface. After switching, the plugin does not need to be re-initialized, avoiding white screen or lag issues during plugin switching and preventing impact on user experience. In the silent running state, the plugin can receive feedback data from the lower-level machine and configuration information updated in the foreground plugin, achieving plugin data synchronization with the foreground plugin. This prevents the loss of previously configured data in the foreground plugin during plugin rollback, enabling rapid plugin rollback. The interface plugin update method provided in the embodiments of this application has the advantage of rapid plugin rollback, supports A / B testing during plugin development and debugging, and allows real-time comparison of the control effects of the old and new plugins, which is beneficial to improving plugin development efficiency.
[0015] Secondly, this application also provides an interface plugin update system, which includes a host computer and a slave computer that is communicatively connected to the host computer. The host computer is configured to apply the interface plugin update method provided in the first aspect of this application.
[0016] Thirdly, this application also provides a teach pendant, characterized in that the teach pendant is configured to run the interface plugin update method provided in the first aspect of this application.
[0017] For a detailed description of the second and third aspects and their various implementations in this application, please refer to the detailed description in the first aspect and its various implementations. The beneficial effects of the second and third aspects and their various implementations can be found in the analysis of the beneficial effects of the first aspect and its various implementations; they will not be repeated here. Attached Figure Description
[0018] Figure 1 A flowchart illustrating a method for updating an interface plugin according to an embodiment of this application; Figure 2 This is a flowchart illustrating the plugin import process according to one embodiment of this application. Figure 3 This is a schematic diagram of an interface plugin update system provided in one embodiment of this application; Figure 4 This is a timing diagram of the update of a plugin in an update system provided in one embodiment of this application; Figure 5 A schematic diagram illustrating communication between a plug-in and a lower-level machine via a main program communication module, according to one embodiment of this application. Figure 6This is a schematic diagram of a silent state switching provided in one embodiment of this application. Detailed Implementation
[0019] The present application will be described in detail below with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present application. Any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the protection scope of the present application.
[0020] Traditional plug-in update methods typically require a restart of the industrial control software's main program for the plug-in to take effect, which can disrupt production continuity. While some dynamically loaded plug-in solutions avoid the risk of downtime or operational interruption caused by a main program restart, these solutions only prevent the main program from restarting. For plug-in replacement, the old plug-in still needs to be terminated before the new one is loaded. This can lead to issues like blank screens and lag during plug-in switching, and may also result in the loss of some data before and after the switch. Furthermore, if the new plug-in encounters problems, a timely rollback is not possible.
[0021] Based on this, this application provides a plugin update method that can be dynamically updated, switch with zero delay, and support real-time rollback, which will help improve the stability and reliability of plugin updates.
[0022] Firstly, such as Figure 1 As shown in the figure, this application embodiment provides a method for updating an interface plugin. This update method is applied to a host computer and includes the following steps: S11. Parse the process package to obtain the update configuration information of the specified plugin; S12. Receive the plugin update instruction, and according to the update configuration information, initialize and load the second version plugin in the second layer container in the host computer background. Update the plugin data of the second version plugin in the background. The plugin data includes: plugin configuration information obtained from receiving the first version plugin configuration, and feedback data from the lower computer executing the first version plugin function. The first version plugin is located in the first layer container of the host computer front-end display interface. S13. Perform a foreground / background switching operation between the first layer container and the second layer container on the host computer display interface. When the second layer container is in the foreground, transfer control of the lower-level machine to the second version plugin. Modify the elements in the host computer display interface according to the updated plugin data of the second version plugin. The first version plugin runs silently in the background. Update the plugin data of the first version plugin according to the plugin configuration information received from the second version plugin and the feedback data of the lower-level machine executing the second version plugin function. S14. If there is a need for plugin rollback, perform the foreground / background switching operation between the first layer container and the second layer container again, transfer control of the lower-level machine to the first version plugin, and modify the upper-level machine display interface according to the plugin data updated during the background period of the first version plugin.
[0023] Specifically, in this embodiment of the application, a container refers to an object used to carry and manage the operation of components / plugins. The layer container described in this embodiment of the application can be simply understood as a window that carries plugins and can display content on the host computer display interface. It is used to indicate that windows of different layer containers can overlap completely or partially.
[0024] For ease of explanation, in this embodiment, a plugin whose layer container is displayed in the foreground of the host computer is referred to as a foreground plugin, and a plugin whose layer container is displayed in the background of the host computer is referred to as a background plugin. A layer container being displayed in the foreground of the host computer means that the content of the layer container is displayed in the host computer's display interface. A layer container being displayed in the background of the host computer means that all or most of the content of the layer container is not displayed in the host computer's display interface; it may be completely or partially covered by a layer container above it.
[0025] According to the interface plugin update method provided in this application embodiment, after receiving the plugin update instruction, a second version plugin is loaded into the second layer container in the host computer background. Since the second version plugin is loaded in the background, it will not affect the first version plugin in the first layer container of the host computer's foreground display interface. After the second version plugin is initialized and loaded, it runs silently in the background of the host computer as a background plugin. At this time, the second version plugin does not yet have control over the lower-level machine and mainly updates its own plugin data. The plugin data of any plugin includes plugin configuration information and feedback data from the lower-level machine. During the silent operation of the second version plugin, it receives the plugin configuration information of the foreground plugin (i.e., the first version plugin whose layer container is in the foreground display interface) and receives feedback data from the lower-level machine executing the function of the first version plugin, thereby synchronizing the plugin data of the second version plugin and the first version plugin during silent operation.
[0026] After the plugin data synchronization is complete, the foreground / background switching operation of the first and second layer containers can be performed on the host computer display interface. For example, the window representing the second layer container can be moved above the window representing the first layer container using touch commands, so that the window representing the second layer container completely or partially covers the window representing the first layer container. At this time, the second version plugin becomes the foreground plugin after the switch and gains control over the lower-level machine. Since the plugin data of the second version plugin is synchronized with that of the first version plugin before the switch, although the window representing the layer container in the host computer display interface has switched, the elements representing the plugin data in the window remain consistent with those before the switch. Therefore, the user can continue to debug the plugin based on the original debugging progress, achieving seamless plugin updates for the user.
[0027] After the foreground / background switch operation, the first-version plugin becomes a background plugin and enters a silent running state. It receives plugin configuration information from the foreground plugin and receives real-time feedback data from the lower-level machine executing the foreground plugin's (i.e., the second-version plugin) functions, thus synchronizing the plugin data of the first-version plugin with that of the foreground plugin. In cases where plugin rollback is required, simply perform the foreground / background switch operation between the first and second layer containers again to achieve a quick plugin rollback.
[0028] Based on the above description, the interface plugin update method provided in this application achieves dynamic plugin updates by having both old and new plugins run in parallel in the foreground and background, respectively, combined with a foreground / background switching mechanism. During the update process, the main program of the industrial control software does not need to be restarted, avoiding production interruptions and ensuring production continuity. Furthermore, when a plugin is switched to the background, it is not terminated but enters a silent running state. Plugin switching is achieved by showing / hiding it on the display interface. After switching, the plugin does not need to be re-initialized, avoiding white screen or lag issues during plugin switching and preventing impact on user experience. In the silent running state, the plugin can receive feedback data from the lower-level machine and configuration information updated by the foreground plugin, achieving plugin data synchronization with the foreground plugin. This prevents the loss of previously configured data in the foreground plugin during plugin rollback, enabling rapid plugin rollback. The interface plugin update method provided in this application has the advantage of rapid plugin rollback, supports A / B testing during plugin development and debugging, and allows real-time comparison of the control effects of the old and new plugins, thus improving plugin development efficiency.
[0029] As an optional implementation, the interface plugin update method provided in this application embodiment synchronizes the configuration information of the backend plugin with the frontend plugin through the following steps: Set up a first cache area and store the updated configuration information obtained from parsing the process package into the first cache area according to the plugin name; During plugin initialization and loading, a callback function is registered with the module that manages and updates configuration information, and a mapping relationship between plugin name and plugin version is generated based on the registration list. When the plugin configuration information stored under any plugin name changes, the layer container state corresponding to different plugin versions of the plugin name is obtained according to the mapping relationship, and the updated plugin configuration information is pushed to the plugins in the background of the layer container to realize the synchronization of configuration information of the background plugins. Specifically, taking the second-version plugin as an example, during the initial loading of the second-version plugin, it passes a function pointer to the module managing updated configuration information and registers a callback function. This function pointer points to the plugin configuration information corresponding to the name of the second-version plugin. Based on the registration list, a mapping relationship between plugin names and registered plugin versions can be formed. For example, the first-version plugin and the second-version plugin are two plugins with the same plugin name but different versions. If the plugin configuration information corresponding to the second-version plugin name in the first cache changes, the registered plugin version (such as the first-version plugin and the second-version plugin) can be obtained based on the mapping relationship. The state of the layer container of each plugin version can be detected. If the layer container of a certain version of the plugin (such as the first-version plugin) is in the foreground display interface of the host computer, no configuration information is pushed to that version of the plugin. If the layer container of a certain version of the plugin (such as the second-version plugin) is in the background of the host computer, it means that the version of the plugin is currently in a silent running state, and updated plugin configuration information is pushed to that version of the plugin. In this way, the parameter configurations made by the user on the host computer display interface for the front-end plugin can be synchronized to the back-end plugin. This avoids losing the data configured by the user on the host computer's front-end display interface when switching plugins, preserves the user's debugging progress, and improves the development efficiency of the plugin.
[0030] As an optional implementation, the update method provided in this application embodiment further includes: when the second version plugin is initialized and loaded, obtaining and pushing the plugin configuration information of the first version plugin; The second version plugin checks the version information of the obtained plugin configuration information. If the version of the plugin configuration information is higher than the version of the second version plugin, the second version plugin extracts the parameters required by the second version plugin from the obtained plugin configuration information as the configuration parameters of the second version plugin. If the version of the plugin configuration information is lower than the version of the second version plugin, the second version plugin decides to use the default parameters or the parameters obtained by converting through the preset conversion relationship to replace the missing configuration parameters according to its own version information.
[0031] Specifically, in the update method provided in this application embodiment, the plugin configuration information is stored in the first cache according to the plugin name, so that plugins with different versions of the same name can share configuration information. Taking the synchronization of the second version plugin (backend plugin) and the first version plugin (foreground plugin) as an example, when the first version plugin modifies the plugin configuration, the modified configuration information is stored in the first cache as the source data of the plugin configuration information. The second version plugin receives the push from the first cache, realizing the synchronization of the configuration information of the backend plugin and the foreground plugin. However, considering the inconsistency of plugin versions, the method provided in this application embodiment has a compatibility design for reading plugins. When the version of the plugin configuration information stored in the first cache is higher than the version of the second version plugin, the version of the source data is higher, the plugin parameter configuration is more complete, and there is generally no problem of missing parameters. The second version plugin only extracts the parameters it needs as the configuration parameters of the second version plugin. The parameters that the second version plugin needs to extract may include parameters used to control the lower-level machine. For example, when the lower-level machine is a robotic arm, the parameters that the second version plugin needs to extract may include the control angle of the robotic arm, etc. The parameters that the second version plugin needs to extract may also include, for example, the interface style theme, font size, language version, and interface refresh rate that the second version plugin will display when it switches to the foreground display interface. In addition, the parameters that the second version plugin needs to extract may also include the configuration of whether to enable logging.
[0032] If the version of the plugin configuration information is lower than the version of the second version plugin, the version of the source data is also lower, which may result in missing parameters. The second version plugin will decide to use the default parameters or the parameters obtained by converting through the preset conversion relationship to replace the missing configuration parameters based on its own version information, so as to complete the parameters.
[0033] The default parameters can be the configuration parameters that the plugin has when it is first installed. When the second version of the plugin is initialized and loaded, the default parameter configuration is used first, and then the configuration parameters of the first version of the plugin are overwritten to ensure that the configuration parameters of the second version of the plugin can continue the parameters of the first version of the plugin. Then, certain specific parameters are converted according to the built-in preset conversion rules. Here, the first version of the plugin can be the plugin version that was installed for the first time, or it can be a plugin version that is different from the first installation.
[0034] For example, the configuration parameters for the first installation of the plugin version can be configured as follows: white interface style, font size 22, and Chinese language. Let's assume the configuration parameters for the first version of the plugin are: black interface style, font size 24, and English language.
[0035] When initializing and loading the second version of the plugin, a parameter configuration was first created based on default parameters: white interface style, font size 22, Chinese language, white background color, and light-colored control theme (where background color and control theme are new configuration parameters added in this version). Then, the configuration of the first version of the plugin was overridden, so the parameter configuration of the second version plugin became: black interface style, font size 24, English language, white background, and light-colored control theme. Then, a rule conversion was performed; because the interface style is now black, the background was changed to black, and the control theme to dark theme.
[0036] By using the above methods, we can ensure that the backend plugins are compatible when reading plugin configuration information. After reading the configuration information, the plugins will write the configuration information to the plugins themselves based on the plugins' own version.
[0037] As an optional implementation, parameters that are invalid in higher versions are retained, thus ensuring backward compatibility of plugin configuration information in higher versions.
[0038] As an optional implementation, the interface plugin update method provided in this application embodiment further includes: performing a foreground / background switching operation between the first layer container and the second layer container on the host computer display interface; when the second layer container switches from the host computer background to the foreground display interface, the second version plugin stops receiving update plugin configuration information from the first cache area. Establish communication between the second-version plugin and the human-computer interaction port, and modify the update configuration information for the second-version plugin through the human-computer interaction port; The configuration write permissions of the first cache area are transferred to the second version plugin. The second version plugin will update the configuration information and write it to the first cache area for the plugins switched to the background to synchronize parameter configurations.
[0039] Specifically, taking the second layer container switching to the host computer's front-end display interface as an example, the second version plugin in the second layer container becomes the front-end plugin and runs. The front-end plugin has the ability to communicate with the human-computer interaction port and can receive configuration information debugging commands sent by the user through the host computer display interface, and modify the configuration information in the plugin. In this way, the user can debug the front-end plugin more conveniently.
[0040] After the second layer container switches from the background to the foreground display interface, the second version plugin will automatically gain write access to the first cache area. The second version plugin can update and save the plugin configuration parameters modified by the user through the host computer display interface in the first cache area. At this time, the first version plugin in the background can receive the updated configuration information in the first cache area, realizing the synchronization of parameter configuration with the second version plugin. In this way, when there is a need for plugin rollback in the future, the data configured by the user in the host computer foreground display interface can be avoided, the user's debugging progress of the plugin can be preserved, and the development efficiency of the plugin can be improved.
[0041] As an optional implementation, the interface plugin update method provided in this application embodiment further includes: setting a second buffer in the host computer, wherein the second buffer is configured to receive feedback data from the lower computer executing the plugin function; During plugin initialization, the plugins are registered in the second buffer, and the lower-level machine feedback data in the second buffer is pushed to the registered plugins to improve their data information.
[0042] Specifically, the plugin data comes from two sources. The first is the plugin's configuration parameter information. According to the update method provided in this application embodiment, this data can be obtained by registering a callback function in the first cache. The second source of plugin data is feedback data from the lower-level machine. In this application embodiment, the feedback data is stored in the second cache. When the plugin is initialized and loaded, the plugin will register a callback function in the second cache. When the lower-level machine feedback data in the second cache is updated, the lower-level machine feedback data is automatically pushed to the registered plugin, ensuring that the state of the lower-level machine remains consistent across different plugin versions. This allows for continued control of the lower-level machine after switching plugins, avoiding interruptions to the user's plugin debugging progress due to inconsistencies in the lower-level machine feedback data between different plugin versions before and after switching.
[0043] As an optional implementation, the plugin needs to be compatible with the feedback data from the lower-level machine, taking into account the differences between the lower-level machine and the plugin version. The compatibility with the lower-level machine needs to achieve compatibility in both reading and writing.
[0044] As an optional implementation, the interface plugin update method provided in this application embodiment further includes: parsing the process package, performing completeness and security checks on the parsing results, and after the checks pass, determining whether the process package already exists in the host computer. If the process package does not exist or the process package version is inconsistent, then a plugin configuration file is created based on the update configuration information obtained from parsing the process package, and the second version plugin is initialized and loaded in the second layer container in the host computer background based on the configuration file; if the process package exists and the version is consistent, then the process package is deleted.
[0045] Specifically, such as Figure 2 As shown, after parsing the process package, the parsing results are first checked for completeness and security. Checking the completeness of the process package (e.g., file structure, parameter range, logical consistency) prevents production anomalies caused by missing or incorrect data. Security checks verify whether the process package complies with security standards (e.g., data encryption, access control) to prevent malicious tampering or unauthorized access. After verification, the existence and version of the process package are checked to ensure the host computer only loads the latest or necessary configurations, reducing redundancy and conflicts. If the process package is missing or the version is inconsistent, the plugin update process is initiated, automatically creating and initializing the plugin configuration file to update the plugin.
[0046] As an optional implementation, the interface plugin update method provided in this application embodiment further includes: using the importPlugin method of qqmlEnginer to realize dynamic hot loading of the plugin library.
[0047] Specifically, dynamic hot-loading of plugins can be achieved through the following steps: First, the host computer loads the dynamic link library through the importPlugin function and calls the plugin program; then, the registerTypes function is automatically executed to register the C++ classes of the plugin program as types that can be used by QML, or to export the QML files in the plugin; finally, the language pack of the plugin is loaded through the initializeEngine function, and the configuration file information is updated and loaded, thereby realizing dynamic hot-loading of the plugin.
[0048] As an optional implementation, when initializing and loading the second version plugin, the loader container of the interface QML is used to asynchronously load the second layer container. In the second layer container, the information of the second version plugin is initialized and loaded by instantiating the business class. After the second version plugin is initialized and loaded, a signal is sent to the host computer display interface to indicate that the foreground and background switching operation is allowed.
[0049] Specifically, the initial loading of the second-version plugin may include the following steps: After the plugin loading function called by the host computer is executed, it will send a completion signal to the host computer's interface layer. After receiving the signal, the interface layer will load (instantiate) the plugin interface QML file through the second-layer container Loader according to the path. The second-layer container Loader will remain hidden and the loading operation will be performed asynchronously. After the second-layer container Loader is loaded, it will send a loading completion signal to the host computer's interface layer. As a result, the plugin version switching control in the host computer's foreground display interface will also be clickable. After clicking, the display and hiding will be switched directly, as well as the control of the plugin will be switched (for example, the first-version plugin, which was originally in the host computer's foreground display interface, will be switched to the background and hidden, and the control of the first-version plugin will be released. The second-version plugin will be switched from the background to the foreground display interface and will gain plugin control). This will demonstrate a seamless plugin switching effect.
[0050] Secondly, this application also provides an interface plugin update system, which includes a host computer and a slave computer that is communicatively connected to the host computer. The host computer is configured to apply the interface plugin update method provided in the embodiments of this application.
[0051] like Figure 3 As shown, as an optional implementation, the host computer includes a main program communication module, a main program plugin management module, and a main program plugin loading module.
[0052] The main program plugin management module is configured to parse the process package to obtain the updated configuration information of the specified plugin. The main program communication module is configured to communicate with the lower-level machine to obtain feedback data from the lower-level machine executing the first version of the plugin function, which is placed in the first layer container of the upper-level machine's foreground display interface.
[0053] The main program plugin loading module is configured to initialize and load the second version of the plugin in the second layer container of the host computer backend, based on the updated configuration information, upon receiving an update instruction for the plugin.
[0054] When the main program plugin loading module loads a plugin, the plugin registers callback functions with both the main program plugin management module and the main program communication module, thereby updating the plugin data of the second version plugin in the background. The plugin data updated in the background for the second version plugin includes: plugin configuration information of the first version plugin pushed by the main program plugin management module, and feedback data from the lower-level machine executing the functions of the first version plugin pushed by the main program communication module. The first version plugin is located in the first layer container of the upper-level computer's front-end display interface.
[0055] The host computer also includes a host computer display interface, configured to perform foreground / background switching operations between the first-layer container and the second-layer container. When the second-layer container is in the foreground, the host computer display interface transfers control of the slave device to the second-version plugin. The second-version plugin modifies the elements on the host computer display interface based on the updated plugin data. The first-version plugin runs silently in the background, obtaining the second-version plugin configuration through push notifications from the main program's plugin management module and receiving feedback data from the slave device executing the second-version plugin's functions through the main program's communication module.
[0056] According to the interface plugin update system provided in this application, the main program communication module obtains feedback data from the lower-level machine executing the first version plugin function on the foreground display interface. When a plugin update is required, the main program plugin management module parses the process package and, based on the parsed update configuration information, initializes and loads the second version plugin in the second-layer container in the background of the upper-level machine through the main program plugin loading module. While the second-layer container is in the background, the second version plugin runs silently, updating only its own plugin data. The second version plugin does not affect the first version plugin in the foreground; this loading process is a dynamic hot-loading process.
[0057] When the second-version plugin, located in the background, updates its plugin data, it retrieves parameter information from the first-version plugin displayed on the foreground interface. This synchronizes the plugin configuration with the first-version plugin, ensuring the integrity of the configuration data. The second-version plugin also receives push notifications of feedback data from the lower-level machine, ensuring consistency with the lower-level machine's data.
[0058] When switching between the first and second layer containers via the host computer display interface, the second version plugin modifies the elements of the host computer display interface according to the updated plugin data. Since the second version plugin listens to the first version plugin while in the background and has achieved data synchronization, the plugin data in the second version plugin is the latest plugin data. After switching the layer container on the host computer display interface, the user can continue to debug the second version plugin without interrupting the plugin debugging due to inconsistent parameter configurations. Furthermore, this method can prevent the loss of parameters before and after the plugin switch.
[0059] As an optional implementation, in the event of a plugin rollback requirement, the foreground / background switching operation between the first and second layer containers can be performed again through the host computer display interface. This transfers control of the lower-level machine to the first version of the plugin, and the host computer display interface is modified based on the feedback data monitored during the first version of the plugin's background operation.
[0060] Specifically, when the first version of the plugin is moved to the background, it enters a silent running state as a background plugin, acquiring parameter information from the foreground plugin and feedback data from the lower-level machine to synchronize the plugin data between the first version and the foreground plugin. If a plugin rollback is required, the foreground / background switching operation can be performed again on the upper-level computer display interface to achieve plugin rollback. This plugin rollback method does not require re-initializing the plugin, enabling seamless switching and rapid rollback.
[0061] Based on the above description, in the interface plugin update system provided in this application embodiment, the new and old plugins run in parallel in the foreground and background respectively. Combined with the foreground and background switching mechanism, the plugin is dynamically updated. During the update process, the main program of the industrial control software does not need to be restarted, which can avoid interruption of production, ensure the continuity of production, meet the high availability requirements of industrial scenarios, and is suitable for application scenarios of updating plugin packages on the production site.
[0062] Furthermore, when a plugin is switched to the background, it is not terminated but enters a silent running state. Seamless switching between plugins is achieved through a visible / hidden interface, eliminating the need for plugin re-initialization and preventing white screen or lag issues during plugin switching, thus avoiding impact on user experience. In silent running mode, the plugin can receive feedback data from the lower-level machine and updated configuration information from the foreground plugin, achieving data synchronization with the foreground plugin. This prevents data loss during plugin rollback, enabling rapid plugin rollback. The interface plugin update system provided in this application embodiment has the advantage of rapid plugin rollback, allowing for quick rollback in case of new version plugin anomalies, providing dynamic rollback protection, and significantly reducing the risk of production accidents caused by update failures in industrial scenarios. In addition, the update system provided in this application embodiment supports A / B testing during plugin development and debugging, allowing real-time comparison of the control effects of new and old plugins without the need for simulation environment comparison, which improves plugin development efficiency.
[0063] As an optional implementation, the main program plugin management module is responsible for managing the process package files and the corresponding configuration files of the plugins, and provides plugin management functions to the host computer display interface. It supports users to add, delete, and query plugins, provides plugin configuration information query services to other modules, and provides read and write functions for plugin configuration information.
[0064] like Figure 3 As shown, as an optional implementation, the main program plugin management module includes: a process package parsing submodule and a parameter management submodule.
[0065] The process package parsing submodule is configured to parse process packages and obtain configuration information from them. This configuration information includes one or more of the following types: version number, version update information, plugin path, and interface file path. In an optional embodiment, after parsing the process package, the process package parsing submodule can perform completeness and security checks on the parsing results. By verifying the completeness of the process package (e.g., file structure, parameter range, logical consistency), production anomalies caused by missing or incorrect data are avoided. Security checks verify whether the process package complies with security specifications (e.g., data encryption, access control), preventing malicious tampering or unauthorized access.
[0066] The parameter management submodule is configured to manage the configuration information in the process package, storing the configuration information separately according to the plugin name. The parameter management submodule accepts plugin callback function registrations, and when the stored configuration information is updated, it pushes the updated configuration information to the corresponding registered plugin according to the plugin name.
[0067] Specifically, the parameter management submodule stores configuration information according to plugin name, with different versions of plugins sharing the same plugin configuration file. All plugins must register with the parameter management submodule during initialization. When the configuration file corresponding to a specific plugin name is updated, the parameter management submodule uses a registration-push method to provide the updated configuration file information to the plugin in the background, thus achieving synchronization between background plugin configuration information and front-end plugins.
[0068] As an optional implementation, the main program plugin loading module is responsible for loading plugins. The plugin loading process includes: dynamic library loading, interface loading, and interface and control switching management.
[0069] In this embodiment, the main program plugin loading module uses a dynamic link library to implement the plugin hot-loading function. Specifically, the importPlugin method of qqmlEnginer can be used to implement dynamic hot-loading of the plugin library.
[0070] For UI loading, the main program plugin loading module uses a UI QML loader container to asynchronously load the two-layer container in the background. In the background layer container, the plugin information is initialized and loaded by instantiating the business class. After the plugin initialization is completed, the plugin remains in a silent running state and then sends a signal to the host computer display interface to indicate that the foreground / background switching operation is allowed.
[0071] When the host computer receives a signal indicating that the interface has finished loading, the display of the foreground and background layer containers can be switched by showing or hiding the interface. At the same time, the control of writing configuration files and the lower-level machine is automatically switched to the displayed plugin, while the hidden plugin will automatically enter the background silent running state to reduce resource consumption.
[0072] To further illustrate the update system provided in this application embodiment, the following example illustrates the plugin update process in the system, taking a scenario where the first version plugin is running normally in the foreground and a second version plugin needs to be dynamically updated.
[0073] like Figure 4 As shown, the first version of the plugin runs normally in the foreground of the host computer, writing the updated configuration information during runtime into the parameter management submodule for storage. After the user imports the process package, the process package parsing submodule parses the process package to obtain the plugin configuration information. Then, the main program plugin loading module initializes and loads the second version of the plugin in the second layer container (which is in the background) using the parsed plugin configuration information. The initialized second version of the plugin obtains the configuration information of the first version of the plugin from the parameter management submodule, achieving plugin data synchronization. After the plugin data synchronization is complete, the plugin switching operation can be performed, switching the second version of the plugin to the foreground display interface, while the first version of the plugin switches to the background and automatically enters a silent running state. At this time, the second version of the plugin obtains write permissions from the parameter management submodule, and the first version of the plugin reads and listens for data updates from the second version of the plugin. The user is then notified that the plugin switching is complete. Thus, the dynamic loading and seamless switching of the plugin is achieved.
[0074] like Figure 3 As shown, as an optional implementation, the main program communication module includes a cache submodule and a registration push submodule.
[0075] The cache submodule is configured to communicate with the lower-level machine to obtain feedback data sent by the lower-level machine. In an optional embodiment, during the initialization of the main program communication module, the main program communication module will automatically obtain at least some of the initial information required by the upper-level machine from the lower-level machine and store this initial information in the cache submodule. During subsequent use, the internal cache in the cache submodule will be automatically updated based on the feedback data from the lower-level machine.
[0076] The registration push submodule is configured to monitor internal storage updates in the cache submodule. It accepts plugin registrations and, when the cache submodule updates its internal cache, pushes cached data to the registered plugins to ensure they receive timely updates from the lower-level machine and update their own data. When any plugin registers with this registration push submodule, it proactively pushes its cached data to ensure the completeness of the registered plugin's data.
[0077] like Figure 5 As shown, this illustrates the process of the plugin communicating with the lower-level machine through the main program communication module. The main program communication module has storage capabilities, allowing it to cache feedback data from the lower-level machine. During the plugin initialization phase, when the plugin registers with the main program communication module, the module proactively pushes the data to the plugin to ensure its integrity. When the plugin is in the foreground, it gains control of the lower-level machine and can set parameters through the main program communication module. Furthermore, during the plugin's operation phase (including foreground and background operation), the registration and push submodule within the main program communication module pushes lower-level machine feedback data to the plugin, ensuring that the feedback data is up-to-date. This guarantees consistency in the displayed lower-level machine status before and after plugin switching.
[0078] like Figure 3 As shown, as an optional implementation, any plugin includes a data interaction module, which enables communication between the plugin and the main program. This includes communication with the host computer display interface port, communication with the main program plugin management module, and communication with the main program communication module.
[0079] like Figure 6 As shown, as an optional implementation, the data interaction module is configured as follows: The data interaction module of any plugin registers with the parameter management submodule during plugin initialization and loading, enabling communication between the plugin and the main program's plugin management module. The data interaction module has storage capabilities; when the configuration information under any plugin name in the parameter management submodule changes, the corresponding plugin's data interaction module in the host computer's backend receives and caches the updated configuration information pushed by the parameter management submodule, thus synchronizing the plugin configuration information of the backend plugin with that of the foreground plugin.
[0080] As an optional implementation, the plugin's data interaction module is also configured to register with the main program's communication module, obtain and cache the lower-level machine feedback data pushed by the main program's communication module, thereby ensuring that the plugin can obtain the latest lower-level machine feedback data regardless of whether the plugin is in the foreground or background, ensuring that the plugin data is consistent between the foreground and background, and avoiding failures when switching plugins.
[0081] As an optional implementation, the data interaction module is configured to: receive running status switching commands from the host computer display interface; when the plugin's layer container is in the foreground display interface of the host computer, the plugin's data interaction module pushes cached updated configuration information and feedback data to the host computer display interface, and modifies the elements on the host computer display interface based on the updated configuration information and feedback data. For plugins switched to the background, the background plugin's data interaction module will only cache data and no longer push updates to the host computer display interface, thereby avoiding calculations at the interface layer and plugin business layer and reducing resource consumption.
[0082] Based on the above explanation, when a plugin is switched to the foreground, the data interaction module will push the latest data to update the host computer's display interface. During the subsequent execution of plugin functions on the slave device, the foreground plugin will continuously update the host computer interface. This method ensures data consistency on the display interface before and after plugin switching, allows for continued plugin configuration based on previous debugging progress, enables comparison of different plugin versions' control effects on the slave device, facilitates A / B testing, accelerates plugin function verification and iteration, and improves plugin development efficiency.
[0083] As an optional implementation, the data interaction module is also configured as follows: when the plugin's layer container is located on the foreground display interface of the host computer, the plugin's data interaction module receives updated configuration information for a specified plugin sent by the host computer display interface. The data interaction module obtains configuration write permissions from the parameter management submodule, writes the updated configuration information to the parameter management submodule, and the updated configuration information is generated by the host computer display interface based on the settings input on the host computer display interface. In this way, users can easily debug the parameters of the foreground plugin through the host computer display interface. Furthermore, through the update push from the parameter management submodule, the background plugins running silently will automatically synchronize their parameter configurations with the foreground plugins, enabling parameter configuration to take effect in multiple versions of the plugin with a single configuration, thus improving the efficiency of plugin parameter configuration.
[0084] Thirdly, embodiments of this application also provide a teach pendant configured to run the interface plugin update method provided in embodiments of this application. This teach pendant can be applied to robotic arm control in production scenarios.
[0085] Specifically, a teach pendant is a handheld device used for robot control. A first version of a plugin can be loaded onto the teach pendant. When the first version of the plugin is displayed on the teach pendant's interface, the teach pendant will control the lower-level machine (such as a robotic arm) to execute the functions of the first version of the plugin.
[0086] When a plugin update is needed, the user can import a process package into the teach pendant. The teach pendant will parse the process package and, based on the configuration information obtained, load a second-version plugin in the background. At this time, the initially loaded second-version plugin runs silently, acquiring plugin data from the first-version plugin in the foreground for data synchronization. After the second-version plugin initialization is complete, a plugin switchable prompt will appear on the teach pendant's display interface. Performing a plugin switch operation on the teach pendant's display interface will bring the second-version plugin to the foreground, granting it control over the lower-level machine. The teach pendant can then control the lower-level machine to execute the functions of the second-version plugin, thus achieving seamless, dynamic plugin loading. The first-version plugin, switched to the background, will automatically enter a silent running state to synchronize its plugin data with the foreground second-version plugin. This allows for rapid rollback in case of subsequent plugin rollback needs, preventing production interruptions due to new plugin failures. It also enables A / B testing, allowing real-time comparison of the control effects of different plugin versions, improving plugin development efficiency.
[0087] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.
[0088] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0089] It is understood that the term "exemplary" as used herein means "as an example, illustration, or description." Any embodiment described as "exemplary" is not necessarily preferred or superior to other embodiments and / or does not exclude features in combination with other embodiments. It should be understood that certain features of this application described in the context of a single embodiment for clarity may also be provided in combination in a single embodiment. Conversely, various features of this application described in the context of a single embodiment for clarity may also be provided individually or in any suitable combination or as part of any other described embodiment of this application.
[0090] The above-disclosed embodiments are merely preferred embodiments of this application, but are not intended to limit the scope of this application. Those skilled in the art will understand that any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and scope of this application and the appended claims are equivalent substitutions and still fall within the scope of the invention.
Claims
1. A method for updating a user interface plugin, characterized in that, The update method is applied to a host computer, and the update method includes: The process package is parsed to obtain the updated configuration information of the specified plugin; The system receives an update instruction for the plugin and initializes and loads the second version plugin in the second layer container in the background of the host computer according to the update configuration information. The system updates the plugin data of the second version plugin in the background. The plugin data includes: plugin configuration information obtained by receiving the configuration of the first version plugin and feedback data of the lower computer executing the function of the first version plugin. The first version plugin is located in the first layer container of the host computer's front-end display interface. The host computer displays an interface that performs a foreground / background switching operation between the first layer container and the second layer container. When the second layer container is in the foreground, control of the lower-level device is transferred to the second version plugin. The elements in the host computer display interface are modified according to the plugin data updated by the second version plugin. The first version plugin runs silently in the background. The plugin data of the first version plugin is updated according to the plugin configuration information obtained from the configuration of the second version plugin and the feedback data of the lower-level device executing the function of the second version plugin. If there is a need for plugin rollback, the foreground / background switching operation between the first layer container and the second layer container is executed again, transferring control of the lower-level machine to the first version plugin, and modifying the upper-level machine display interface based on the plugin data updated during the background operation of the first version plugin.
2. The method for updating the interface plugin according to claim 1, characterized in that, The update method further includes: When the second version plugin is initialized and loaded, the plugin configuration information of the first version plugin is obtained and pushed. The second version plugin verifies the version information of the obtained plugin configuration information. If the version of the plugin configuration information is higher than the version of the second version plugin, the second version plugin extracts the parameters it needs from the obtained plugin configuration information as the configuration parameters of the second version plugin. If the version of the plugin configuration information is lower than the version of the second version plugin, the second version plugin decides to use the default parameters or the parameters obtained by converting through the preset conversion relationship to replace the missing configuration parameters according to its own version information.
3. The method for updating the interface plugin according to claim 1, characterized in that, The update method further includes: Set up a first cache area and store the updated configuration information obtained from parsing the process package into the first cache area according to the plugin name; During plugin initialization and loading, a callback function is registered with the module that manages the updated configuration information. Based on the registration list, a mapping relationship between plugin names and plugin versions is generated. When the plugin configuration information stored under any plugin name changes, the layer container status of different plugin versions corresponding to the plugin name is obtained according to the mapping relationship, and the updated plugin configuration information is pushed to the plugins in the background of the layer container to realize the synchronization of configuration information of the background plugins.
4. The method for updating the interface plugin according to claim 3, characterized in that, The update method further includes: When the host computer display interface performs a foreground / background switching operation between the first layer container and the second layer container, and the second layer container switches from the host computer background to the foreground display interface, the second version plugin stops receiving updated plugin configuration information from the first cache. Establish communication between the second version plugin and the human-computer interaction port, and modify the update configuration information for the second version plugin through the human-computer interaction port; The configuration write permission of the first cache area is transferred to the second version plugin. The second version plugin writes the updated configuration information into the first cache area for the plugin that switches to the background to synchronize parameter configuration.
5. The method for updating the interface plugin according to claim 3, characterized in that, The update method further includes: A second buffer is set in the host computer, and the second buffer is configured to receive feedback data from the lower computer executing the plug-in function; During plugin initialization and loading, the plugin is registered in the second cache, and the lower-level machine feedback data in the second cache is pushed to the registered plugin to improve the data information of the registered plugin.
6. The method for updating the interface plugin according to claim 1, characterized in that, The update method further includes: The process package is parsed, and the parsing results are checked for completeness and security. If the checks pass, it is determined whether the process package already exists in the host computer. If the process package does not exist or the process package version is inconsistent, a configuration file for the plugin is created based on the updated configuration information obtained from parsing the process package. The second version plugin is initialized and loaded in the second layer container in the host computer background according to the configuration file. If the process package exists and the version is consistent, the process package is deleted.
7. The method for updating the interface plugin according to claim 1, characterized in that, The update method further includes: The importPlugin method of qqmlEnginer is used to implement dynamic hot reloading of the plugin library.
8. The method for updating the interface plugin according to claim 1, characterized in that, The update method further includes: when initializing and loading the second version plugin, using the loader container of the interface QML to asynchronously load the second layer container, in the second layer container, the information of the second version plugin is initialized and loaded by instantiating a business class, and after the second version plugin is initialized and loaded, a signal is sent to the host computer display interface to indicate that the foreground and background switching operation is allowed.
9. A UI plugin update system, characterized in that, The update system includes a host computer and a slave computer that is communicatively connected to the host computer. The host computer is configured to apply the interface plugin update method as described in any one of claims 1 to 8.
10. A teach pendant, characterized in that, The teach pendant is configured to run the interface plugin update method as described in any one of claims 1 to 8.