Dynamic function compiling method, computing equipment and machine readable storage medium

Through the dynamic function compilation method, the target plug-in and unplugged class and its attributes are determined based on the received dynamic function code, and their association relationship with the pluggable node is configured, which solves the problem of frequent changes in customized requirements and realizes the application's rapid response to changes in customer needs.

CN119690452APending Publication Date: 2025-03-25ZHONGKE YUNGU TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411880751.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In application development, customization needs change and new additions are frequent, and it is difficult for existing technology to achieve flexible compilation of customization needs, resulting in applications being unable to respond quickly to changes in customer needs.

Method used

Through the dynamic function compilation method, the target plug-in and unplugged class and its attributes are determined based on the received dynamic function code, the association relationship between the target plug-in and unplugged class and the plug-in and unplugged node is configured, and stored in the node configuration information to achieve flexible compilation of customized requirements.

Benefits of technology

The combination of customized requirements at the program level with actual applications is achieved. The target plug-in and unplugging classes are independent of each other, which is conducive to the rapid development and testing of new requirements and improves the ability to respond quickly to user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690452A_ABST
    Figure CN119690452A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic function compiling method, computing equipment and a machine readable storage medium, and relates to the technical field of computers. The method comprises the steps of determining a target plugging class and a target plugging class attribute based on a received dynamic function code, persisting the target plugging class attribute to target plugging class configuration information, determining a target pluggable node in all pluggable nodes in a target program based on a business demand, acquiring node information of the target pluggable node based on the code position of the target pluggable node, and configuring an association relationship between the target pluggable class and the target pluggable node based on the business demand, the node information and the target pluggable class configuration information; and storing the association relationship to node configuration information corresponding to the target pluggable node so as to execute a method corresponding to the target plugging class based on the node configuration information when the target program runs to the target pluggable node. Demand customization on the program level is achieved, and the quick response ability to the user demand is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a dynamic function compilation method, a computing device, and a machine-readable storage medium. Background Art

[0002] When developing an application, there may be different customization requirements based on different tenants, factories, workshops, production lines, and even finer-dimensional workstations. These customized requirements often require a large amount of hard coding to be embedded in the original main process code, and it is difficult to accurately grasp the boundaries of the changes when modifying the main process code. Therefore, in many cases, the entire process needs to be sorted out and tested in detail, which brings a lot of workload and product control risks to the relevant developers and testers. In addition, changes and additions to customized requirements are relatively frequent. If the flexible compilation of the customized requirements cannot be achieved, it is not convenient for the application to respond quickly to changes in customer requirements. Therefore, how to achieve flexible coding of customized requirements has become a problem that needs to be solved urgently. Summary of the invention

[0003] In view of the above-mentioned deficiencies in the prior art, the purpose of the embodiments of the present application is to provide a dynamic function compilation method, a computing device and a machine-readable storage medium.

[0004] In order to achieve the above-mentioned object, the first aspect of the present application provides a dynamic function compilation method, comprising:

[0005] Determine a target pluggable class and target pluggable class attributes based on the received dynamic function code, wherein the target pluggable class attributes include a class path, a function name, and a function code;

[0006] Persist the target pluggable class attributes into the target pluggable class configuration information;

[0007] Determine a target pluggable node among all pluggable nodes in the target program based on business requirements;

[0008] Obtain node information of the target pluggable node based on the code location of the target pluggable node;

[0009] Configure the association between the target pluggable class and the target pluggable node based on business requirements, node information, and target pluggable class configuration information;

[0010] The association relationship is stored in the node configuration information corresponding to the target pluggable node, so that when the target program runs to the target pluggable node, the method corresponding to the target pluggable class is executed based on the node configuration information.

[0011] In an embodiment of the present application, configuring an association relationship between a target pluggable class and a target pluggable node based on business requirements, node information, and target pluggable class configuration information includes:

[0012] Determine a first target pluggable class based on the business requirement, wherein the first target pluggable class is a target pluggable class corresponding to the target pluggable node among all target pluggable classes;

[0013] Determining a first execution order among the first target plug-in and plug-out classes;

[0014] An association relationship between the first target pluggable class and the target pluggable node is configured based on the first execution order, the node information, and the target pluggable class configuration information.

[0015] In an embodiment of the present application, the association relationship includes a coding binding relationship, a second execution order, an execution mode, and a result association relationship, wherein the second execution order refers to the execution order of the target pluggable class and the target pluggable node, the execution mode includes asynchronous execution and synchronous execution, and the result association relationship refers to the dependency relationship between the execution result of the target pluggable class and the execution result of the target pluggable node.

[0016] In the embodiment of the present application, the dynamic function compilation method further includes:

[0017] Determine the rule engine expression corresponding to the target pluggable class based on the dynamic function code;

[0018] Associate the rule engine expression with the rule engine of the target pluggable class;

[0019] Execute the method corresponding to the target plug-in class based on the node configuration information, including:

[0020] A rule engine that executes target plug-in and pull-out classes based on node configuration information;

[0021] When the rule engine is hit, the method corresponding to the target plug-in class is executed.

[0022] In the embodiment of the present application, the dynamic function compilation method further includes:

[0023] In the case of receiving a service change requirement, determining a second target pluggable class among all target pluggable classes based on the service change requirement;

[0024] Determine whether there is node change information based on business change requirements;

[0025] In the case of node change information, the rule engine expression corresponding to the second target pluggable class is modified based on the business change requirements, or the first association relationship is deleted in the node configuration information, wherein the first association relationship is the association relationship between the second target pluggable class and the target pluggable node.

[0026] In the embodiment of the present application, the dynamic function compilation method further includes:

[0027] In a case where a target pluggable class offline instruction is received, determining a third target pluggable class among all target pluggable classes based on the target pluggable class offline instruction;

[0028] Deleting a second association relationship in the node configuration information, wherein the second association relationship is an association relationship between the third target pluggable class and the target pluggable node;

[0029] The target pluggable class attribute of the third target pluggable class is deleted from the target pluggable class configuration information.

[0030] In the embodiment of the present application, after the step of executing the method corresponding to the target plug-in class based on the node configuration information, the method further includes:

[0031] Generate and store execution records of methods corresponding to target plug-in and pull-out classes.

[0032] In the embodiment of the present application, before the step of determining the target pluggable class and the target pluggable class attribute based on the received dynamic function code, the method further includes:

[0033] Create requests based on input dynamic functions and write interfaces for output functions;

[0034] A machine-readable file of a preset file type is generated based on the dynamic function code received by the function writing interface and the specified code location.

[0035] In the embodiment of the present application, the dynamic function compilation method further includes:

[0036] Get all non-privatized methods in the target program;

[0037] Based on the node creation requirement, a target non-privatized method among all non-privatized methods is determined as a pluggable node.

[0038] A second aspect of the present application provides a computing device, including:

[0039] a memory configured to store instructions;

[0040] The processor is configured to call instructions from a memory and implement the dynamic function compilation method as described in the above embodiment when executing the instructions.

[0041] A third aspect of the present application provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the dynamic function compilation method as described in the above embodiment.

[0042] Through the above technical solution, the target pluggable class and the target pluggable class attributes are determined based on the received dynamic function code, and the target pluggable class attributes are persisted in the target pluggable class configuration information; through the definition of the target pluggable class by the dynamic function code, the conversion of customized business requirements at the program level is realized. By determining the target pluggable node among all the pluggable nodes in the target program based on business requirements, the node information of the target pluggable node is obtained based on the code position of the target pluggable node, so as to configure the association relationship between the target pluggable class and the target pluggable node based on business requirements, node information and target pluggable class configuration information; and the association relationship is stored in the node configuration information corresponding to the target pluggable node, so that when the target program runs to the target pluggable node, the method corresponding to the target pluggable class is executed based on the node configuration information. The combination of customized requirements at the program level and actual application programs is realized, and the target pluggable classes are independent of each other, which is conducive to the rapid development and testing of new requirements and improves the ability to respond quickly to user needs.

[0043] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:

[0045] Figure 1 A schematic diagram of a flow chart of a dynamic function compilation method according to an embodiment of the present application is shown;

[0046] Figure 2 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown schematically. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0048] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0049] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0050] Figure 1 The following schematically shows a flow chart of a dynamic function compilation method according to an embodiment of the present application. Figure 1 As shown, the embodiment of the present application provides a dynamic function compilation method, which may include the following steps:

[0051] Step 100, determining a target pluggable class and target pluggable class attributes based on the received dynamic function code, wherein the target pluggable class attributes include a class path, a function name, and a function code;

[0052] In this embodiment, it should be noted that the class is used to define the blueprint of the object, including properties and methods, wherein the properties are used to store the state of the object; the method is used to define the behavior of the object. The program can use the properties and methods of the class by creating an instance (object) of the class. The target plug-in class refers to a class determined based on the dynamic function code, and the properties and methods of the target plug-in class are determined based on the dynamic function code. The target plug-in class attributes include the class path, function name, and function coding, wherein the class path is the path for the compiler and virtual machine to find the class file of the target plug-in class, and the class path can be a directory or a JAR file containing the class file; the function name is the method name in the target plug-in class, and the method is an operation or behavior defined in the class for performing a specific task; the function code refers to the unique identifier of the method, including the method name, parameter type, and return type.

[0053] It should be noted that the dynamic function code is input code information. Specifically, in one embodiment, before the step of determining the target pluggable class and the target pluggable class attribute based on the received dynamic function code, the step further includes:

[0054] Create requests based on input dynamic functions and write interfaces for output functions;

[0055] A machine-readable file of a preset file type is generated based on the dynamic function code received by the function writing interface and the specified code location.

[0056] It should be noted that the dynamic function creation request is used to apply for input of dynamic function code. Customization of the target plug-in class can be achieved by inputting the dynamic function code. In order to improve the adaptability to customized business needs, in this embodiment, a function writing interface is set to receive the dynamic function code containing customized business needs based on the function writing interface, and the target plug-in class is generated based on the dynamic function code, so as to respond to customized business needs based on the execution of the method in the target plug-in class. When the input dynamic function creation request is received, the function writing interface is output to receive the dynamic function code and the specified code position through the function writing interface, and the dynamic function code is compiled by the compiler based on the specified code position to obtain a machine-readable file of a preset file type. It should be noted that the preset file type refers to a machine-readable file type, which can be adaptively adjusted based on the actual application scenario. The type of dynamic function code can also be determined based on the actual application scenario. For example, according to the dynamic function code of the string type and the specified code position, a class file is compiled and generated by the jdk compiler.

[0057] Step 200, persisting the target pluggable class attributes into the target pluggable class configuration information;

[0058] It should be noted that persistence refers to time, that is, data is saved in a storage device that can be permanently saved, such as a disk. This mechanism ensures that data remains unchanged in the event of hardware failure, system crash or power outage, thereby avoiding data loss. The target plug class configuration information includes information for configuring and initializing various parameters and attributes of all target plug classes. The target plug class configuration information is used to define the behavior, dependencies and other important characteristics of the class. In this embodiment, the target plug class attributes are persisted in the target plug class configuration information to improve data reliability.

[0059] Step 300, determining a target pluggable node among all pluggable nodes in a target program based on business requirements;

[0060] Specifically, in the embodiment of the present application, the dynamic function compilation method further includes:

[0061] Get all non-privatized methods in the target program;

[0062] Based on the node creation requirement, a target non-privatized method among all non-privatized methods is determined as a pluggable node.

[0063] It should be noted that the target program refers to a program that is expected to be customized and adjusted. The target program includes multiple methods, which can be divided into non-privatized methods called based on non-privatized methods and privatized methods called based on privatized methods according to their visibility and calling methods. Among them, the privatized method is invisible outside the class and in the subclass, and can only be called inside the class. Non-privatized methods usually refer to public methods (PublicMethods) or protected methods (Protected Methods), which can be accessed and called outside the class or in the subclass. The node creation requirement includes specific requirements for specifying which methods in the target program are used as pluggable nodes. In this embodiment, the non-privatized methods in the target program that can be used to associate the target plug-in class are used as pluggable nodes. Specifically, according to the node creation requirements, it is determined which non-privatized methods planned to be used as pluggable nodes among all non-privatized methods are the target non-privatized methods, and the target non-privatized methods are used as pluggable nodes. When the target plug-in class needs to be associated later, the plug-in node that meets the actual application scenario can be screened from the plug-in nodes as the target plug-in node. It is understandable that, in one embodiment, a node deletion requirement may also be included, and the node deletion requirement includes a specific requirement for specifying which plug-in nodes in the target program are to be deleted. After the plug-in node is deleted, the target non-privatization method can no longer be used to associate with the target plug-in class. The node creation requirement and the node deletion requirement can be determined based on the actual application scenario.

[0064] It should be noted that business requirements refer to specific requirements or expectations put forward in order to meet the needs of the current actual application scenarios. In this embodiment, requirements such as specifying a target program and specifying a target pluggable node in a pluggable node may be included. Business requirements may be requirement information including one or more specific requirements; or they may include multiple sub-business requirements, each sub-business requirement corresponding to a specific requirement. Business requirements and / or sub-business requirements may be adaptively adjusted based on the application scenario. The target program may include multiple pluggable nodes, and one or more of the pluggable nodes may be associated with a target pluggable class to achieve customized requirements in some business scenarios. In actual applications, it is not necessary to associate the target pluggable class with each pluggable node, only the target pluggable nodes with requirements are associated. Specifically, based on the actual business needs, the pluggable nodes that meet the business needs are screened out from all non-privatized methods of the target program as the target pluggable nodes.

[0065] Step 400, acquiring node information of the target pluggable node based on the code position of the target pluggable node;

[0066] It should be noted that the code position of the target pluggable node is the position of the target pluggable node in the target program. Based on the code position, the node information of the target pluggable node is obtained by reflection, and the node information may include node name, node code, node position, method name, parameter type and other information.

[0067] Step 500, configuring an association relationship between a target pluggable class and a target pluggable node based on business requirements, node information, and target pluggable class configuration information;

[0068] It should be noted that the node information includes the node name, node code, node location, method name, parameter type and other information of the target pluggable node; the target pluggable class configuration information includes the target pluggable class attributes of all target pluggable classes, and the target pluggable class attributes include class path, function name and function code. Both the target pluggable node and the target pluggable class may include one or more. In this embodiment, based on actual business needs, the association relationship between the one or more target pluggable nodes and the target pluggable class is determined, and the association between the target pluggable node and the target pluggable class is realized.

[0069] Step 600: Store the association relationship in the node configuration information corresponding to the target pluggable node, so that when the target program runs to the target pluggable node, the method corresponding to the target pluggable class is executed based on the node configuration information.

[0070] It should be noted that the node configuration information includes settings related to the target pluggable node, such as method name, parameter list, return type, method body, execution environment, dependency, etc. The association between the target pluggable node and the target pluggable class is stored in the node configuration information corresponding to the target pluggable node. When the target program runs to the target pluggable node, the method corresponding to the target pluggable class can be executed based on the association in the node configuration information. The node configuration information of each pluggable node is maintained in the node configuration table in the cache.

[0071] Specifically, the code position of the target pluggable node in the target program is the node position. The association relationship between the target pluggable class and the target pluggable node includes the corresponding relationship between the node position and the target pluggable class. When the target program runs to the target pluggable node, it will jump to the rotor program in the pluggable class. The rotor program in the pluggable class is used to read the node configuration table in the cache at runtime, and will jump to the code position of the jump point of the rotor program in the pluggable class (that is, the node position of the target pluggable node) to find the corresponding node configuration information, and further find the target pluggable class corresponding to the node position in the node configuration information, so as to jump to the corresponding target pluggable class to execute the method corresponding to the target pluggable class. By storing the corresponding relationship between the node position and the target pluggable class in the node configuration information, it is avoided to directly embed the address of the target pluggable class in the program, improve the flexibility of the program and the adaptability to changes in demand, and reduce the cost of code maintenance.

[0072] Furthermore, in one embodiment, after the step of executing the method corresponding to the target plug-in class based on the node configuration information, the method further includes:

[0073] Generate and store execution records of methods corresponding to target plug-in and pull-out classes.

[0074] It should be noted that after the method corresponding to the target plug-in class is called and executed, by generating and storing the execution record of the method corresponding to the target plug-in class, data reference can be provided for subsequent monitoring or tracing of the target plug-in class, making it convenient for operation and maintenance personnel to quickly respond to production problems.

[0075] In this embodiment, the target pluggable class and the target pluggable class attributes are determined based on the received dynamic function code, and the target pluggable class attributes are persisted in the target pluggable class configuration information; the target pluggable class is defined by the dynamic function code to realize the conversion of customized business requirements at the program level. By determining the target pluggable node among all the pluggable nodes in the target program based on the business requirements, the node information of the target pluggable node is obtained based on the code position of the target pluggable node, so as to configure the association relationship between the target pluggable class and the target pluggable node based on the business requirements, node information and target pluggable class configuration information; and the association relationship is stored in the node configuration information corresponding to the target pluggable node, so that when the target program runs to the target pluggable node, the method corresponding to the target pluggable class is executed based on the node configuration information. The combination of customized requirements at the program level and actual application programs is realized, and the target pluggable classes are independent of each other, which is conducive to the rapid development and testing of new requirements and improves the ability to respond quickly to user needs.

[0076] In one embodiment, configuring an association relationship between a target pluggable class and a target pluggable node based on business requirements, node information, and target pluggable class configuration information includes:

[0077] Determine a first target pluggable class based on the business requirement, wherein the first target pluggable class is a target pluggable class corresponding to the target pluggable node among all target pluggable classes;

[0078] Determining a first execution order among the first target plug-in and plug-out classes;

[0079] An association relationship between the first target pluggable class and the target pluggable node is configured based on the first execution order, the node information, and the target pluggable class configuration information.

[0080] In the present embodiment, it should be noted that the target pluggable class includes multiple target pluggable classes, and different target pluggable classes correspond to different dynamic function codes. A target pluggable class can be associated with one or more target pluggable nodes, and a target pluggable node can also be associated with one or more target pluggable classes. The business requirements include which target pluggable nodes need to be associated with the target pluggable class, that is, the business requirements define which methods in the target program need to be inserted into the method corresponding to the target pluggable class when executed. For each target pluggable node, all target pluggable classes are screened based on business requirements to obtain the target pluggable class corresponding to the target pluggable node as the first target pluggable class. There can be one or more first target pluggable classes. In the case where the first target pluggable class includes multiple first target pluggable classes, the execution order of the multiple first target pluggable classes, that is, the first execution order, is determined based on the target pluggable class configuration information and / or business requirements. For each target pluggable node, after a first target pluggable class corresponding to the target pluggable node is screened out based on business requirements, an association relationship between the target pluggable node and the first target pluggable class is determined. When the first target pluggable class includes multiple first target pluggable classes, the first execution order is further combined to configure the execution order of each first target pluggable class when the target pluggable node is associated with the first target pluggable class.

[0081] In this embodiment, by configuring the execution order of the first target pluggable classes, the orderliness of the first target pluggable classes when the target program is executed to the target pluggable node is ensured, thereby improving the operating capability of the target program.

[0082] In one embodiment, the association relationship includes a coding binding relationship, a second execution order, an execution mode, and a result association relationship, wherein the second execution order refers to the execution order of the target pluggable class and the target pluggable node, the execution mode includes asynchronous execution and synchronous execution, and the result association relationship refers to the dependency relationship between the execution result of the target pluggable class and the execution result of the target pluggable node.

[0083] In the present embodiment, it should be noted that the association relationship between the target pluggable class and the target pluggable node includes a coding binding relationship, a second execution order, an execution mode, and a result association relationship. The function coding of the target pluggable class is obtained based on the target pluggable class configuration information, the node coding in the node information is obtained, and the function coding of the target pluggable class is bound and associated with the node coding to obtain a coding binding relationship. The target pluggable class and the target pluggable node both include methods to be executed, and the execution order of the methods included in the target pluggable class and the target pluggable node is the second execution order, which is determined based on business needs. Asynchronous execution means that the method will not block the current thread during execution, but allows other tasks to continue to execute. Synchronous execution means that the methods are executed one by one in order, that is, each method will not start to execute until the previous method is executed and returns a result. The execution mode is used to determine whether the method included in the target pluggable class and the target pluggable node is asynchronous execution and synchronous execution. The result association relationship refers to the dependency relationship between the execution result of the target pluggable class and the execution result of the target pluggable node, that is, whether the execution result of the target pluggable class needs to be combined with the execution result of the target pluggable node to be obtained, or whether the execution result of the target pluggable node needs the execution result of the target pluggable class to be obtained.

[0084] In this embodiment, the orderliness of the target program operation is improved by determining the association relationship between the target pluggable class and the target pluggable node.

[0085] In one embodiment, the dynamic function compilation method further includes:

[0086] Determine the rule engine expression corresponding to the target pluggable class based on the dynamic function code;

[0087] Associate the rule engine expression with the rule engine of the target pluggable class;

[0088] Execute the method corresponding to the target plug-in class based on the node configuration information, including:

[0089] A rule engine that executes target plug-in and pull-out classes based on node configuration information;

[0090] When the rule engine is hit, the method corresponding to the target plug-in class is executed.

[0091] It should be noted that the rule engine is a component embedded in an application program, which realizes the separation of business decisions from application program code and uses predefined semantic modules to write business decisions. The rule engine is used to accept data input, interpret business rules, and make business decisions based on business rules. The rule engine expression is a grammatical structure used in the rule engine to define conditions and perform operations, and describes the execution logic of business rules in a declarative manner. In this embodiment, the rule engine expression corresponding to the target plug-in class is determined based on the dynamic function code, and the rule engine expression is associated with the rule engine of the target plug-in class, that is, the execution logic of the target plug-in class can be controlled by the dynamic function code. When the condition satisfies the rule engine expression corresponding to the target plug-in class, the method corresponding to the target plug-in class can be executed. Specifically, when the target program runs to the target pluggable node, it is determined whether the current node configuration information satisfies the rule engine of the target pluggable class associated with the target pluggable node. In the case of hitting the rule engine, the method corresponding to the target plug-in class is executed. In the case of not hitting the rule engine, the method corresponding to the target plug-in class will not be executed.

[0092] In one embodiment, for example, in a certain application scenario, there is a business demand: a function needs to be developed urgently, and an order information is sent to a certain supplier after the process A is completed. Assume that process A is defined as target pluggable node A, target pluggable class I is determined based on the dynamic function code, and the function of target pluggable class I is to issue a work order. If the target pluggable node A wants to issue a work order, an expression that needs to satisfy the existence of an association relationship between the target pluggable node A and the target pluggable class I and the completion of the execution of the target pluggable node A can be written in the rule engine expression corresponding to the target pluggable class I. Then, when there is an association relationship between the target pluggable node A and the target pluggable class I, and the target pluggable node A is executed, the rule engine that hits the target pluggable class I is determined, and the method corresponding to the target pluggable class I is executed at this time to realize the function of sending an order information to a certain supplier.

[0093] In this embodiment, the customized control of the execution logic of the method corresponding to the target plug-in class is implemented through the dynamic function code, thereby improving the practicality of the target plug-in class and achieving a quick response to user needs.

[0094] In one embodiment, the dynamic function compilation method further includes:

[0095] In the case of receiving a service change requirement, determining a second target pluggable class among all target pluggable classes based on the service change requirement;

[0096] Determine whether there is node change information based on business change requirements;

[0097] In the case of node change information, the rule engine expression corresponding to the second target pluggable class is modified based on the business change requirements, or the first association relationship is deleted in the node configuration information, wherein the first association relationship is the association relationship between the second target pluggable class and the target pluggable node.

[0098] In this embodiment, it should be noted that the business change requirement includes information on whether the target pluggable node needs to be added, deleted, or modified. Based on the business change requirement, it can be determined which target pluggable classes need to be modified and whether the association relationship between the target pluggable class and the target pluggable node has changed. Based on the business change requirement, it is determined that the target pluggable class that needs to be changed this time among all the target pluggable classes is the second target pluggable class. It is also determined whether there is node change information in the business change requirement that requires the target pluggable node associated with the second target pluggable class to be changed. If there is node change information, the target pluggable node associated with the second target pluggable class is changed, otherwise the target pluggable node associated with the second target pluggable class is not changed.

[0099] Specifically, when there is node change information in the business change requirement, it is determined based on the change content in the business change requirement whether the change to the second target pluggable class is to replace the currently associated target pluggable node or to cancel the association relationship with the currently associated target pluggable node. When it is determined that the current change to the second target pluggable class is to replace the currently associated target pluggable node, the rule engine expression corresponding to the second target pluggable class is modified to release the trigger association of the currently associated target pluggable node to the second target pluggable class, so that when the target program runs to the target pluggable node, the method corresponding to the second target pluggable class is no longer executed; and further, based on the change content in the business change requirement, a new target pluggable node to be associated with the second target pluggable class is determined, and the second target pluggable class is associated with the new target pluggable node, so that when the target program runs to the new target pluggable node, the method corresponding to the second target pluggable class is executed. When it is determined that the current change to the second target pluggable class is to cancel the association relationship with the currently associated target pluggable node, the association relationship between the second target pluggable class and the currently associated target pluggable node is directly deleted in the node configuration information, so that the second target pluggable class is no longer associated with the target pluggable node, so that the method corresponding to the second target pluggable class is no longer executed when the target program runs to the target pluggable node.

[0100] In one embodiment, for example, in a certain application scenario, there is a business requirement: changing the order information sent to a supplier after the process A ends to sending the order information to a supplier after the process B ends. Assuming that process A is defined as the target pluggable node A and process B is defined as the target pluggable node B, for the change in the demand for the target pluggable class I, an expression that needs to satisfy the existence of an association relationship between the target pluggable node B and the target pluggable class I and the completion of the execution of the target pluggable node B can be written in the rule engine expression corresponding to the target pluggable class I. Then, if there is an association relationship between the target pluggable node B and the target pluggable class I and the target pluggable node B is executed, the rule engine that hits the target pluggable class I is determined, and at this time, the method corresponding to the target pluggable class I will be executed to achieve sending an order information to a supplier.

[0101] For another example, in a certain application scenario, there is a business requirement: the requirement change includes changing the sending of an order information to a supplier after the end of process A to sending part of the work order information to a supplier after the end of process A. Assuming that process A is defined as target pluggable node A, for the requirement change of target pluggable class I, you can write an expression in the rule engine expression corresponding to target pluggable class I that needs to satisfy the existence of an association relationship between target pluggable node A and target pluggable class I, the completion of execution of target pluggable node A and triggering the sending of part of the work order. Then, if there is an association relationship between target pluggable node A and target pluggable class I, and the rule engine that hits target pluggable class I is determined after the execution of target pluggable node A, the method corresponding to target pluggable class I will be executed at this time to realize the function of sending part of the work order.

[0102] In this embodiment, the association relationship between the target pluggable class and the target pluggable node can be changed according to the business change requirement, which further improves the flexibility of the association between the target pluggable class and the target pluggable node and provides an effective and convenient response measure for rapidly changing business requirements.

[0103] In one embodiment, the dynamic function compilation method further includes:

[0104] In a case where a target pluggable class offline instruction is received, determining a third target pluggable class among all target pluggable classes based on the target pluggable class offline instruction;

[0105] Deleting a second association relationship in the node configuration information, wherein the second association relationship is an association relationship between the third target pluggable class and the target pluggable node;

[0106] The target pluggable class attribute of the third target pluggable class is deleted from the target pluggable class configuration information.

[0107] It should be noted that business needs may change rapidly, and the configured target plug-in class may not necessarily be needed for a long time. In order to improve the simplicity of the target program, it is necessary to provide a convenient way for the offline of the target plug-in class. In this embodiment, the target plug-in class is an independent and flexibly configurable method. The target plug-in class and the node can be associated by configuring the association relationship to insert the target plug-in class that meets the business needs into the corresponding node of the target program. In this embodiment, when the target plug-in class is used, the target plug-in class can be directly deleted by the target plug-in class offline instruction. Specifically, when the target plug-in class offline instruction is received, the target plug-in class that needs to be offline in all the target plug-in classes specified in the target plug-in class offline instruction is obtained as the third target plug-in class. All associations corresponding to the third target plug-in class are deleted in the node configuration information, that is, the associations between the third target plug-in class and the target pluggable node are deleted. And further, the target plug-in class attribute of the third target plug-in class in the target plug-in class configuration information is also deleted to achieve complete offline of the third target plug-in class.

[0108] In this embodiment, the flexibility of target plug-in type operations is further improved through the offline mode of target plug-in type, so as to achieve a quick response to user needs and improve the adaptability of the target program.

[0109] Figure 2 The structure block diagram of a computing device according to an embodiment of the present application is schematically shown. Figure 2 As shown, an embodiment of the present application provides a computing device, which may include:

[0110] A memory X10 configured to store instructions;

[0111] The processor X20 is configured to call instructions from the memory and implement the dynamic function compilation method described in the above embodiment when executing the instructions.

[0112] An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the dynamic function compilation method described in the above embodiment.

[0113] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0114] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0115] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0117] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0118] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0119] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0120] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0121] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A dynamic function compilation method, characterized in that: include: Determine a target pluggable class and target pluggable class attributes based on the received dynamic function code, wherein the target pluggable class attributes include a class path, a function name, and a function code; Persisting the target pluggable class attributes into the target pluggable class configuration information; Determine a target pluggable node among all pluggable nodes in the target program based on business requirements; Acquire node information of the target pluggable node based on a code position of the target pluggable node; configuring an association relationship between the target pluggable class and the target pluggable node based on the business requirement, the node information, and the target pluggable class configuration information; The association relationship is stored in the node configuration information corresponding to the target pluggable node, so that when the target program runs to the target pluggable node, the method corresponding to the target pluggable class is executed based on the node configuration information.

2. The dynamic function compilation method according to claim 1, characterized in that: The configuring the association relationship between the target pluggable class and the target pluggable node based on the business requirement, the node information, and the target pluggable class configuration information includes: Determine a first target pluggable class based on the service requirement, wherein the first target pluggable class is a target pluggable class corresponding to the target pluggable node among all the target pluggable classes; Determining a first execution order between each of the first target plug-in classes; An association relationship between the first target pluggable class and the target pluggable node is configured based on the first execution order, the node information, and the target pluggable class configuration information.

3. The dynamic function compilation method according to claim 1 or 2, characterized in that: The association relationship includes a coding binding relationship, a second execution order, an execution mode, and a result association relationship, wherein the second execution order refers to the execution order of the target pluggable class and the target pluggable node, the execution mode includes asynchronous execution and synchronous execution, and the result association relationship refers to the dependency relationship between the execution result of the target pluggable class and the execution result of the target pluggable node.

4. The dynamic function compilation method according to claim 1, characterized in that: The dynamic function compilation method also includes: Determine a rule engine expression corresponding to the target pluggable class based on the dynamic function code; Associating the rule engine expression with the rule engine of the target pluggable class; The method corresponding to executing the target plug-in class based on the node configuration information includes: A rule engine for executing the target plug-in and unplug-in class based on the node configuration information; When the rule engine is hit, the method corresponding to the target plug-in class is executed.

5. The dynamic function compilation method according to claim 4, characterized in that: The dynamic function compilation method further includes: In case of receiving a service change requirement, determining a second target pluggable class among all the target pluggable classes based on the service change requirement; Determine whether there is node change information based on the business change requirement; In the case where the node change information exists, the rule engine expression corresponding to the second target pluggable class is modified based on the business change requirement, or the first association relationship is deleted in the node configuration information, wherein the first association relationship is the association relationship between the second target pluggable class and the target pluggable node.

6. The dynamic function compilation method according to claim 1, characterized in that: The dynamic function compilation method further includes: In a case where a target pluggable class offline instruction is received, determining a third target pluggable class among all the target pluggable classes based on the target pluggable class offline instruction; Deleting a second association relationship in the node configuration information, wherein the second association relationship is an association relationship between the third target pluggable class and the target pluggable node; The target plug class attribute of the third target plug class is deleted from the target plug class configuration information.

7. The dynamic function compilation method according to claim 1, characterized in that: After the step of executing the method corresponding to the target plug-in class based on the node configuration information, the method further includes: Generate and store an execution record of the method corresponding to the target plug-in class.

8. The dynamic function compilation method according to claim 1, characterized in that: Before the step of determining the target pluggable class and the target pluggable class attribute based on the received dynamic function code, the method further includes: Create requests based on input dynamic functions and write interfaces for output functions; A machine-readable file of a preset file type is compiled and generated based on the dynamic function code received by the function writing interface and the specified code position.

9. The dynamic function compilation method according to claim 1, characterized in that: The dynamic function compilation method also includes: Obtain all non-privatized methods in the target program; Based on the node creation requirement, a target non-privatized method among all the non-privatized methods is determined as a pluggable node.

10. A computing device, characterized in that include: a memory configured to store instructions; A processor is configured to call the instructions from the memory and implement the dynamic function compilation method according to any one of claims 1 to 9 when executing the instructions.

11. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions, which are used to enable a machine to execute the dynamic function compilation method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and system for achieving system function dynamic extension and replacement through multi-language cloud compilation

    CN106293863A

  • Method and device for generating self-defined services, computer equipment and storage medium

    CN108920135A

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

    CN111506366A

  • Bank comprehensive front-end system based on RAP technology

    CN111813383A

  • Software pluggable method and device based on dynamic compiling, equipment and medium

    CN117270862A