Script programming method and system based on custom function
By registering and managing custom functions in the script programming interface, the development cycle extension and cost increase caused by changes in business demand in the traditional development model is solved, and the effect of rapidly changing business logic and reducing development and maintenance costs is achieved.
Patent Information
- Application Number
- CN202510109551.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-06-13
AI Technical Summary
Under the traditional development model, when business needs change, the development team needs to invest a lot of time in redesigning and coding of business logic, which makes the debugging, deployment and verification process time-consuming and labor-intensive, extending the product launch cycle and increasing the collaboration cost between business personnel and technicians.
Provides a script programming method and system based on custom functions. By configuring database connection information in the script programming interface, rewriting function method name definition, function call parameter definition and function implementation logic, registering custom functions, and updating the version content of the custom function through the version management module, to achieve rapid changes in business processing logic and debugging test verification.
Quickly change the business processing logic under complex business needs, reduce system development and maintenance costs, improve development efficiency, reduce labor costs, realize the effect of time-for-space exchange, and support function version management and hot rollback.
Smart Images

Figure CN120144104A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and specifically, relates to a script programming method and system based on custom functions. Background Art
[0002] In today's rapidly evolving business environment, enterprise application development faces unprecedented challenges. With the ever-changing market demands, frequent changes in user requirements have become the norm during the enterprise application development process, which poses extremely high flexibility and adaptability requirements for the background business logic of the application. At the same time, the increasing complexity of data processing and the continuous emergence of new business models further exacerbate the adjustment pressure on the background system, resulting in frequent adjustment of business logic in the background, long cycles for debugging, deployment, and verification processes, large investments by business personnel and technical personnel, and high labor costs.
[0003] Under the traditional development model, whenever business requirements change, the development team often needs to invest a large amount of time in re-designing and coding business logic, and the subsequent debugging, deployment, and verification processes are even more time-consuming and laborious, greatly extending the product launch cycle. This situation not only significantly increases the close cooperation costs between business personnel and technical personnel, but also makes it difficult for enterprises to respond quickly to market changes, thereby affecting the user experience and enterprise competitiveness.
[0004] Patent application document CN113626071A discloses a function registration method, system, electronic device, and storage medium. The source code of the function is obtained through the function dispatcher, and the code generator corresponding to at least one data source to be registered by the function is called; the registration code corresponding to at least one data source called is generated by the at least one data source corresponding code generator; the source code and the registration code corresponding to at least one data source are compiled by the code compiler; and the compiled source code and the registration code corresponding to at least one data source are respectively sent to the corresponding data sources through the dependency dispatcher to achieve registration. However, this patent cannot completely solve the existing technical problems and cannot meet the requirements of the present invention. Summary of the Invention
[0005] Aiming at the defects in the prior art, the purpose of the present invention is to provide a script programming method and system based on custom functions.
[0006] According to a script programming method based on custom functions provided by the present invention, it includes:
[0007] Step S1: Configure database connection information in the script programming interface, and rewrite the function method name definition, function call parameter definition, and function implementation operation logic in the custom function registration module to complete the registration of custom functions;
[0008] Step S2: Update the version content of the custom function through the version management module, automatically scan the custom function on the front-end interface, register it to the prompt according to the annotation defined by the function method name, and load the function call parameter definition to write code in the script programming interface. Compile the code into script code and execute it through the script execution module;
[0009] Step S3: Return the processing result and error message obtained by the script execution module compiling and executing the script code to the log information through the log processing module, and output it to the log window on the front-end interface;
[0010] Step S4: Save the custom function as an independent unit, record it in the version management module and classify it.
[0011] Preferably, the step S1 includes:
[0012] Step S1.1: Override the getName() method in the custom function registration module by inheriting the base registration function abstract class to return the data type, and define the type quantity of the function method name definition and the function method parameter definition;
[0013] Step S1.2: Define the function implementation operation logic in the custom function registration module;
[0014] Step S1.3: Register and persist according to the defined function method name according to the spring Bean scanning and loading strategy of java, and add annotations.
[0015] Preferably, the step S2 includes:
[0016] Step S2.1: Extract the characteristics of the custom function annotation in the custom function registration module, according to the annotation <textarea>The label constructs a text input function control with multiple lines using language_tools;< / textarea>
[0017] Step S2.2: Write script code to call the custom function in the script programming interface through {...}, let to define variables within the scope, return statement to return values from functions or scripts, if / elsif / else conditional statements, for / while loop statements, break and continue supports;
[0018] Step S2.3: Judge the script code caching operation, record the execution time and the log information of exception handling, compile and execute the script code in the script execution module and parse it, and execute according to the getName() method of the custom function and the function implementation operation logic.
[0019] Preferably, the step S3 includes:
[0020] Step S3.1: After the script execution module compiles, executes, and parses the script code, store the processing result in the execute execution result, and obtain a context mapping from the environment, find the log points, and insert them into the console output statements;
[0021] Step S3.2: Obtain the log information of the console through the log processing module, clear the console content in the console container, obtain the log information from the processing result, and set the corresponding HTML content for the log container elements.
[0022] Preferably, the said Step S4 includes:
[0023] Step S4.1: Obtain the encoding, name, category, and its description filled in the page header, and call the version management module through a long string;
[0024] Step S4.2: Save the script code, function method name definition, and function method parameter definition to the database according to the mapping entity information of the long string after compilation and execution. The mapping entity information of compilation and execution retains the information content of the custom function and the script version information, and adds a script number to the script version information;
[0025] Step S4.3: Retain the category code and the associated script code in the script category. The category code is saved in the new style of a JSON array.
[0026] According to the script programming system based on custom functions provided by the present invention, it includes:
[0027] Module M1: Configure the database connection information in the script programming interface, and rewrite the function method name definition, function call parameter definition, and function implementation operation logic in the custom function registration module to complete the registration of custom functions;
[0028] Module M2: Update the version content of the custom function through the version management module, automatically scan the custom function on the front-end interface, register it to the prompt according to the annotation of the function method name definition, and load the function call parameter definition to the script programming interface to write code. Compile the code into script code and execute it through the script execution module;
[0029] Module M3: Return the log information of the processing result and error information obtained by the script execution module compiling and executing the script code to the front-end interface's log window through the log processing module;
[0030] Module M4: Save the custom function as an independent unit, and record and classify it in the version management module.
[0031] Preferably, the said Module M1 includes:
[0032] Module M1.1: Override the getName() method in the custom function registration module by inheriting the base registration function abstract class to return the data type, and define the number of types of function method names and function method parameter definitions;
[0033] Module M1.2: Define the function implementation operation logic in the custom function registration module;
[0034] Module M1.3: Register and persist according to the defined function method name according to the spring Bean scanning and loading strategy of java, and add annotations.
[0035] Preferably, the module M2 includes:
[0036] Module M2.1: Extract the characteristics of the custom function annotation in the custom function registration module, according to the annotation <textarea>The label constructs a text input function control with multiple lines using language_tools;< / textarea>
[0037] Module M2.2: Write script code to call custom functions in the script programming interface through {...}, let to define variables within the scope, return statement to return values from functions or scripts, if / elsif / else conditional statements, for / while loop statements, break and continue supports;
[0038] Module M2.3: Judge the script code caching operation, record the execution time and log information of exception handling, compile and execute the script code in the script execution module and parse it, and execute according to the getName() method of the custom function and the function implementation operation logic.
[0039] Preferably, the module M3 includes:
[0040] Module M3.1: After compiling, executing and parsing the script code in the script execution module, store the processing result in the execute execution result, and obtain a context mapping from the environment, find the log point and insert it into the console output statement;
[0041] Module M3.2: Obtain the console log information through the log processing module, clear the console content in the console container, obtain the log information from the processing result, and set the corresponding HTML content for the log container elements.
[0042] Preferably, the module M4 includes:
[0043] Module M4.1: Obtain the encoding, name, category and its description filled in the page header, and call the version management module through a long string;
[0044] Module M4.2: Save the mapping entity information obtained by compiling and executing the script code, function method name definitions, and function method parameter definitions based on a long string into a database. The mapping entity information obtained by compiling and executing retains the information content of custom functions and the script version information, and adds a script number to the script version information.
[0045] Module M4.3: Retain the category code and the associated script code in the script category. The category code is saved in the new style of a JSON array.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] (1) Through global calls, the present invention solves the problems of long response time to user requirements and high labor costs caused by continuously summoning technical personnel during system development. It can quickly change the business processing logic under complex business requirements and debug and verify the results without secondary deployment, thereby reducing the development and maintenance costs of the system.
[0048] (2) The editor of the present invention is intelligent and user-friendly, with a prompt function. It can automatically associate and prompt the functions registered in the cache according to the input characters in the editor, and prompt the methods and their parameters.
[0049] (3) The functions of the present invention are stored in the server's running memory, and the business logic script code implemented by calling the functions is stored in the database to achieve a reasonable allocation of storage space by trading time for space.
[0050] (4) The present invention includes a function version management module. Through the version number, multiple version iterations can be performed on the same script, and the content of the previous version is retained. Moreover, it realizes the hot rollback of the application version, and operations such as the release and rollback of script functions can be achieved without restarting the application.
[0051] (5) The present invention includes a module for recording the modification logs of script functions, which can record the operation records of personnel modifying script functions to achieve better management of script functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] By reading the detailed description of the non-restrictive embodiments with reference to the following drawings, other features, objectives, and advantages of the present invention will become more apparent:
[0053] Figure 1 It is a schematic flowchart of a script programming method based on custom functions;
[0054] Figure 2 It is a schematic structural diagram of a script programming system framework based on custom functions;
[0055] Figure 3 Schematic diagram of the function call interface of the script programming system based on custom functions;
[0056] Figure 4 Schematic diagram of the function call of the script programming system based on custom functions;
[0057] Figure 5 Schematic diagram of the function call result of the script programming system based on custom functions;
[0058] Figure 6 Schematic diagram of the function version management interface of the script programming system based on custom functions;
[0059] Figure 7 Structural diagram of the custom function registration module;
[0060] Figure 8 Structural diagram of the script execution module;
[0061] Figure 9 Structural diagram of the log processing module;
[0062] Figure 10 Structural diagram of the version management module. Specific implementation mode
[0063] The present invention will be described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several changes and improvements can still be made. These all belong to the protection scope of the present invention.
[0064] Embodiment 1
[0065] The present invention provides a script programming method based on custom functions, taking Figure 1 as an example, including:
[0066] Step S1: Implement the custom function registration module (for the module structure, see Figure 7 ), implement the custom function to complete the extension and automatically complete the registration. Configure the database connection information of the system. First, through the configuration file application.properties in the JAVA SPRING framework, configure the jdbc url and its username and password, and then read the configuration file to obtain the database connection. At the same time, developers can abstract different function processing logics according to different business scenarios, and complete the registration of custom functions by inheriting the abstract class of the custom function registration module interface in the server and rewriting the function method name definition, function call parameter definition, and function implementation operation logic.
[0067] In a preferred example, a custom function for creating an alarm object is completed by finishing the operation cases of a single table.
[0068] In more preferred examples, step S1 includes the following steps:
[0069] Step S1.1: Define the method name and the number of method parameter types of the function. By inheriting the base registration function abstract class, override the getName() method to return a data type of String. For Figure 3 example, the subsequent call to the function method is in the form of "method name(parameters)". Define the annotation MethodDescription to pass in the parameter description at noon, and complete the description and auto - hint of the function through its instance.
[0070] Step S1.2: Define the function to implement the operation logic to achieve the steps. Make corresponding processing according to different scenarios. For example, as a simple addition of a single - table operation, obtain the parameters passed in by the page through JSON to implement the insertion operation.
[0071] Step S1.3: Persist it into the Spring container, add the @Component annotation. When the system runs, it is automatically registered into the memory according to the spring Bean scanning and loading strategy of java.
[0072] Step S2: Implement the script execution module (for the module structure, see Figure 8 ), and implement the call instance of the basic call of the function. The basic call of step S1 can be completed on the front - end. When the system starts, all custom functions will update the configuration policy and be initialized and loaded into the memory. When calling the platform programming interface, it automatically scans the custom functions and registers according to the information in the hint content module defined by the function. After registering the function hint information, then load the parameter information annotated in the custom function into the page rendering as Figure 3 shown. When entering A on the interface, it can automatically associate with the function registered in the hint information of step S1.
[0073] Specifically, step S2 includes the following steps:
[0074] Step S2.1: Extract the features required to implement the basic function call. Analyze the basic functions required for the basic function execution according to the <textarea>The label constructs a text input function control with multiple lines and uses language_tools to implement function auto-completion.< / textarea>
[0075] taking Figure 2 as an example, including elements such as format, execution, save, cancel, console, etc.
[0076] Step S2.2: As Figure 2As shown, a programming window is implemented. The custom function implemented in step S1 can be called programmatically, and lexical scoping can be implemented programmatically, such as {...}, variables defined within the scope of let, the return statement, which is used to return (a value) from a function or script, the if / elsif / else conditional statement, the for / while loop statement, and break and continue are supported.
[0077] Step S2.3: Execute the written code. After selecting to execute, call the script compiler in the script execution module. After the script is compiled, the compiled content can be cached in memory. During the execution of the compiled script, record the execution time, handle exceptions during the execution process, and return the log record and exception information to the console for display. Put the code into the script execution module in the server for compilation and execution. When executing, obtain the function definitions registered in the function, parse the code therein. If there are registered function definitions, map out their implementation methods through getName() in step S1 and execute the logical operations.
[0078] If there is no function definition, the code execution module will prompt "Function not found:*****" and output the specific exception information to the visual console.
[0079] Step S3: Implement a log processing module (for the module structure, see Figure 9 ). Output the processing results, error messages obtained by the script execution module called by the server for the functions and their logical codes in the script programming interface, and the log information returned by the log processing module to the log window on the front-end interface.
[0080] In a preferred example, the call to create an alarm object in step S1 is completed. When a custom function is called in the script programming interface, the custom function receives the parameters passed in from the front-end interface and executes the defined function logic. The operation result is taken as Figure 5 as an example of the call result of the custom function. For the call of the custom function taking Figure 3 as an example, after the code in the script programming interface calls the script execution module in the server to obtain the processing result, call the log processing module in the server to output the processing result to the log window.
[0081] In more preferred examples, step S3 includes the following steps:
[0082] Step S3.1: After executing the written code through step S2.3, store the result in the execute execution result, and obtain a mapping of a context from the environment, find the log points and insert them into the console output statements.
[0083] Step S3.2: After clicking "Execute" in Step S2 and upon successful response, obtain the console log information of Step S1, and clear the Figure 2 log content returned by the previous execution in the front-end log window, and Figure 4 take it as an example to obtain the log information content from the processing result and set the corresponding HTML content for the log window element.
[0084] Step S4: Implement a version management module (for the module structure, see Figure 10 ), and save functions along with their version control and classification.
[0085] Saving functions means that they can be easily called and reused when needed without having to rewrite the same code repeatedly. By saving functions as independent units, the code can be better organized and made easier to maintain and update. The version management module can record the evolution history of the code, including information such as what was changed each time and the timestamp, facilitating backtracking and understanding the development trajectory of the code.
[0086] The version management module provides a backup mechanism for the code, allowing it to be restored to a previous version when needed to avoid accidentally losing important code. By classifying functions, the code can be better organized and managed, improving the readability and maintainability of the code, as shown in Figure 6 the version information management example.
[0087] In more preferred examples, Step S4 includes the following steps:
[0088] Step S4.1: By repeating Steps S1, S2, and S3, programming debugging in a simple application scenario can be completed and the requirements can be achieved, without the need for frequent code changes that lead to releases and other work. After completing a code programming, it is necessary to retain the programming information and perform version control on the programming information to achieve the functions of traceability and updateability.
[0089] In a preferred example, by clicking the Figure 3 save button shown in the figure, the page obtains the encoding, name, category, and description filled in the current page header, and at the same time passes the programmed code to the server as a long string and calls the version control module.
[0090] Step S4.2: Function saving and its version control mainly include two parts. The first part is code saving, and the other part is version control. Among them, the code saving and function type are saved into the database according to the parameters passed in step S4.1 through the mapping entity information. The specific entity class mapping information is shown in Table 1. The entity class mapping information retains the code version information, code, and name information, and at the same time saves the script version. The script number is referenced as a foreign key in the script version, and the specific corresponding code content is stored in the version control table. The version control table information is shown in Table 2.
[0091] Field Name Data Description Data Type CODE Script Encoding String NAME Script Name String REMARK Description String VERSION_ID Version Number String IS_LOCK Is Locked String REC_CREATE_TIME Creation Time String REC_CREATOR Creator String REC_REVISOR Revisor String
[0092] Table 1 The corresponding library table structure of the entity class required by the function
[0093] Field Name Data Description Data Type SCRIPT_ID Version Number String versionId Script Number String REMARK Description String CODE Version Number String ISCRIPT Script Content CLOB SORT Sorting String REC_CREATOR Creator String REC_REVISOR Revisor String
[0094] Table 2 The corresponding library table structure of the entity class required by the function
[0095] Field Name Data Description Data Type LABLE_CODE Category code String LABLE_NAME Category c name String REMARK Description String
[0096] Table 3 Function categories
[0097] Field Name Data Description Data Type LABLE_CODE Category code String SCRIPTT_CODE Script code String
[0098] Table 4 Function category relationships
[0099] The script is a business logic process implemented by calling encapsulated custom functions. The code version information records the evolution history of the script, including information such as the content of each change and the timestamp, which is convenient for backtracking and understanding the development track of the script. Taking the custom function registered in step S1 as an example to implement a simple business. The example of step S1 is to implement a simple single-table column insertion. Through the Figure 2 front-end script programming interface, the custom function registered in step S1 can be called. Before calling the custom function, a business script can be written according to the requirements of the business itself. It can be seen that the script programming interface supports implementing lexical scopes through programming and can cooperate with other custom functions to complete a simple business logic online.
[0100] After completing the writing of a script code, the business logic can be saved through the version information management module by filling in the encoding, name, category, and description. When it is necessary to modify the business logic in the script, you can choose to directly modify the current version or create a new version (as Figure 6 shown).
[0101] Step S4.3: Through the version control of the function programming content, the version of the current application and the rollback of the previous version function can be freely controlled. After creating too many custom function libraries, the script category can be used to define different business types or application scenarios. The script category only retains the code of the category and the code of the associated script. The category code is saved in the new format of a JSON array, which can achieve multi-category association. The specific table information of the script category table is shown in Tables 3 and 4.
[0102] Embodiment 2
[0103] The present invention also provides a script programming system based on custom functions. The script programming system based on custom functions can be implemented by executing the process steps of the script programming method based on custom functions. That is, those skilled in the art can understand the script programming method based on custom functions as the preferred implementation manner of the script programming system based on custom functions.
[0104] According to the present invention, a script programming system based on custom functions is provided. Taking Figure 2 as an example, it mainly includes a console, a front-end interface, and a server.
[0105] The front-end interface mainly includes a script programming interface, a log window, and script version information, realizes online script editing, and provides a ready programming environment, enabling direct online writing, running, and debugging of code.
[0106] The script programming interface can call custom functions to meet the business requirements of different scenarios. Share the script library through the script version information and view the modifications of different servers in real time, which promotes a more efficient and transparent workflow among teams. The execution operation is realized through the instant feedback of the log window, making it convenient to see the code results of programming at a glance. Since a large number of components and encapsulated interfaces are used for development, the development efficiency is greatly improved.
[0107] The server includes a custom function registration module, a script execution module, a log processing module, and a version management module.
[0108] The custom function registration module service requires the basic custom AbstractFunction base abstract class, and in the project, it rewrites the definition of the function method name, the definition of function call parameters, and the operation logic of function implementation.
[0109] Among them, the operation logic of function implementation is responsible for processing different data parameters to implement abstract business methods or general components. The definition of function call parameters receives data and is responsible for defining the parameter type, quantity, and processing result of the function. The definition of function method name is responsible for registering it on the platform according to the defined name to achieve in-memory persistence.
[0110] In the script execution module, the script code executed by the front end can be received, compiled and executed, and the processing result is returned to the log processing module. Then, the log processing module processes and prints the information and returns it to the front end in JSON format to display the log information. Finally, the version management module can control the version content of the current script by cooperating with the script version information of the front-end interface.
[0111] Those skilled in the art know that in addition to implementing the system and its various devices, modules, and units provided by the present invention in the form of pure computer-readable program code, the method steps can be logically programmed to enable the system and its various devices, modules, and units provided by the present invention to be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers, etc. to achieve the same functions. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a kind of hardware component, and the devices, modules, and units included therein for implementing various functions can also be regarded as the structures within the hardware component; the devices, modules, and units for implementing various functions can also be regarded as either software modules for implementing the method or structures within the hardware component.
[0112] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. Without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A script programming method based on a custom function, characterized in that: include: Step S1: configure the database connection information in the script programming interface, rewrite the function method name definition, function call parameter definition and function implementation operation logic in the custom function registration module to complete the registration of the custom function; Step S2: Update the version content of the custom function through the version management module, automatically scan the custom function in the front-end interface, register it to the prompter according to the annotation defined by the function method name, load the function call parameter definition into the script programming interface to write the code, and compile the code into script code through the script execution module and execute it; Step S3: The processing result and error information obtained by compiling and executing the script code by the script execution module are returned to the log information through the log processing module and output to the log window of the front-end interface; Step S4: Save the custom function as an independent unit, record it in the version management module and classify it.
2. The script programming method based on user-defined functions according to claim 1, characterized in that: The step S1 comprises: Step S1.1: Override the return data type of the getName() method in the custom function registration module by inheriting the basic registration function abstract class, and define the number of types of function method name definition and function method parameter definition; Step S1.2: define the function implementation operation logic in the custom function registration module; Step S1.3: According to the defined function method name, register persistence according to Java's spring Bean scanning and loading strategy, and add annotations.
3. The script programming method based on user-defined functions according to claim 1, characterized in that: The step S2 comprises: Step S2.1: Extract the features of the custom function annotation in the custom function registration module, and <textarea> The tag builds a text input function control using language_tools multiple lines;< / textarea> Step S2.2: In the script programming interface, write script code to call custom functions through {...}, let to define variables within the scope, return statement for returning values from functions or scripts, if / elsif / else conditional statements, for / while loop statements, break and continue support; Step S2.3: Determine the script code cache operation, record the execution time and exception handling log information, compile and execute the script code in the script execution module and parse it, and implement the operation logic execution according to the getName() method and function of the custom function.
4. The script programming method based on user-defined functions according to claim 1, characterized in that: The step S3 comprises: Step S3.1: After the script execution module compiles, executes and parses the script code, the processing result is stored in the execute execution result, and a context mapping is obtained from the environment, the log point is found and inserted into the console output statement; Step S3.2: Obtain the log information of the console through the log processing module, clear the console content in the console container, obtain the log information from the processing result, and set the corresponding HTML content for the log container element.
5. The script programming method based on user-defined functions according to claim 1, characterized in that: The step S4 comprises: Step S4.1: Get the code, name, category and description filled in the page header, and call the version management module through the long string; Step S4.2: Save the script code, function method name definition and function method parameter definition into the database after the mapping entity information of the compiled execution is based on the long string. The compiled execution mapping entity information retains the information content of the custom function and the script version information, and adds the script number to the script version information; Step S4.3: The category code and the associated script code are retained in the script category, and the category code is saved in a new format of a JSON array.
6. A script programming system based on user-defined functions, characterized in that: include: Module M1: Configure database connection information in the script programming interface, rewrite the function method name definition, function call parameter definition and function implementation operation logic in the custom function registration module to complete the registration of the custom function; Module M2: Update the version content of the custom function through the version management module, automatically scan the custom function in the front-end interface, register it to the prompter according to the annotation defined by the function method name, and load the function call parameter definition into the script programming interface to write the code, and compile the code into script code and execute it through the script execution module; Module M3: The processing results and error information obtained by compiling and executing the script code in the script execution module are returned to the log information through the log processing module and output to the log window of the front-end interface; Module M4: Save the custom functions as independent units, record and categorize them in the version management module.
7. The script programming system based on user-defined functions according to claim 6, characterized in that: The module M1 comprises: Module M1.1: Override the getName() method return data type in the custom function registration module by inheriting the basic registration function abstract class, and define the number of types of function method name definition and function method parameter definition; Module M1.2: Define functions to implement operation logic in the custom function registration module; Module M1.3: According to the defined function method name, register persistence according to Java's spring Bean scanning and loading strategy, and add annotations.
8. The script programming system based on user-defined functions according to claim 6, characterized in that: The module M2 comprises: Module M2.1: Extract the features of custom function annotations in the custom function registration module, and <textarea> The tag builds a text input function control using language_tools multiple lines;< / textarea> Module M2.2: In the script programming interface, use {...}, let to define variables within the scope, return statement to return values from functions or scripts, if / elsif / else conditional statements, for / while loop statements, break and continue support to write script code to call custom functions; Module M2.3: Determine the script code cache operation, record the execution time and exception handling log information, compile and execute the script code in the script execution module and parse it, and implement the operation logic execution according to the getName() method and function of the custom function.
9. The script programming system based on user-defined functions according to claim 6, characterized in that: The module M3 comprises: Module M3.1: After the script execution module compiles, executes and parses the script code, the processing result is stored in the execute result, and a context map is obtained from the environment, the log point is found and inserted into the console output statement; Module M3.2: Obtain the log information of the console through the log processing module, clear the console content in the console container, obtain the log information from the processing result, and set the corresponding HTML content for the log container element.
10. The script programming system based on user-defined functions according to claim 6, characterized in that: The module M4 comprises: Module M4.1: Get the code, name, category and description filled in the page header, and call the version management module through the long string; Module M4.2: Save the script code, function method name definition and function method parameter definition into the database according to the mapping entity information compiled and executed by the long string. The compiled and executed mapping entity information retains the information content of the custom function and the script version information, and adds the script number to the script version information; Module M4.3: Keep the category code and the associated script code in the script category, and the category code is saved as a new type of JSON array.
Citation Information
Patent Citations
Function registration method and system, electronic equipment and storage medium
CN113626071A