Plug-in dynamic management method for EMS system service and storage medium

By using Sentinel program to monitor the plug-in information differences of master-slave service in the EMS system and dynamically update the plug-in, the problem that the EMS system cannot dynamically manage third-party plug-ins is solved, and the system flexibility and timeliness are improved.

CN119088470AActive Publication Date: 2024-12-06CONTEMPORARY NEBULA TECH ENERGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411096097.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-12-06
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

The existing EMS system cannot dynamically add or update third-party plug-ins during runtime, which limits the flexibility and timeliness of the system and requires restarting the main program to implement plug-in management.

Method used

The sentinel program is used to monitor the plug-in information of the master service and slave service, identify differences in time and switch operations, and update the master service after the slave service changes, avoid restarting, and realize dynamic management of the plug-in.

Benefits of technology

It effectively avoids the need to restart the service program under traditional methods, ensures the continuity of the service, improves the flexibility and timeliness of the system, and realizes dynamic management of plug-ins.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088470A_ABST
    Figure CN119088470A_ABST
Patent Text Reader

Abstract

The invention discloses a plug-in dynamic management method and a storage medium, and the method comprises the steps: operating a master service, enabling a slave service to be in a hovering state, and building a guard program to monitor the plug-in information of the master service and the slave service; receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request; when the sentry program monitors that the plug-in information of the master service and the plug-in information of the slave service are different, the operation of the slave service is switched, the plug-in in the master service is updated after the switching is completed, and the operation of the master service is switched back after the plug-in of the master service is updated; according to the method, the slave service is preferentially changed when the plug-in changes, the slave service is switched to run after the slave service changes, the master service is changed, and then the slave service is switched back to the master service, so that the situation that a service program needs to be restarted in a traditional mode can be effectively avoided, the plug-in can be dynamically managed, and the service efficiency is improved. And the flexibility and timeliness of the system are improved while the service continuity is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This case is a divisional application based on the invention patent with application date of May 28, 2024, application number 202410671662.5, and name "A method and storage medium for dynamic management of plug-ins" as the parent case. Technical Field

[0002] The present invention relates to the technical field of plug-in management, and in particular to a method and storage medium for dynamic management of plug-ins of EMS system services. Background Art

[0003] With the in-depth cooperation of various enterprise users, the main program has become indispensable to provide third-party plug-in protocols. However, the conventional intervention method requires restarting the main program. This results in that when the EMS program is running, new third-party plug-ins cannot be added, or plug-ins cannot be updated in time when they need to be upgraded. This greatly limits the flexibility and timeliness of the project.

[0004] Therefore, how to provide dynamic management for plug-ins to improve the flexibility and timeliness of the system is a technical problem that needs to be solved at present. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method and storage medium for dynamic management of plug-ins of EMS system services, so as to realize dynamic management of plug-ins.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A method for dynamic management of plug-ins, comprising the steps of:

[0008] S1. Run the main service, put the slave service in a suspended state, and establish a sentinel program to monitor the plug-in information of the main service and the slave service;

[0009] S2. receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request;

[0010] S3, when the sentinel program detects that there is a difference in the plug-in information between the main service and the slave service, it switches to the slave service, updates the plug-in in the main service after the switch is completed, and switches back to the main service after the plug-in update of the main service is completed;

[0011] When performing the operation switching between the main service and the slave service, the steps are also included:

[0012] S31, the bottom data center writes the collected data into the cache with a timestamp;

[0013] S32: After the operation switching between the master service and the slave service is completed, the data of the current service is compared with the data in the cache according to the timestamp, the new data that is not acquired by the current service is identified, and the new data is synchronized to the database of the master service and the slave service.

[0014] A method for dynamic management of plug-ins of EMS system services, comprising the steps of:

[0015] S0. Establish two identical system services and distinguish them into primary service and secondary service;

[0016] S1. Run the main service, put the slave service in a suspended state, and establish a sentinel program to monitor the plug-in information of the main service and the slave service;

[0017] The plug-in information includes the number of plug-ins and the version of each plug-in;

[0018] The master service and the slave service are based on the same database;

[0019] S2. receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request;

[0020] S3, when the sentinel program detects that there is a difference in the plug-in information between the main service and the slave service, it switches to the slave service, updates the plug-in in the main service after the switch is completed, and switches back to the main service after the plug-in update of the main service is completed;

[0021] When performing the operation switching between the main service and the slave service, the steps are also included:

[0022] S31, the bottom data center writes the collected data into the cache with a timestamp;

[0023] S32: After the operation switching between the master service and the slave service is completed, the data of the current service is compared with the data in the cache according to the timestamp, the new data that is not acquired by the current service is identified, and the new data is synchronized to the database of the master service and the slave service.

[0024] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0025] A storage medium for dynamic plug-in management, on which a computer program is stored, and when the computer program is executed, the following steps are implemented:

[0026] S1. Run the main service, put the slave service in a suspended state, and establish a sentinel program to monitor the plug-in information of the main service and the slave service;

[0027] S2. receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request;

[0028] S3, when the sentinel program detects that there is a difference in the plug-in information between the main service and the slave service, it switches to the slave service, updates the plug-in in the main service after the switch is completed, and switches back to the main service after the plug-in update of the main service is completed;

[0029] When performing the operation switching between the main service and the slave service, the steps are also included:

[0030] S31, the bottom data center writes the collected data into the cache with a timestamp;

[0031] S32: After the operation switching between the master service and the slave service is completed, the data of the current service is compared with the data in the cache according to the timestamp, the new data that is not acquired by the current service is identified, and the new data is synchronized to the database of the master service and the slave service.

[0032] A storage medium for dynamic management of plug-ins of an EMS system service, on which a computer program is stored, and when the computer program is executed, the following steps are implemented:

[0033] S0. Establish two identical system services and distinguish them into primary service and secondary service;

[0034] S1. Run the main service, put the slave service in a suspended state, and establish a sentinel program to monitor the plug-in information of the main service and the slave service;

[0035] The plug-in information includes the number of plug-ins and the version of each plug-in;

[0036] The master service and the slave service are based on the same database;

[0037] S2. receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request;

[0038] S3, when the sentinel program detects that there is a difference in the plug-in information between the main service and the slave service, it switches to the slave service, updates the plug-in in the main service after the switch is completed, and switches back to the main service after the plug-in update of the main service is completed;

[0039] When performing the operation switching between the main service and the slave service, the steps are also included:

[0040] S31, the bottom data center writes the collected data into the cache with a timestamp;

[0041] S32: After the operation switching between the master service and the slave service is completed, the data of the current service is compared with the data in the cache according to the timestamp, the new data that is not acquired by the current service is identified, and the new data is synchronized to the database of the master service and the slave service.

[0042] The beneficial effects of the present invention are as follows: a method and storage medium for dynamic management of plug-ins of an EMS system service of the present invention simultaneously deploys a master service and a slave service, monitors the two simultaneously deployed services at all times through a sentinel mode, obtains relevant information of the two services in a timely manner, and gives priority to changing the slave service when there is a plug-in change, switches to the slave service after the slave service change is completed, changes the master service, and then switches back to the master service, which can effectively avoid the need to restart the service program in the traditional way, can dynamically manage plug-ins, ensure service continuity while improving the flexibility and timeliness of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A flowchart of a method for dynamic management of plug-ins according to an embodiment of the present invention;

[0044] Figure 2 This is an example diagram of a change architecture of a method for dynamic management of plug-ins according to an embodiment of the present invention;

[0045] Figure 3 This is a specific flow chart of a method for dynamic management of plug-ins according to an embodiment of the present invention;

[0046] Figure 4 This is an example diagram of data authority management of a method for dynamic plug-in management according to an embodiment of the present invention. DETAILED DESCRIPTION

[0047] EMS: Energy Management System, energy management system, is a modern power system integrated automation system based on computer technology, mainly used to monitor and manage power generation and transmission systems.

[0048] Please refer to Figures 1 to 4 , a method for dynamic management of plug-ins, comprising the steps of:

[0049] S1. Run the main service, put the slave service in a suspended state, and establish a sentinel program to monitor the plug-in information of the main service and the slave service;

[0050] S2. receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request;

[0051] S3. When the sentinel program detects that there is a difference in the plug-in information between the main service and the slave service, it switches to the slave service, updates the plug-in in the main service after the switch is completed, and switches back to the main service after the plug-in update of the main service is completed.

[0052] From the above description, it can be seen that the beneficial effects of the present invention are: a method and storage medium for dynamic management of plug-ins of the present invention, simultaneously deploys a master service and a slave service, monitors the two services deployed simultaneously at all times through the sentinel mode, obtains the relevant information of the two services in a timely manner, and gives priority to changing the slave service when there is a plug-in change, switches to the slave service after the slave service change is completed, changes the master service, and then switches back to the master service, which can effectively avoid the need to restart the service program under the traditional method, can dynamically manage plug-ins, ensure service continuity while improving the flexibility and timeliness of the system.

[0053] Furthermore, when performing the operation switching between the main service and the slave service, the following steps are also included:

[0054] S31, the bottom data center writes the collected data into the cache with a timestamp;

[0055] S32: After the operation switching between the master service and the slave service is completed, the data of the current service is compared with the data in the cache according to the timestamp, the new data that is not acquired by the current service is identified, and the new data is synchronized to the database of the master service and the slave service.

[0056] From the above description, we can know that during the service switching, the data collected by the underlying data center is cached and written, and after the switching is completed, it is compared with the data of the current service based on the timestamp, without comparing the data, so that the newly added data can be quickly identified. The newly added data is written into the database of the master and slave services to achieve synchronous update of the data of the master and slave services.

[0057] Furthermore, the master service and the slave service are based on the same database.

[0058] From the above description, it can be seen that the device data of the master and slave services are stored in the same database. During the service switching process, a faster response can be obtained, and there is no need for a synchronous merging process between the two to ensure data sharing.

[0059] Furthermore, before step S1, the following steps are also included:

[0060] S0. Establish two identical system services, assign operation priority weights, and identify them as a primary service and a secondary service.

[0061] As can be seen from the above description, the primary service and the secondary service are distinguished by running the priority weight allocation.

[0062] Furthermore, the plug-in change request includes any one of initializing, enabling, disabling or uninstalling the plug-in, and adding, modifying or updating the third-party interface.

[0063] As can be seen from the above description, the initialization, activation, shutdown or uninstallation of a plug-in, as well as the addition, modification or update of a third-party interface are collectively referred to as plug-in changes.

[0064] Furthermore, the method further comprises the steps of:

[0065] S4. Receive an information acquisition request from a plug-in, and determine whether the request source is a trusted plug-in or a third-party plug-in according to a preset plug-in management library table. If the request source is the trusted plug-in, provide core data and standard data for the trusted plug-in; if the request source is the third-party plug-in, provide standard data for the third-party plug-in.

[0066] From the above description, it can be seen that data support with different permissions is provided according to the source of the plug-in to ensure data security.

[0067] A storage medium for dynamic plug-in management, on which a computer program is stored, and when the computer program is executed, the following steps are implemented:

[0068] S1. Run the main service, put the slave service in a suspended state, and establish a sentinel program to monitor the plug-in information of the main service and the slave service;

[0069] S2. receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request;

[0070] S3. When the sentinel program detects that there is a difference in the plug-in information between the main service and the slave service, it switches to the slave service, updates the plug-in in the main service after the switch is completed, and switches back to the main service after the plug-in update of the main service is completed.

[0071] From the above description, it can be seen that the beneficial effects of the present invention are: a method and storage medium for dynamic management of plug-ins of the present invention, simultaneously deploys a master service and a slave service, monitors the two services deployed simultaneously at all times through the sentinel mode, obtains the relevant information of the two services in a timely manner, and gives priority to changing the slave service when there is a plug-in change, switches to the slave service after the slave service change is completed, changes the master service, and then switches back to the master service, which can effectively avoid the need to restart the service program under the traditional method, can dynamically manage plug-ins, ensure service continuity while improving the flexibility and timeliness of the system.

[0072] Furthermore, when performing the operation switching between the main service and the slave service, the following steps are also included:

[0073] S31, the bottom data center writes the collected data into the cache with a timestamp;

[0074] S32: After the operation switching between the master service and the slave service is completed, the data of the current service is compared with the data in the cache according to the timestamp, the new data that is not acquired by the current service is identified, and the new data is synchronized to the database of the master service and the slave service.

[0075] From the above description, we can know that during the service switching, the data collected by the underlying data center is cached and written, and after the switching is completed, it is compared with the data of the current service based on the timestamp, without comparing the data, so that the newly added data can be quickly identified. The newly added data is written into the database of the master and slave services to achieve synchronous update of the data of the master and slave services.

[0076] Furthermore, the master service and the slave service are based on the same database.

[0077] From the above description, it can be seen that the device data of the master and slave services are stored in the same database. During the service switching process, a faster response can be obtained, and there is no need for a synchronous merging process between the two to ensure data sharing.

[0078] Furthermore, before step S1, the following steps are also included:

[0079] S0. Establish two identical system services, assign operation priority weights, and identify them as a primary service and a secondary service.

[0080] As can be seen from the above description, the primary service and the secondary service are distinguished by running the priority weight allocation.

[0081] Furthermore, the plug-in change request includes any one of initializing, enabling, disabling or uninstalling the plug-in, and adding, modifying or updating the third-party interface.

[0082] As can be seen from the above description, the initialization, activation, shutdown or uninstallation of a plug-in, as well as the addition, modification or update of a third-party interface are collectively referred to as plug-in changes.

[0083] Furthermore, the method further comprises the steps of:

[0084] S4. Receive an information acquisition request from a plug-in, and determine whether the request source is a trusted plug-in or a third-party plug-in according to a preset plug-in management library table. If the request source is the trusted plug-in, provide core data and standard data for the trusted plug-in; if the request source is the third-party plug-in, provide standard data for the third-party plug-in.

[0085] From the above description, it can be seen that data support with different permissions is provided according to the source of the plug-in to ensure data security.

[0086] The method and storage medium for dynamic management of plug-ins of the present invention are applicable to dynamic management of plug-ins of a service system, and in particular to dynamic management of plug-ins of an EMS system.

[0087] Please refer to Figures 1 to 3 , Embodiment 1 of the present invention is:

[0088] A method for dynamic management of plug-ins, comprising the steps of:

[0089] S0. Establish two identical system services, assign operation priority weights, and identify them as a primary service and a secondary service.

[0090] S1. Run the main service, put the slave service in a suspended state, and establish a sentinel program to monitor the plug-in information of the main service and the slave service;

[0091] The master service and the slave service are based on the same database.

[0092] In this embodiment, two services, master and slave, are deployed, and the sentinel mode is used to monitor the two services deployed at the same time at all times to obtain relevant information of the two services in a timely manner. On the one hand, the high availability of the program is achieved, and on the other hand, it also lays a good foundation for non-sensitive loading and uninstalling of third-party plug-ins.

[0093] Sentinel program monitoring: mainly monitors the versions, quantity, and status of the many plug-ins in the program set, as well as whether the entire program can run normally. If there is a change, the following process will be followed. If it is found that the current service can no longer run, it will switch to another program to ensure the normal operation of the project, and push logs so that operation and maintenance can track and handle exceptions in a timely manner.

[0094] The device data of the master and slave services are stored in the same database, which has a faster response speed during the service switching process. At the same time, the data lost in the frame at the switching moment can also be received. There is no need to merge and synchronize between the master and slave services, and the data is shared.

[0095] With two identical services, the master and slave, the program can prioritize the execution of the master service based on the weight set at the beginning. At this time, the slave program is in a suspended state.

[0096] S2. receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request;

[0097] The plug-in change request includes any one of the actions of initializing, enabling, closing or uninstalling the plug-in, and adding, modifying or updating the third-party interface.

[0098] In this embodiment, when new requirements are obtained, such as the need to add or modify a third-party interface, only the slave service needs to be updated, and the master service still maintains the normal operation of the program.

[0099] S3. When the sentinel program detects that there is a difference in the plug-in information between the main service and the slave service, it switches to the slave service, updates the plug-in in the main service after the switch is completed, and switches back to the main service after the plug-in update of the main service is completed.

[0100] In this embodiment, when the slave service is updated, the sentinel will detect that the versions of the two services are inconsistent, and then switch to the latest version of the slave service. When the switch is successful, we will update the plug-in in the main service, thereby realizing the dynamic loading, enabling, and disabling of shared plug-ins without stopping the EMS system.

[0101] In addition, for multiple plug-in update requests that arrive at the same time, or a new plug-in update request arrives during the update process, wait for the current update to complete and repeat steps S2 and S3 for sequential processing. Plug-in updates must have their own version numbers, and version updates must be ordered. During the process of automatically updating a lower version, if there is a new higher version that needs to be updated / loaded, it is necessary to wait for the lower version of the plug-in to be updated before processing.

[0102] Please refer to Figure 4 , Embodiment 2 of the present invention is:

[0103] A method for dynamic management of plug-ins, which differs from the first embodiment in that it further comprises the steps of:

[0104] S4. Receive an information acquisition request from a plug-in, and determine whether the request source is a trusted plug-in or a third-party plug-in according to a preset plug-in management library table. If the request source is the trusted plug-in, provide core data and standard data for the trusted plug-in; if the request source is the third-party plug-in, provide standard data for the third-party plug-in.

[0105] In this embodiment, each plug-in has a corresponding plug-in name, plug-in version number, user and plug-in category. After the corresponding plug-in is coded, the corresponding information will be entered into the plug-in management library table. In this way, the trusted plug-in and the third-party plug-in can be distinguished and retrieved.

[0106] A new shared plug-in interface has been added to data service management. First, the original data is collected by the program, and then managed through the newly created code script according to the needs and permissions of third-party users. For example, you can refer to Figure 4 , the docking user A is a self-developed platform, which is a deep cooperation, so his authority is naturally relatively high. In script development, some core data can be provided; then when targeting user B, some core data can be hidden and only some standard data can be provided.

[0107] Embodiment 3 of the present invention is:

[0108] A storage medium for dynamic management of plug-ins stores a computer program thereon, and when the computer program is executed, the steps in a method for dynamic management of plug-ins in the first or second embodiment above are implemented.

[0109] In summary, the present invention provides a method and storage medium for dynamic management of plug-ins, which deploys a master service and a slave service at the same time. The two services deployed at the same time are constantly monitored through the sentinel mode, and the relevant information of the two services is obtained in time. When there is a plug-in change, the slave service is changed first, and after the slave service change is completed, it switches to the slave service to run, changes are made to the master service, and then switches back to the master service. This can effectively avoid the need to restart the service program under the traditional method, and can dynamically manage plug-ins to ensure continuous service while improving the flexibility and timeliness of the system.

[0110] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for dynamic management of plug-ins for EMS system services, characterized in that: Includes steps: S0. Establish two identical system services and distinguish them into primary service and secondary service; S1. Run the main service, put the slave service in a suspended state, and establish a sentinel program to monitor the plug-in information of the main service and the slave service; The plug-in information includes the number of plug-ins and the version of each plug-in; The master service and the slave service are based on the same database; S2. receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request; S3, when the sentinel program detects that there is a difference in the plug-in information between the main service and the slave service, it switches to the slave service, updates the plug-in in the main service after the switch is completed, and switches back to the main service after the plug-in update of the main service is completed; When performing the operation switching between the main service and the slave service, the steps are also included: S31, the bottom data center writes the collected data into the cache with a timestamp; S32: After the operation switching between the master service and the slave service is completed, the data of the current service is compared with the data in the cache according to the timestamp, the new data that is not acquired by the current service is identified, and the new data is synchronized to the database of the master service and the slave service.

2. The method for dynamic management of plug-ins of EMS system services according to claim 1, characterized in that: The plug-in change request includes any one of the actions of initializing, enabling, closing or uninstalling the plug-in, and adding, modifying or updating the third-party interface.

3. The method for dynamic management of plug-ins of EMS system services according to claim 1, characterized in that: Also includes the steps: S4. Provide data support with different permissions based on the source of the plug-in.

4. The method for dynamic management of plug-ins of EMS system services according to claim 3, characterized in that: Step S4 comprises the steps of: Receive an information acquisition request from a plug-in, and determine whether the request source is a trusted plug-in or a third-party plug-in according to a preset plug-in management library table. If the request source is the trusted plug-in, provide core data and standard data for the trusted plug-in; if the request source is the third-party plug-in, provide standard data for the third-party plug-in.

5. The method for dynamic management of plug-ins of EMS system services according to claim 1, characterized in that: Step S0 is specifically as follows: Create two identical system services, assign operation priority weights, and identify them as the primary service and the secondary service.

6. A storage medium for dynamic management of plug-ins for EMS system services, on which a computer program is stored, characterized in that: When the computer program is executed, the following steps are implemented: S0. Establish two identical system services and distinguish them into primary service and secondary service; S1. Run the main service, put the slave service in a suspended state, and establish a sentinel program to monitor the plug-in information of the main service and the slave service; The plug-in information includes the number of plug-ins and the version of each plug-in; The master service and the slave service are based on the same database; S2. receiving a plug-in change request, and processing the plug-in in the slave service according to the plug-in change request; S3, when the sentinel program detects that there is a difference in the plug-in information between the main service and the slave service, it switches to the slave service, updates the plug-in in the main service after the switch is completed, and switches back to the main service after the plug-in update of the main service is completed; When performing the operation switching between the main service and the slave service, the steps are also included: S31, the bottom data center writes the collected data into the cache with a timestamp; S32: After the operation switching between the master service and the slave service is completed, the data of the current service is compared with the data in the cache according to the timestamp, the new data that is not acquired by the current service is identified, and the new data is synchronized to the database of the master service and the slave service.

7. The storage medium for dynamic management of plug-ins of EMS system services according to claim 6, characterized in that: The plug-in change request includes any one of the actions of initializing, enabling, closing or uninstalling the plug-in, and adding, modifying or updating the third-party interface.

8. The storage medium for dynamic management of plug-ins of an EMS system service according to claim 6, characterized in that: Also includes the steps: S4. Provide data support with different permissions based on the source of the plug-in.

9. The storage medium for dynamic management of plug-ins of EMS system services according to claim 8, characterized in that: Step S4 comprises the steps of: Receive an information acquisition request from a plug-in, and determine whether the request source is a trusted plug-in or a third-party plug-in according to a preset plug-in management library table. If the request source is the trusted plug-in, provide core data and standard data for the trusted plug-in; if the request source is the third-party plug-in, provide standard data for the third-party plug-in.

10. The storage medium for dynamic management of plug-ins of EMS system services according to claim 6, characterized in that: Step S0 is specifically as follows: Create two identical system services, assign operation priority weights, and identify them as the primary service and the secondary service.

Citation Information

Patent Citations

  • Service plug-in management method and system

    CN106708547A

  • Access service processing method, system and device, electronic equipment and storage medium

    CN115514667A

  • Plug-in dynamic management method and storage medium

    CN118245138A

  • A system for real-time network based vulnerability assessment of a host / device

    WO2005101789A1