Plug-in loading method, device, electronic device, and storage medium

By designing independent plug-ins and task separation logic codes in the integrated system, the problem of high plug-ins' functional coupling is solved, and the plug-ins' mutual independence is achieved, ensuring system stability and easy maintenance.

CN114047976BActive Publication Date: 2024-11-19SHANGHAI ELECTRIC WIND POWER GRP CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202111370410.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2024-11-19
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

The plug-in function of existing integrated systems is highly coupled, resulting in modification or failure of one plug-in may affect the stability of the entire system.

Method used

By designing independent plug-ins in an integrated system, each plug-in implements only one business function, and separates logical code through built-in tasks and custom tasks, activates the target plug-in to respond to business service requests, ensuring that the plug-ins are independent of each other and avoids dependencies.

Benefits of technology

Functional decoupling and business isolation of plug-ins are realized, ensuring that modifications or failures of one plug-in will not affect other plug-ins, and improving the stability and maintenance convenience of the integrated system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114047976B_ABST
    Figure CN114047976B_ABST
Patent Text Reader

Abstract

The present invention discloses a plug-in loading method, device, electronic device, and storage medium. The method is applied to an integrated system, wherein the integrated system includes a plurality of independent plug-ins, each plug-in is used to implement a business function, and each plug-in includes an execution task for implementing the business function; the plug-in loading method includes: upon receiving a business service request, determining a target plug-in for responding to the business service request; activating the execution task of the target plug-in, so that the activated execution task starts a thread to respond to the business service request. The plug-in loaded by the integrated system has no dependency relationship with other plug-ins, that is, each plug-in is independent of each other, and each plug-in only implements one business function, so that the modification or failure of a plug-in will not affect other plug-ins, and will not affect the entire integrated system or will have little impact, thereby ensuring the stability of the operation of the integrated system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a plug-in loading method, device, electronic equipment, and storage medium. Background Art

[0002] Plug-ins can extend the functions of integrated systems and are widely used in integrated systems. However, the functional coupling of plug-ins in integrated systems is high, and the code calls are confusing. The modification or failure of a plug-in often affects other plug-ins and even seriously affects the stability of the entire integrated system. Summary of the invention

[0003] The technical problem to be solved by the present invention is to overcome the defect of high plug-in coupling degree of the integrated system in the prior art, and to provide a plug-in loading method, device, electronic device and storage medium.

[0004] The present invention solves the above technical problems through the following technical solutions:

[0005] In a first aspect, a plug-in loading method is provided, which is applied to an integrated system, wherein the integrated system includes a plurality of independent plug-ins, each plug-in is used to implement a business function, and each plug-in includes an execution task for implementing the business function; the plug-in loading method includes:

[0006] Upon receiving a business service request, determining a target plug-in for responding to the business service request;

[0007] The execution task of the target plug-in is activated so that the activated execution task starts a thread to realize the response to the business service request.

[0008] Optionally, the execution tasks include: built-in tasks and custom tasks;

[0009] The logic code of built-in tasks of each plug-in is the same;

[0010] The logic code of the custom task corresponds to the business function of the plug-in to which it belongs.

[0011] Optionally, there are multiple built-in tasks; activating the execution task of the target plug-in includes:

[0012] Activate all or part of the multiple built-in tasks, and each activated built-in task starts a thread;

[0013] And / or, the number of the custom tasks is multiple; activating the execution task of the target plug-in includes:

[0014] Activate all or part of the built-in tasks in multiple custom tasks. Each activated custom task starts a thread.

[0015] Optionally, it also includes:

[0016] In case of receiving a first modification request for the custom task, modifying the custom task according to the first modification request.

[0017] Optionally, each of the plug-ins further includes configuration information;

[0018] The configuration information is used to determine adjustable parameters in the logic code for executing the task.

[0019] Optionally, it also includes:

[0020] In case of receiving a second modification request for the configuration information, modify the configuration information according to the second modification request.

[0021] In a second aspect, a plug-in loading device is provided, which is applied to an integrated system, wherein the integrated system includes a plurality of independent plug-ins, each plug-in is used to implement a business function, and each plug-in includes an execution task for implementing the business function; the plug-in loading method includes:

[0022] A determination module, configured to determine, upon receiving a business service request, a target plug-in for responding to the business service request;

[0023] The activation module is used to activate the execution task of the target plug-in so that the activated execution task starts a thread to respond to the business service request.

[0024] Optionally, the execution tasks include: built-in tasks and custom tasks;

[0025] The logic code of built-in tasks of each plug-in is the same;

[0026] The logic code of the custom task corresponds to the business function of the plug-in to which it belongs.

[0027] Optionally, there are multiple built-in tasks; and the activation module is specifically used to:

[0028] Activate all or part of the multiple built-in tasks, and each activated built-in task starts a thread;

[0029] And / or, the number of the custom tasks is multiple; the activation module is specifically used for:

[0030] Activate all or part of the built-in tasks in multiple custom tasks. Each activated custom task starts a thread.

[0031] Optionally, it also includes:

[0032] The first modification module is configured to modify the custom task according to a first modification request when a first modification request for the custom task is received.

[0033] Optionally, each of the plug-ins further includes configuration information;

[0034] The configuration information is used to determine adjustable parameters in the logic code for executing the task.

[0035] Optionally, it also includes:

[0036] The second modification module is used to modify the configuration information according to the second modification request when receiving the second modification request for the configuration information.

[0037] According to a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned plug-in loading methods when executing the computer program.

[0038] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the plug-in loading method described in any one of the above items is implemented.

[0039] The positive and progressive effect of the present invention is that in the embodiment of the present invention, the plug-in loaded by the integrated system has no dependency on other plug-ins, that is, each plug-in is independent of each other, and each plug-in only implements one business function, so that the modification or failure of a plug-in will not affect other plug-ins, will not affect the entire integrated system or will have very little impact, thereby ensuring the stability of the operation of the integrated system. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A flowchart of a plug-in loading method provided by an exemplary embodiment of the present invention;

[0041] Figure 2 A schematic diagram of a scenario of a plug-in loading method provided by an exemplary embodiment of the present invention;

[0042] Figure 3 A schematic diagram of a module of a plug-in loading device provided by an exemplary embodiment of the present invention;

[0043] Figure 4 The present invention provides a schematic structural diagram of an electronic device according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0044] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.

[0045] An embodiment of the present invention provides a plug-in loading method, which is applied to an integrated system, and the integrated system may be, but is not limited to, a SCADA (Supervisory Control And Data Acquisition) system. The integrated system includes a plurality of independent plug-ins, each plug-in is used to implement a business function, and each plug-in includes an execution task for implementing the business function. Each plug-in may also include configuration information, which is used to determine adjustable parameters in the logic code of the execution task, for example, the execution frequency, execution conditions, execution times, etc. of the execution task. The configuration information may be recorded in a configuration file of the plug-in.

[0046] In the embodiment of the present invention, when developing a plug-in for an integrated system, the developer divides the functions that need to be expanded in the integrated system into the minimum functional units that can be independently implemented by a plug-in, and for each minimum functional unit, writes the logic code of the plug-in for implementing the minimum functional unit, so that each plug-in only implements one business function, and each plug-in is independent of each other, that is, each plug-in has no dependency relationship with other plug-ins. Since each plug-in only implements one business function, and each plug-in is independent of each other, functional decoupling and business isolation of the plug-in are achieved, and the plug-in can be hot-swapped, and starting and stopping a plug-in will not affect other plug-ins.

[0047] Figure 1 A flowchart of a plug-in loading method provided by an exemplary embodiment of the present invention, the plug-in loading method is implemented using the plug-in developed above, see Figure 1 , the plug-in loading method includes the following steps:

[0048] Step 101: upon receiving a business service request, determine a target plug-in for responding to the business service request.

[0049] Different business service requests implement different business functions and require different plug-ins. For example, for a business service request for data transmission, the required plug-in is a data transmission plug-in; for a business service request for data storage, the required plug-in is a data storage plug-in; for a business service request for data processing, the required plug-in is a data processing plug-in.

[0050] In one embodiment, the correspondence between the business service request and the plug-in may be preconfigured, and when a business service request is received, the target plug-in corresponding to the received business service request is determined according to the correspondence.

[0051] It should be noted that one business service request may correspond to one plug-in or multiple plug-ins, which is not particularly limited in the embodiment of the present invention.

[0052] Step 102: Activate the execution task of the target plug-in, so that the activated execution task starts a thread to respond to the business service request.

[0053] In the embodiment of the present invention, the plug-in loaded by the integrated system has no dependency relationship with other plug-ins, that is, each plug-in is independent of each other, and each plug-in only implements one business function, that is, each plug-in performs its own duties and acts independently, so that the modification or failure of a plug-in will not affect other plug-ins, will not affect the entire integrated system or will have little impact, thereby ensuring the stability of the operation of the integrated system. In addition, independent plug-ins are also convenient for development and maintenance.

[0054] In one embodiment, the execution task includes: built-in tasks (Actor) and custom tasks (Task). The logic code of the built-in tasks of each plug-in is the same; the logic code of the custom task corresponds to the business function of the plug-in to which it belongs.

[0055] When developing a plug-in, the execution tasks are divided into built-in tasks and custom tasks. The logic code of the built-in tasks is written by the plug-in developer, and an interface is provided for editing all or part of the logic code of the custom task, so that the operation and maintenance personnel of the integrated system can write or modify the logic code of the custom task according to actual needs, realize the personalized definition of the business functions of the plug-in, and expand the functions to meet the needs of various usage scenarios.

[0056] It should be noted that the number of built-in tasks can be one or more, and similarly, the number of custom tasks can be one or more.

[0057] In one embodiment, there are multiple built-in tasks, and multiple built-in tasks can be activated simultaneously to start multiple threads to implement multi-threaded execution of services, wherein each activated built-in task starts one thread.

[0058] In one embodiment, there are multiple custom tasks, and multiple custom tasks can be activated simultaneously to start multiple threads to implement multi-threaded execution of services, wherein each activated custom task starts one thread.

[0059] In one embodiment, a modification interface of a custom task is opened to the operation and maintenance personnel of the integrated system so that the operation and maintenance personnel can modify the logic code of the custom system. Specifically, the operation and maintenance personnel can send a first modification request for the custom task to the integrated system through the interface, and the integrated system, upon receiving the first modification request for the custom task, modifies the custom task according to the first modification request.

[0060] In one embodiment, a configuration information modification interface is opened to the operation and maintenance personnel of the integrated system so that the operation and maintenance personnel can modify the configuration information of the execution task. Specifically, the operation and maintenance personnel can send a second modification request for the configuration information to the integrated system through the interface, and the integrated system modifies the configuration information according to the second modification request when receiving the second modification request for the configuration information.

[0061] The modification interface of the custom task and the modification interface of the configuration information may adopt the same interface or two interfaces, which may be, for example, a page API (Application Programming Interface) interface.

[0062] Figure 2 A scenario diagram of a plug-in loading method provided by an exemplary embodiment of the present invention is shown. The figure takes a file transfer scenario as an example and further illustrates the plug-in loading process through the interaction of two plug-ins.

[0063] In the file transfer scenario, the file transfer service integrates FRAMWORK (integration). To implement file transfer, at least two plug-ins are required, one deployed on the CLIENT (client) to send files, and the other deployed on the SERVER (server) to receive files.

[0064] When the client's SCADA system receives a business service request for file transfer, it determines that the target plug-in for responding to the business service request is plug-in a for sending files, and then starts plug-in a. When plug-in a is started, the ACTOR of the plug-in is activated. Multiple ACTORs can be activated at the same time. The activated multiple ACTORs each start a thread to send the real-time data file of SCADA, realizing multi-threaded transmission of files and improving file transmission efficiency. In addition, an ACTOR can be activated to start a thread to monitor whether the historical data transmission is smooth, and an ACTOR can be activated to start a thread to monitor the operation status of the client's SCADA system.

[0065] As needed, when plug-in a is started, the plug-in's TASK is also activated to ensure other special tasks, such as sending historical data files of the SCADA system. ACTOR and TASK are independent of each other.

[0066] When the SCADA system of the server receives a business service request for file transfer, it determines that the target plug-in used to respond to the business service request is plug-in b used to receive files, and then starts plug-in b. When plug-in b is started, the ACTOR of the plug-in is activated. Multiple ACTORs can be activated at the same time. The activated multiple ACTORs each start a thread to receive the real-time data file of SCADA, realize multi-threaded transmission of files, and improve file transmission efficiency. In addition, an ACTOR can also be activated to start a thread to reply whether the real-time data file is received smoothly, and an ACTOR can also be activated to start a thread to monitor the operation status of the SCADA system on the server.

[0067] As needed, when plug-in b is started, the plug-in's TASK is also activated to ensure other special tasks, such as receiving historical data files from the SCADA system, storing them in a specified directory, and recording information.

[0068] At this point, a complete file transfer service is started.

[0069] The following uses the data processing scenario as an example to further explain the process of plug-in loading.

[0070] In the data processing scenario, a plug-in is required to implement data processing. Take the SCADA system in which the plug-in is deployed on the server as an example.

[0071] When the SCADA system on the server side receives a business service request for data processing, it determines that the target plug-in used to respond to the business service request is plug-in c used for data processing, and then starts plug-in c. When plug-in c is started, the ACTOR of the plug-in is activated. Multiple ACTORs can be activated at the same time. The activated multiple ACTORs each start a thread to process data. For example, some activated ACTORs start threads to process data generated by consumers, and some activated ACTORs start threads to process data generated by producers.

[0072] The producer only generates data that needs to be processed. The data volume is small and the processing is simple. One or a small number of activated ACTORs can be used to process the data generated by the producer. The data generated by the consumer is more complex and the data volume is large. Multiple activated ACTORs can be used to process the data generated by the consumer. Several TASKs can also be activated to process the data generated by the consumer, realizing multi-threaded data processing and improving data processing efficiency.

[0073] The data processing service startup is complete.

[0074] In the file transfer scenario and data processing scenario, different plug-ins are used to implement the corresponding business functions. Since plug-in a and plug-in b are independent of each other and do not affect each other, the two will not affect the business of both parties. Among them, the activation mechanism such as the activation time and quantity of ACTOR and / or TASK can be defined in the configuration file of the plug-in, so that when the plug-in is started, ACTOR and / or TASK are activated according to the configuration information in the configuration file.

[0075] Corresponding to the embodiment of the plug-in loading method, the present invention also provides an embodiment of a plug-in loading device.

[0076] Figure 3 A schematic diagram of a module of a plug-in loading device provided by an exemplary embodiment of the present invention, wherein the plug-in loading device is applied to an integrated system, wherein the integrated system includes a plurality of independent plug-ins, each plug-in is used to implement a business function, and each plug-in includes an execution task for implementing the business function; the plug-in loading method includes:

[0077] A determination module 31, configured to determine a target plug-in for responding to a business service request when a business service request is received;

[0078] The activation module 32 is used to activate the execution task of the target plug-in, so that the activated execution task starts a thread to respond to the business service request.

[0079] Optionally, the execution tasks include: built-in tasks and custom tasks;

[0080] The logic code of built-in tasks of each plug-in is the same;

[0081] The logic code of the custom task corresponds to the business function of the plug-in to which it belongs.

[0082] Optionally, there are multiple built-in tasks; and the activation module is specifically used to:

[0083] Activate all or part of the multiple built-in tasks, and each activated built-in task starts a thread;

[0084] And / or, the number of the custom tasks is multiple; the activation module is specifically used for:

[0085] Activate all or part of the built-in tasks in multiple custom tasks. Each activated custom task starts a thread.

[0086] Optionally, it also includes:

[0087] The first modification module is configured to modify the custom task according to a first modification request when a first modification request for the custom task is received.

[0088] Optionally, each of the plug-ins further includes configuration information;

[0089] The configuration information is used to determine adjustable parameters in the logic code for executing the task.

[0090] Optionally, it also includes:

[0091] The second modification module is used to modify the configuration information according to the second modification request when receiving the second modification request for the configuration information.

[0092] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.

[0093] Figure 4 FIG. 4 is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present invention, and shows a block diagram of an exemplary electronic device 40 suitable for implementing the embodiment of the present invention. Figure 4 The electronic device 40 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0094] like Figure 4 As shown, the electronic device 40 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 40 may include, but are not limited to: at least one processor 41, at least one memory 42, and a bus 43 connecting different system components (including the memory 42 and the processor 41).

[0095] The bus 43 includes a data bus, an address bus, and a control bus.

[0096] The memory 42 may include a volatile memory, such as a random access memory (RAM) 421 and / or a cache memory 422 , and may further include a read-only memory (ROM) 423 .

[0097] The memory 42 may also include a program tool 425 (or utility) having a set (at least one) of program modules 424, such program modules 424 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0098] The processor 41 executes various functional applications and data processing by running the computer program stored in the memory 42, such as the method provided in any of the above embodiments.

[0099] The electronic device 40 may also communicate with one or more external devices 44 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 45. Furthermore, the model-generated electronic device 40 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 46. As shown, the network adapter 46 communicates with other modules of the model-generated electronic device 40 via a bus 43. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the model-generated electronic device 40, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0100] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0101] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method provided in any of the above embodiments are implemented.

[0102] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.

[0103] In a possible implementation manner, the present invention may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of the method provided in any of the above embodiments.

[0104] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely on a user device, partially on a user device, as an independent software package, partially on a user device and partially on a remote device, or entirely on a remote device.

[0105] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A plug-in loading method, It is characterized in that Applied to an integrated system, the integrated system includes a plurality of mutually independent plug-ins, each plug-in is used to implement a business function, and each plug-in includes an execution task for implementing the business function; The plug-in loading method comprises: Upon receiving a business service request, determining a target plug-in for responding to the business service request; Activating the execution task of the target plug-in so that the activated execution task starts a thread to respond to the business service request; The execution tasks include: built-in tasks and custom tasks; The logic code of built-in tasks of each plug-in is the same; The logic code of the custom task corresponds to the business function of the plug-in to which it belongs; The number of the built-in tasks is multiple; activating the execution task of the target plug-in includes: Activate all or part of the multiple built-in tasks. Each activated built-in task starts a thread.

2. The plug-in loading method according to claim 1, It is characterized in that The number of the custom tasks is multiple; activating the execution task of the target plug-in includes: Activate all or part of the built-in tasks in multiple custom tasks. Each activated custom task starts a thread.

3. The plug-in loading method according to claim 1, It is characterized in that Also includes: In case of receiving a first modification request for the custom task, modifying the custom task according to the first modification request.

4. The plug-in loading method according to claim 1, It is characterized in that The plug-in also includes configuration information; The configuration information is used to determine adjustable parameters in the logic code for executing the task.

5. The plug-in loading method according to claim 4, It is characterized in that Also includes: In case of receiving a second modification request for the configuration information, modify the configuration information according to the second modification request.

6. A plug-in loading device, It is characterized in that Applied to an integrated system, the integrated system includes a plurality of mutually independent plug-ins, each plug-in is used to implement a business function, and each plug-in includes an execution task for implementing the business function; The plug-in loading device comprises: A determination module, configured to determine, upon receiving a business service request, a target plug-in for responding to the business service request; An activation module, used to activate the execution task of the target plug-in, so that the activated execution task starts a thread to respond to the business service request; The execution tasks include: built-in tasks and custom tasks; The logic code of built-in tasks of each plug-in is the same; The logic code of the custom task corresponds to the business function of the plug-in to which it belongs; The number of the built-in tasks is multiple; The activation module is specifically used to activate all or part of the multiple built-in tasks, and each activated built-in task starts a thread.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the plug-in loading method according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the plug-in loading method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Plug-in type smart energy system development method, development platform and smart energy system

    CN109885313A

  • Multi-service server implementation method and device

    CN110007980A

  • Plug-in calling method and device, electronic equipment and storage medium

    CN112068902A

  • Cross-platform security service software construction method, device and equipment and storage medium

    CN112394917A

  • Service implementation method and device

    CN113282318A