CN112559083B - Function plug-in execution method, device, electronic equipment and storage medium - Google Patents

Function plug-in execution method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112559083B
CN112559083B CN202011556225.7A CN202011556225A CN112559083B CN 112559083 B CN112559083 B CN 112559083B CN 202011556225 A CN202011556225 A CN 202011556225A CN 112559083 B CN112559083 B CN 112559083B
Authority
CN
China
Prior art keywords
plugin
function
target
plug
class
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011556225.7A
Other languages
Chinese (zh)
Other versions
CN112559083A (en
Inventor
陈俊立
陈林
高斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu New Hope Finance Information Co Ltd
Original Assignee
Chengdu New Hope Finance Information Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu New Hope Finance Information Co Ltd filed Critical Chengdu New Hope Finance Information Co Ltd
Priority to CN202011556225.7A priority Critical patent/CN112559083B/en
Publication of CN112559083A publication Critical patent/CN112559083A/en
Application granted granted Critical
Publication of CN112559083B publication Critical patent/CN112559083B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a function plug-in execution method, a device, electronic equipment and a storage medium, and relates to the technical field of data processing, wherein the method comprises the following steps: and establishing a class, annotating the class name of the class based on the function plugin library to obtain a specified function plugin library, establishing a specified method in the specified function plugin library, and annotating the method name of the specified method based on the function plugin method to obtain the specified function plugin. And developing a specific function plugin based on the function plugin code template structure, analyzing the designated function plugin library to obtain function plugin class information, obtaining function plugin method information based on the function plugin class information, calling a target based on the first plugin to execute the target plugin according to the function plugin method information of the target plugin, and obtaining a target execution checking result. The method and the device can improve inheritance of function plug-in call by constructing the first plug-in to realize the call standard of providing the unified target plug-in.

Description

Function plug-in execution method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and apparatus for executing a function plug-in, an electronic device, and a storage medium.
Background
At present, different calling modes and calling standards exist for the function plug-in, and the result after the function plug-in is called and executed in different calling modes cannot be inherited on different application platform systems, so that the problem of low inheritability of the function plug-in calling exists.
Disclosure of Invention
The embodiment of the application provides a function plug-in execution method, a function plug-in execution device, electronic equipment and a storage medium, so as to solve the problem that the inheritance of calling of the function plug-in is low in the current method.
The embodiment of the application provides a function plug-in execution method, which comprises the following steps:
establishing a class, and annotating and marking the class name of the class based on a function plugin library to obtain a specified function plugin library corresponding to the class;
establishing at least one specified method in the specified function plugin library, and annotating the method name of the at least one specified method based on the function plugin method to obtain at least one specified function plugin corresponding to the at least one specified method;
constructing a function plug-in code template structure based on the type of the return value of the at least one appointed function plug-in, and developing a specific function plug-in based on the function plug-in code template structure, wherein the specific function plug-in comprises method parameter information of the specific function plug-in, and the specific function plug-in is part or all of the at least one appointed function plug-in;
analyzing the appointed function plugin library to obtain function plugin class information, and analyzing the at least one appointed function plugin based on the function plugin class information to obtain function plugin method information;
and calling a target plugin based on the first plugin to execute the target plugin according to the function plugin method information of the target plugin to obtain a target plugin execution result, wherein the target plugin is any one of the specific function plugins.
In the implementation process, the function plugin class information, the function plugin method information and the function plugin method parameter information are provided by the first plugin outwards, namely, the method parameter information of the target plugin is provided by the first plugin with unified standards to the outside when any required target plugin is called, so that the target plugin is called from the appointed function plugin library and executed, and calling and executing of the target plugin by different platform systems can be realized by adopting the unified first plugin, and the inheritability of calling and executing of the plugin is improved.
Optionally, the calling the target plugin based on the first plugin to execute the target plugin according to the function plugin method information of the target plugin, to obtain a target plugin execution result, including:
establishing an execution engine of a function plugin, wherein the execution engine comprises the first plugin;
calling the first plugin to acquire function plugin method information of the target plugin;
executing, by the execution engine, the target plugin according to the function plugin method information of the target plugin to obtain an execution result of the target plugin;
and returning the execution result of the target plug-in the form of key value pairs.
In the implementation process, the target plugin is executed by a unified execution engine, so that the method can be suitable for different platform systems, and the inheritance of plugin execution is improved. And returning the execution result of the target plug-in the form of a key value pair, obtaining the execution state of the function plug-in based on the key value pair, judging the execution result of the target plug-in based on the execution state of the function plug-in, and improving the execution accuracy of the function plug-in.
Optionally, the execution engine further includes an Action class execution method, and the calling, based on the first plugin, the target plugin is executed according to function plugin method information of the target plugin, so as to obtain a target plugin execution result, including:
calling the first plugin to obtain the function plugin method information of the target plugin, wherein the function plugin method information comprises a function plugin class full path of the target plugin, a function plugin method name of the target plugin and a function plugin parameter value list of the target plugin;
and analyzing and executing the target plugin through the Action class execution method in the execution engine based on the function plugin method information to obtain an execution result of the target plugin.
In the implementation process, the target plugin can be located and found in the appointed function plugin library through the function plugin class full path of the target plugin, the function plugin method name of the target plugin and the function plugin parameter value list of the target plugin, so that the efficiency of locating and calling the target plugin is improved.
Optionally, the returning the target plugin execution result in the form of a key value pair includes:
when the target plug-in is normally executed and has a return value, the return value type is a first preset return value;
when the target plug-in is normally executed and has no return value, the return value type is a second preset return value;
and when the target plug-in is executed abnormally and returns stack information, the return value type is a third preset return value.
In the implementation process, the different execution states of the target program are classified, the execution result of the target plug-in unit can be judged, and the decision of whether the target plug-in unit needs to be repeatedly executed or not can be made according to the different execution states of the target program so as to ensure the accuracy of the execution result of the function plug-in unit.
The embodiment of the application provides a function plug-in execution device, which comprises:
the class creation module is used for creating classes and annotating the class names of the classes based on the function plug-in library to obtain specified function plug-in libraries corresponding to the classes;
the marking module is used for establishing at least one specified method in the specified function plugin library, annotating and marking the method name of at least one specified method based on the function plugin method to obtain at least one specified function plugin corresponding to the at least one specified method;
the type creation module is used for constructing a function plug-in code template structure based on the type of the return value of the at least one specified function plug-in, and developing a specific function plug-in based on the function plug-in code template structure, wherein the specific function plug-in comprises method parameter information of the specific function plug-in, and the specific function plug-in is part or all of the at least one specified function plug-in;
the plug-in providing module is used for analyzing the specified function plug-in library to obtain function plug-in class information and analyzing the at least one specified function plug-in based on the function plug-in class information to obtain function plug-in method information;
and the execution module is used for calling a target plugin based on the first plugin so as to execute the target plugin according to the function plugin method information of the target plugin to obtain a target plugin execution result, wherein the target plugin is any one of the specific function plugins.
In the implementation process, the function plugin class information, the function plugin method information and the function plugin method parameter information are provided by the first plugin outwards, namely, the method parameter information of the target plugin is provided by the first plugin with unified standards to the outside when any required target plugin is called, so that the target plugin is called from the appointed function plugin library and executed, and calling and executing of the target plugin by different platform systems can be realized by adopting the unified first plugin, and the inheritability of calling and executing of the plugin is improved.
Optionally, the execution module is configured to:
establishing an execution engine of a function plugin, wherein the execution engine comprises the first plugin;
calling the first plugin to acquire function plugin method information of the target plugin;
executing the target plugin according to the function plugin method information of the target plugin by the execution engine to obtain an execution result of the target plugin;
and returning the execution result of the target plug-in the form of key value pairs.
In the implementation process, the target plugin is executed by a unified execution engine, so that the method can be suitable for different platform systems, and the inheritance of plugin execution is improved. And returning the execution result of the target plug-in the form of a key value pair, obtaining the execution state of the function plug-in based on the key value pair, judging the execution result of the target plug-in based on the execution state of the function plug-in, and improving the execution accuracy of the function plug-in.
Optionally, the execution module is configured to:
calling the first plugin to obtain the function plugin method information of the target plugin, wherein the function plugin method information comprises a function plugin class full path of the target plugin, a function plugin method name of the target plugin and a function plugin parameter value list of the target plugin;
and analyzing and executing the target plugin through the Action class execution method in the execution engine based on the function plugin method information to obtain an execution result of the target plugin.
In the implementation process, the target plugin can be located and found in the appointed function plugin library through the function plugin class full path of the target plugin, the function plugin method name of the target plugin and the function plugin parameter value list of the target plugin, so that the efficiency of locating and calling the target plugin is improved.
Optionally, the execution module is configured to:
when the target plug-in is normally executed and has a return value, the return value type is a first preset return value;
when the target plug-in is normally executed and has no return value, the return value type is a second preset return value;
and when the target plug-in is executed abnormally and returns stack information, the return value type is a third preset return value.
In the implementation process, the different execution states of the target program are classified, the execution result of the target plug-in unit can be judged, and the decision of whether the target plug-in unit needs to be repeatedly executed or not can be made according to the different execution states of the target program so as to ensure the accuracy of the execution result of the function plug-in unit.
The embodiment also provides an electronic device, which comprises a memory and a processor, wherein the memory stores program instructions, and the processor executes steps in any method when running the program instructions.
The present embodiment also provides a storage medium having stored therein computer program instructions which, when executed by a processor, perform the steps of any of the methods described above.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
Fig. 1 is a flowchart of a method for executing a function plug-in according to an embodiment of the present application.
Fig. 2 is a flowchart of a step of calling an objective function according to an embodiment of the present application.
Fig. 3 is a flowchart of a step of executing a result on a return target plug-in with a key value according to an embodiment of the present application.
Fig. 4 is a flowchart of a step of calling an objective function by using java language according to an embodiment of the present application.
Fig. 5 is a schematic diagram of a function plug-in executing device provided in an embodiment of the present application.
Legend: 60-function plug-in execution means; 601-a class creation module; 602-a marking module; 603-a type creation module; 604-a plug-in providing module; 605-execution module.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In the description of the present application, it should be noted that the terms "first," "second," and the like are used merely to distinguish between descriptions and should not be construed as indicating or implying relative importance.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objects and other advantages of the present application may be realized and attained by the structure particularly pointed out in the written description and drawings.
In order to improve inheritability of function plugin execution, an embodiment of the present application provides a function plugin execution method, please refer to fig. 1, fig. 1 is a flowchart of a function plugin execution method provided in an embodiment of the present application, where the function plugin execution method includes the following sub-steps:
step S1: and establishing a class, and annotating the class name of the marked class based on the function plug-in library to obtain a specified function plug-in library corresponding to the class.
It will be appreciated that the function plug-in library annotations include Class (Class) names, class full paths, details of the function plug-in library, and function plug-in library states (function plug-in library states include enabled or disabled), and that different programming languages may be used to implement the coding of the function plug-in library. By way of example, the function plug-in library annotation includes class names of java classes, java class names, java class full paths, description of the function plug-in library, and function plug-in library state.
It will be appreciated that the marking of the class name with the function plug-in library annotation may convert the common class name into a function plug-in library, and that the marking of the class name with the function plug-in library annotation is exemplified by the following code:
@functional plugin return (class_full_path= "com. Xxx. Yyy. Zz. Assistoperation", class_name_edges= "auxiliary operation plug-in library", is_active=1, plugin_repo_detail= "detailed description of the function plug-in library");
public class AssistOperation{
}
as can be seen from the marking process, the function plug-in library notes
FunctionPluginRepo (class_full_path= "com. Xxx. Yy. Zz. Assistoperation", class_name_alias= "auxiliary operation plug-in library", is_active=1, plugin_repo_detail= "details of the function plug-in library") marks class name public class Assist Operation, class public class AssistOperation { } is converted into a function plug-in database.
Step S2: and establishing at least one specified method in the specified function plugin library, and annotating the method name of the at least one specified method based on the function plugin method to obtain at least one specified function plugin corresponding to the at least one specified method.
It will be appreciated that the function plug-in method annotation includes a method name, a method alias, a class full path of the class in which the method is located, a detailed description of the function plug-in method, and a function plug-in method activation state (the function plug-in method activation state includes enabling or disabling), and that different programming languages may be used to implement the coding of the function plug-in method, and the function plug-in method annotation includes, for example, a java method name, a java method class name, a java class full path in which the java method is located, a detailed description of the function plug-in method, and a function plug-in method activation state.
It can be understood that the established common java method can be converted into a specific function plug-in by marking the established specific method name with the function plug-in method annotation, and the code for marking the established java method name with the function plug-in method annotation is as follows:
"functional PluginRepo (class_full_path=" com. Xxx. Yyy. Zz. Assistoperation ", class_name_alias=" auxiliary operation plug-in library ", is_active=1, plugin_repo_detail=" further detailed description of the class ");
public class AssistOperation { @ FunctionPluginMethod (class_full_path= "com. Xxx. Yy. Zz. Assistoperation", method_name_alias= "determine if strings match and return boolean results", method_args_alias= "Source string, destination string, match pattern", is_active = 1, plugin_method_details= "matchPattern parameters indicate: 1-represents contain and case insensitive, 2-represents contain and case sensitive, 3-represents equal and case insensitive, 4-represents equal and case sensitive");
Public Map<Integer,Object>bln_StringMatch(String sourceStr,String destinationStr,String matchPattern){
}
}
in the code, first, the java class name Public class AssistOperation is marked to obtain a function plug-in library Public class AssistOperation { }, and in the function plug-in library Public class AssistOperation { }, the java method name Public Map < inter, object > bln _StringMatch is marked to obtain a function plug-in Public Map < inter, object > bln _StringMatch { }.
Step S3: and constructing a function plug-in code template structure based on the type of the return value of the at least one specified function plug-in, and developing a specific function plug-in based on the function plug-in code template structure, wherein the specific function plug-in comprises method parameter information of the specific function plug-in, and the specific function plug-in is part or all of the at least one specified function plug-in.
It will be appreciated that a function plug-in code template is a standard framework for writing code of a function plug-in, and a function plug-in with actual functions can be obtained by instantiating the function plug-in based on the standard framework, that is, the function plug-in can be developed into a function plug-in with specific functions, for example, the function plug-in code template is as follows:
in the above example, the return type of the method to be marked by the < function plug-in method annotation > is defined as Map < inter, object >, the custom function plug-in name, the custom function plug-in method parameter (there may be no parameter, one parameter or multiple parameters), the business code in the custom function plug-in method body, the function plug-in includes a try { } code block and a catch (Execeptione) { } code block, and the custom function plug-in method body business code is put into the try { } code block.
It will be appreciated that the type of return value for the function plug-in method can be customized. As an example, as one implementation, the following function plug-in method return value types are defined: { busneiss_type=0 } means that the program code is executed normally, and the return value is the service value calculated by the function plug-in method. { null_type=1 } means that the program code is normally executed and no traffic value is returned, and the return value is NULL at this time. { exception_type=2 } indicates that the program code is executed abnormally, and the return value is abnormal stack information.
Continuing with the above example of the function plug-in code template, when the function plug-in method try { } has no service return value, the function plug-in method try { } returns an instantiated HashMap object, and if 1 pair of KV key value pairs exist in the HashMap object, the K value is null_type, and the V value is NULL. When the designated function plugin try { } has a service return value, an instantiated HashMap object is returned, the function plugin method try { } returns an instantiated HashMap object, the K value is BUSINES_TYPE, and the V value is the actual return value of the function plugin method try { }. When the designated function plugin try { } executes EXCEPTION, an instantiated HashMap object is returned in the catch (Execeptione) { } code block, the K value is extraction_type, and the V value is stack detail information of the captured program execution EXCEPTION.
It will be appreciated that after the specified function plug-ins in the specified function plug-in library are developed according to the templates of the function plug-in code, the specified function plug-ins in the specified function plug-in library will each have an actual, specific function, that is, each specified function plug-in the specified function plug-in library becomes a specific function plug-in after being developed according to the templates of the function plug-in code. The specific function plug-ins are part or all of the specified function plug-ins. When the function plugin is called, the business party can call the specific function plugin according to the requirement.
Step S4: analyzing the specified function plugin library to obtain function plugin class information, and analyzing at least one specified function plugin based on the function plugin class information to obtain function plugin method information.
Optionally, before step S1, a function plug-in method table, a function plug-in library table, and a function plug-in tree hierarchy table may be established through a two-dimensional table structure, and a membership association relationship between a function plug-in and a function plug-in library is established. The function plug-in method table is used for storing function plug-in method information, and the function plug-in library table is used for storing function plug-in class information. Each function plugin library may include one or more function plugins, but a function plugin is only affiliated with one function plugin library, and the membership of the function plugin library to the function plugin may be determined based on the membership association of the function plugin to the function plugin library. And the function plugins are corresponding to the levels in the function plugin parameter level table, so that the function plugins can be conveniently positioned according to the levels.
The function plug-in class information obtained in step S4 is stored in the function plug-in library table, and the function plug-in method information obtained in step S4 and the parameter information storing the function plug-in method are stored in the function plug-in method table.
Step S5: and calling a target plugin based on the first plugin to execute the target plugin according to the function plugin method information of the target plugin, so as to obtain a target plugin execution result, wherein the target plugin is any one of the function plugins.
It can be understood that, in step S5, the first plugin is used as a unified interface for calling the plugin by the service party, and the calling of the service party to the target plugin can be realized based on the first plugin. As an embodiment, the first plug-in may be based on HTTP protocol, i.e. an API interface HTTP REST API following REST style, functionally an interface for function query information query, for example, the content of the HTTP REST API interface is as follows:
the interface 1 in HTTP REST API is used for acquiring all the information of the plug-in library and the interface path (for example,/functionlugin/pluginClasses), the request method of the interface 1 is GET, and the request parameter of the interface 1 is no parameter. The interface 2 in the HTTP REST API interface is used for acquiring all the information of the specified function plug-in methods and interface paths (for example,/functonplugin/plugin methods), the request method of the interface 2 is GET, and the request parameter condition of the interface 2 is no parameter. The interface 3 in the HTTP REST API interface obtains all the specified function plugin method information and interface paths (for example,/functon/plugin methods/{ classFullPath }) under the class according to the full path of the class, the request method of the interface 3 is GET, the parameter of the interface 3 is a path variable parameter (for example: classFullPath), and the interface 3 is used for obtaining the target plugin information, so that the target plugin can be positioned in the specified function plugin library and called for execution by the parameter value to the first plugin.
Referring to fig. 2, fig. 2 is a flowchart illustrating a step of calling an objective function according to an embodiment of the present application. Optionally, step S5 comprises the sub-steps of:
step S51: an execution engine of the function plugin is established, and the execution engine comprises a first plugin.
Step S52: and calling the first plugin to acquire the function plugin method information of the target plugin.
Step S53: and executing the target plugin according to the function plugin method information of the target plugin by the execution engine to obtain an execution result of the target plugin.
Step S54: and returning the execution result of the target plug-in the form of key value pairs.
In step S51, step S52, step S53 and step S54, it may be understood that the function plug-in engine may be developed in different program languages, and taking java language as an example, the execution engine includes an execution method of an Action class, where the execution method receives a parameter list of a full path of a class of a target plug-in, a method name of a class of a target plug-in and a method name of a class of a target plug-in required by a service party as parameters, and after executing the first plug-in, the execution engine parses the target plug-in located in a specified function plug-in library by the first plug-in real time, loads and executes a code of the target plug-in to obtain an execution result of the target plug-in. As one embodiment, the code for the execution engine to execute the target plugin and return the execution result of the target plugin is as follows:
referring to fig. 3, fig. 3 is a flowchart of a step of executing a result on a return target plug-in with a key value according to an embodiment of the present application. Optionally, step S53 includes the sub-steps of:
step S541: and when the target plug-in is normally executed and has a return value, the return value type is a first preset return value.
Step S542: and when the target plug-in is normally executed and has no return value, the return value type is a second preset return value.
Step S543: and when the target plug-in is executed abnormally and returns stack information, the return value type is a third preset return value.
It may be understood that in step S541, step S542 and step S543, the return value types of the target plug-in are divided, and the return value types may be customized, and as an embodiment, the return value types are defined as follows: { busneiss_type=0 } means that the program code is executed normally, and the return value is the service value calculated by the function plug-in method. { null_type=1 } means that the program code is normally executed and no traffic value is returned, and the return value is NULL at this time. { exception_type=2 } indicates that the program code is executed abnormally, and the return value is abnormal stack information. The specific return value may be checked by the code in step S3, which is not described here again.
Referring to fig. 4, fig. 4 is a flowchart of a step of calling an objective function in java language according to an embodiment of the present application. Optionally, step S5 comprises the sub-steps of:
step S55: and calling the first plugin to obtain function plugin method information of the target plugin, wherein the function plugin method information comprises a function plugin class full path of the target plugin, a function plugin method name of the target plugin and a function plugin parameter value list of the target plugin.
Step S56: and analyzing and executing the target plugin by an Action class execution method in the execution engine based on the function plugin method information to obtain a target plugin execution result.
It can be understood that when the service party invokes the target plugin, the execution engine receives, as parameters, a full path of a class of the target plugin, a method name of the class of the target plugin, and a parameter list of the method name of the class of the target plugin, where the parameter list is replaced by a corresponding parameter value list, and because the target plugin that can be located in the specified function plugin library after the first plugin is executed, the execution engine parses, in real time, the target plugin that is located in the specified function plugin library by the first plugin, loads and executes a code of the target plugin to obtain an execution result of the target plugin.
Referring to fig. 5, fig. 5 is a schematic diagram of a function plug-in execution device according to an embodiment of the present application. The function plug-in execution device 60 includes:
the class creation module 601 is configured to create a class, and annotate a class name of the tag class based on the function plug-in library to obtain a specified function plug-in library corresponding to the class.
The marking module 602 is configured to establish at least one specified method in the specified function plugin library, and mark a method name of the at least one specified method based on the function plugin method annotation to obtain at least one specified function plugin corresponding to the at least one specified method.
The type creation module 603 is configured to construct a function plug-in code template structure based on the type of the return value of the at least one specified function plug-in, and develop a specific function plug-in based on the function plug-in code template structure, where the specific function plug-in includes method parameter information of the specific function plug-in, and the specific function plug-in is part or all of the at least one specified function plug-in.
And the plug-in providing module 604 is configured to parse the specified function plug-in library to obtain function plug-in class information, and parse at least one specified function plug-in based on the function plug-in class information to obtain function plug-in method information.
And the execution module 605 is configured to call the target plugin based on the first plugin, so as to execute the target plugin according to the function plugin method information of the target plugin, and obtain an execution result of the target plugin, where the target plugin is any one of the function plugins.
Optionally, the execution module 605 is configured to:
establishing an execution engine of a function plugin, wherein the execution engine comprises a first plugin;
calling a first plug-in to acquire function plug-in method information of a target plug-in;
executing the target plugin according to the function plugin method information of the target plugin by the execution engine to obtain a target plugin execution result;
and returning the execution result of the target plug-in the form of key value pairs.
Optionally, the execution module 605 is configured to:
calling a first plugin to obtain function plugin method information of the target plugin, wherein the function plugin method information comprises a function plugin class full path of the target plugin, a function plugin method name of the target plugin and a function plugin parameter value list of the target plugin;
and analyzing and executing the target plugin by an Action class execution method in the execution engine based on the function plugin method information to obtain a target plugin execution result.
Optionally, the execution module 605 is configured to:
when the target plug-in is normally executed and has a return value, the return value type is a first preset return value;
when the target plug-in is normally executed and has no return value, the return value type is a second preset return value;
and when the target plug-in is executed abnormally and returns stack information, the return value type is a third preset return value.
The embodiment also provides an electronic device, which comprises a memory and a processor, wherein the memory stores program instructions, and the processor executes steps in any method when running the program instructions.
The present embodiment also provides a storage medium having stored therein computer program instructions which, when executed by a processor, perform the steps of any of the methods described above.
In summary, embodiments of the present application provide a method, an apparatus, an electronic device, and a storage medium for executing a function plug-in, which relate to the technical field of data processing, where the method for executing a function plug-in includes: and establishing a class, and annotating the class name of the class based on the function plug-in library to obtain a specified function plug-in library corresponding to the class. And establishing at least one specified method in the specified function plugin library, and annotating the method name of the at least one specified method based on the function plugin method to obtain at least one specified function plugin corresponding to the at least one specified method. And constructing a function plug-in code template structure based on the type of the return value of the at least one specified function plug-in, and developing a specific function plug-in based on the function plug-in code template structure, wherein the specific function plug-in comprises the method parameter information of the specific function plug-in, and the specific function plug-in is part or all of the at least one specified function plug-in. Analyzing the specified function plugin library to obtain function plugin class information, and analyzing the at least one specified function plugin to obtain function plugin method information based on the function plugin class information to obtain function plugin method information. And calling a target plugin based on the first plugin to execute the target plugin according to the function plugin method information of the target plugin to obtain a target plugin execution result, wherein the target plugin is any one of the specific function plugins.
In the implementation process, the function plugin class information, the function plugin method information and the function plugin method parameter information are provided by the first plugin outwards, namely, the method parameter information of the target plugin is provided by the first plugin with unified standards to the outside when any required target plugin is called, so that the target plugin is called from the appointed function plugin library and executed, and calling and executing of the target plugin by different platform systems can be realized by adopting the unified first plugin, and the inheritability of calling and executing of the plugin is improved.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. The apparatus embodiments described above are merely illustrative, for example, block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices according to various embodiments of the present application. In this regard, each block in the block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams, and combinations of blocks in the block diagrams, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. The present embodiment therefore also provides a readable storage medium having stored therein computer program instructions which, when read and executed by a processor, perform the steps of any one of the methods of block data storage. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method of executing a function plug-in, the method comprising:
establishing a class, and annotating and marking the class name of the class based on a function plugin library to obtain a specified function plugin library corresponding to the class;
establishing at least one specified method in the specified function plugin library, and annotating and marking the method name of the at least one specified method based on the function plugin method to obtain at least one specified function plugin corresponding to the at least one specified method;
constructing a function plug-in code template structure based on the type of the return value of the at least one appointed function plug-in, and developing a specific function plug-in based on the function plug-in code template structure, wherein the specific function plug-in comprises method parameter information of the specific function plug-in, and the specific function plug-in is part or all of the at least one appointed function plug-in;
analyzing the appointed function plugin library to obtain function plugin class information, and analyzing the at least one appointed function plugin based on the function plugin class information to obtain function plugin method information;
and calling a target plugin based on the first plugin to execute the target plugin according to the function plugin method information of the target plugin to obtain a target plugin execution result, wherein the target plugin is any one of the specific function plugins.
2. The method according to claim 1, wherein the calling the target plugin based on the first plugin to execute the target plugin according to the function plugin method information of the target plugin, to obtain a target plugin execution result, includes:
establishing an execution engine of a function plugin, wherein the execution engine comprises the first plugin;
calling the first plugin to acquire function plugin method information of the target plugin;
executing the target plugin according to the function plugin method information of the target plugin by the execution engine to obtain an execution result of the target plugin;
and returning the execution result of the target plug-in the form of key value pairs.
3. The method of claim 2, wherein the execution engine further includes an Action class execution method, the calling a target plugin based on the first plugin to execute the target plugin according to function plugin method information of the target plugin, to obtain a target plugin execution result, including:
calling the first plugin to obtain the function plugin method information of the target plugin, wherein the function plugin method information comprises a function plugin class full path of the target plugin, a function plugin method name of the target plugin and a function plugin parameter value list of the target plugin;
and analyzing and executing the target plugin through the Action class execution method in the execution engine based on the function plugin method information to obtain an execution result of the target plugin.
4. The method of claim 2, wherein the returning the target plug-in execution result in the form of a key-value pair comprises:
when the target plug-in is normally executed and has a return value, the return value type is a first preset return value;
when the target plug-in is normally executed and has no return value, the return value type is a second preset return value;
and when the target plug-in is executed abnormally and returns stack information, the return value type is a third preset return value.
5. A function plug-in execution apparatus, the apparatus comprising:
the class creation module is used for creating classes and annotating and marking class names of the classes based on the function plug-in library to obtain specified function plug-in libraries corresponding to the classes;
the marking module is used for establishing at least one specified method in the specified function plugin library, and marking the method name of at least one specified method based on the function plugin method annotation so as to obtain at least one specified function plugin corresponding to the at least one specified method;
the type creation module is used for constructing a function plug-in code template structure based on the type of the return value of the at least one specified function plug-in, and developing a specific function plug-in based on the function plug-in code template structure, wherein the specific function plug-in comprises method parameter information of the specific function plug-in, and the specific function plug-in is part or all of the at least one specified function plug-in;
the plug-in providing module is used for analyzing the specified function plug-in library to obtain function plug-in class information, and analyzing the at least one specified function plug-in based on the function plug-in class information to obtain function plug-in method information;
and the execution module is used for calling a target plugin based on the first plugin so as to execute the target plugin according to the function plugin method information of the target plugin to obtain a target plugin execution result, wherein the target plugin is any one of the specific function plugins.
6. The apparatus of claim 5, wherein the execution module is to:
establishing an execution engine of a function plugin, wherein the execution engine comprises the first plugin;
calling the execution engine, and executing the target plugin according to the function plugin method information of the target plugin to obtain an execution result of the target plugin;
and returning the execution result of the target plug-in the form of key value pairs.
7. The apparatus of claim 6, the execution engine further comprising an Action class execution method, wherein the execution module is to:
calling the first plugin to obtain the function plugin method information of the target plugin, wherein the function plugin method information comprises a function plugin class full path of the target plugin, a function plugin method name of the target plugin and a function plugin parameter value list of the target plugin;
and analyzing and executing the target plugin through the Action class execution method in the execution engine based on the function plugin method information to obtain an execution result of the target plugin.
8. The apparatus of claim 6, wherein the execution module is to:
when the target plug-in is normally executed and has a return value, the return value type is a first preset return value;
when the target plug-in is normally executed and has no return value, the return value type is a second preset return value;
and when the target plug-in is executed abnormally and returns stack information, the return value type is a third preset return value.
9. An electronic device comprising a memory and a processor, the memory having stored therein program instructions which, when executed by the processor, perform the steps of the method of any of claims 1-4.
10. A storage medium having stored therein computer program instructions which, when executed by a processor, perform the steps of the method of any of claims 1-4.
CN202011556225.7A 2020-12-24 2020-12-24 Function plug-in execution method, device, electronic equipment and storage medium Active CN112559083B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011556225.7A CN112559083B (en) 2020-12-24 2020-12-24 Function plug-in execution method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011556225.7A CN112559083B (en) 2020-12-24 2020-12-24 Function plug-in execution method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112559083A CN112559083A (en) 2021-03-26
CN112559083B true CN112559083B (en) 2023-08-04

Family

ID=75033937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011556225.7A Active CN112559083B (en) 2020-12-24 2020-12-24 Function plug-in execution method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112559083B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114416206A (en) * 2022-01-20 2022-04-29 四维创智(北京)科技发展有限公司 Plug-in hot loading method, system, terminal equipment and storage medium
CN114942796A (en) * 2022-05-05 2022-08-26 北京达佳互联信息技术有限公司 Plug-in compiling and calling method, device, equipment and storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464805A (en) * 2008-12-24 2009-06-24 中兴通讯股份有限公司 Plug-in management method and system thereof
CN105224874A (en) * 2014-06-24 2016-01-06 深圳市茁壮网络股份有限公司 Based on plug-in security control method and the client of middleware card cage
CN105472462A (en) * 2015-11-12 2016-04-06 Tcl王牌电器(惠州)有限公司 Television function processing method and system
CN108279944A (en) * 2017-01-05 2018-07-13 长沙湘佩网络技术有限公司 Mobile purchase system based on plug-in type
CN109977670A (en) * 2019-03-12 2019-07-05 福建天晴数码有限公司 Android application safety monitoring method, storage medium based on plug-in unit load
CN110222510A (en) * 2019-06-13 2019-09-10 江苏亨通工控安全研究院有限公司 A kind of leak detection method, device and computer system
CN110347442A (en) * 2019-06-28 2019-10-18 烽火通信科技股份有限公司 A kind of chip card operation method and system based on convergent terminal
CN110609678A (en) * 2019-08-26 2019-12-24 珠海格力电器股份有限公司 Function programming method and device and configuration software system
CN110704035A (en) * 2019-10-17 2020-01-17 北京首贝科技发展有限公司 Plug-in type software architecture system and implementation method thereof
CN110768860A (en) * 2019-09-18 2020-02-07 平安科技(深圳)有限公司 Test method, test device and electronic equipment
CN111090423A (en) * 2019-11-26 2020-05-01 苏州思必驰信息科技有限公司 Webhook framework system and method for realizing active calling and event triggering
CN111597484A (en) * 2020-07-22 2020-08-28 成都新希望金融信息有限公司 UI dynamic generation method
CN111680103A (en) * 2020-05-29 2020-09-18 成都新希望金融信息有限公司 Method and device for generating ordered unique value by distributed database self-increment field
CN112099962A (en) * 2020-11-06 2020-12-18 成都新希望金融信息有限公司 Distributed lock implementation method and device and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020023759A1 (en) * 2018-07-26 2020-01-30 Insight Sciences Corporation Secure electronic messaging system

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464805A (en) * 2008-12-24 2009-06-24 中兴通讯股份有限公司 Plug-in management method and system thereof
CN105224874A (en) * 2014-06-24 2016-01-06 深圳市茁壮网络股份有限公司 Based on plug-in security control method and the client of middleware card cage
CN105472462A (en) * 2015-11-12 2016-04-06 Tcl王牌电器(惠州)有限公司 Television function processing method and system
CN108279944A (en) * 2017-01-05 2018-07-13 长沙湘佩网络技术有限公司 Mobile purchase system based on plug-in type
CN109977670A (en) * 2019-03-12 2019-07-05 福建天晴数码有限公司 Android application safety monitoring method, storage medium based on plug-in unit load
CN110222510A (en) * 2019-06-13 2019-09-10 江苏亨通工控安全研究院有限公司 A kind of leak detection method, device and computer system
CN110347442A (en) * 2019-06-28 2019-10-18 烽火通信科技股份有限公司 A kind of chip card operation method and system based on convergent terminal
CN110609678A (en) * 2019-08-26 2019-12-24 珠海格力电器股份有限公司 Function programming method and device and configuration software system
CN110768860A (en) * 2019-09-18 2020-02-07 平安科技(深圳)有限公司 Test method, test device and electronic equipment
CN110704035A (en) * 2019-10-17 2020-01-17 北京首贝科技发展有限公司 Plug-in type software architecture system and implementation method thereof
CN111090423A (en) * 2019-11-26 2020-05-01 苏州思必驰信息科技有限公司 Webhook framework system and method for realizing active calling and event triggering
CN111680103A (en) * 2020-05-29 2020-09-18 成都新希望金融信息有限公司 Method and device for generating ordered unique value by distributed database self-increment field
CN111597484A (en) * 2020-07-22 2020-08-28 成都新希望金融信息有限公司 UI dynamic generation method
CN112099962A (en) * 2020-11-06 2020-12-18 成都新希望金融信息有限公司 Distributed lock implementation method and device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于量子密码的卫星网络地球站异常检测系统设计;梁一帆;;计算机测量与控制(第04期);第16-20页 *

Also Published As

Publication number Publication date
CN112559083A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
CN107341401B (en) A kind of malicious application monitoring method and equipment based on machine learning
CN110032599B (en) Data structure reading and updating method and device, and electronic equipment
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
CN112559083B (en) Function plug-in execution method, device, electronic equipment and storage medium
US8949790B2 (en) Debugging visual and embedded programs
US11403536B2 (en) System and method for anti-pattern detection for computing applications
CN108256870B (en) Method and device for generating description information, updating and processing data based on topological structure
CN110032568B (en) Data structure reading and updating method and device, and electronic equipment
CN112181804A (en) Parameter checking method, equipment and storage medium
CN115080406A (en) Code log generation method, device, equipment and storage medium
CN110007906B (en) Script file processing method and device and server
CN111368289A (en) Malicious software detection method and device
CN114969819A (en) Data asset risk discovery method and device
WO2021120628A1 (en) Blockchain-based sensitive word detection method and apparatus, computer device and computer-readable storage medium
CN113961768B (en) Sensitive word detection method and device, computer equipment and storage medium
CN111723182B (en) Key information extraction method and device for vulnerability text
CN116541887B (en) Data security protection method for big data platform
CN111177506A (en) Classification storage method and system based on big data
CN113626823B (en) Method and device for detecting interaction threat among components based on reachability analysis
CN112800194B (en) Interface change identification method, device, equipment and storage medium
US10678916B2 (en) Malicious program detection
CN111752570A (en) Compiling method, device, terminal and computer readable storage medium
CN117077148B (en) Program security analysis method, system, computer device and storage medium
CN113821570B (en) Data processing method based on block chain and SQL
CN112783755B (en) Method for finding memory damage loopholes based on natural language understanding function prototype

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant