Data script execution method and system
By generating and texting functional text in the cloud, combining the storage and replication of code pages and side pages, the problem of insufficient script execution efficiency and flexibility in the existing technology is solved, and efficient and flexible deployment and maintenance of the system is achieved.
Patent Information
- Application Number
- CN202510217368.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, Python and other languages need their own libraries and follow other people's natural language programming specifications, resulting in insufficient script execution efficiency and flexibility.
Generate functional text in the cloud and text it, maintain the same version as the cloud through functional modules, and use code pages and side page storage and copying to realize dynamic configuration and update of scripts to avoid local code modifications.
Simplifies the deployment and maintenance process, improves the flexibility and maintainability of the system, avoids logical errors caused by inconsistencies in versions, and improves the efficiency and flexibility of script execution.
Smart Images

Figure CN120386575A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of script execution, and particularly relates to a method and system for executing data scripts. Background Art
[0002] A computer script is a series of instructions written in a specific language for automatically executing computer tasks. Usually, the function export interface is turned into an SDK and provided to languages such as Python and C for automated tasks to complete system tasks such as testing and debugging.
[0003] However, currently, languages such as Python require their own libraries and need to follow the natural language programming specifications of others. In addition to the volume brought by the libraries, large language features are often required. Summary of the Invention
[0004] The technical problem to be solved by the present invention is: to provide a method and system for executing data scripts, which can improve the efficiency and flexibility of the system in executing scripts.
[0005] To solve the above technical problem, the technical solution adopted by the present invention is: A method for executing a data script, comprising the steps of: Generating corresponding function texts according to function function configurations in the cloud; Creating a function module, storing function texts of the same version as those in the cloud in the function module, and identifying the execution logic of the function texts generated in the cloud; Storing the function texts and their execution logic according to a code page, copying the code page to obtain a corresponding secondary page, and using the code page or the secondary page as a script for execution.
[0006] To solve the above technical problem, another technical solution adopted by the present invention is: A data script execution system, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned method for executing a data script is implemented.
[0007] The beneficial effects of the present invention are as follows: By generating functional text in the cloud and textifying the functional logic, it is possible to dynamically configure and update the program logic without modifying the local code, avoiding the cumbersome process of traditional file updates, simplifying deployment and maintenance, and enhancing the flexibility and maintainability of the system; The functional modules maintain the same version of functional text as the cloud, ensuring consistency between the functional text and the module function description, and avoiding logical errors caused by version inconsistencies; Through the storage and replication of the code page and the secondary page, different script logics can be quickly switched and executed. By setting the secondary page, the data system can be independent without affecting the original functional process, thereby enhancing the efficiency and flexibility of the system in executing scripts. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 It is a flowchart of a method for executing a data script according to an embodiment of the present invention; Figure 2 It is a schematic diagram of a system for executing a data script according to an embodiment of the present invention; Figure 3 It is a program flow logic diagram of a method for executing a data script according to an embodiment of the present invention; Figure 4 It is a flowchart of functional text recognition according to an embodiment of the present invention; Figure 5 It is a schematic diagram of storing functional text of a state machine according to an embodiment of the present invention; Figure 6 It is a schematic diagram of exporting functional text of a module according to an embodiment of the present invention; Figure 7 It is a schematic diagram of generating a script for a code page and a secondary page according to an embodiment of the present invention.
[0009] Reference Numeral Explanation: 1. A system for executing a data script; 2. A memory; 3. A processor. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0010] To describe in detail the technical content, the achieved objectives, and the effects of the present invention, the following is described in conjunction with the embodiments and with reference to the drawings.
[0011] Please refer to Figure 1 , An embodiment of the present invention provides a method for executing a data script, including the steps of: Generating corresponding functional text according to the configuration of functional functions in the cloud; Creating a functional module, where the functional module stores functional text of the same version as the cloud, and identifying the execution logic of the functional text generated by the cloud; Storing the functional text and its execution logic by code page, copying the code page to obtain a corresponding secondary page, and using the code page or the secondary page as a script for execution.
[0012] As can be seen from the above description, the beneficial effects of the present invention are as follows: By generating functional text in the cloud and texturizing the functional logic, it is possible to dynamically configure and update the program logic without modifying the local code, avoiding the cumbersome process of traditional file updates, simplifying deployment and maintenance, and enhancing the flexibility and maintainability of the system; The functional modules maintain the same version of the functional text as the cloud, ensuring the consistency between the functional text and the module function description, and avoiding logical errors caused by version inconsistencies; Through the storage and replication of the code page and the secondary page, it is possible to quickly switch and execute different script logics. By setting the secondary page, the data system can be independent without affecting the original functional process, thereby enhancing the efficiency and flexibility of the system in executing scripts.
[0013] Furthermore, identifying the execution logic of the functional text generated by the cloud includes: Splitting the functional text to obtain a name text and parameter data, where the parameter data is state machine data, including logical data of states, events, actions, and behaviors; Storing the name text corresponding to the functional text and the state machine data in the state machine.
[0014] As can be seen from the above description, by splitting the functional text, it is possible to clearly extract the name text and parameter data, facilitating subsequent logical execution; Storing the name text and state machine data in the state machine can effectively manage the states and logics of the program, ensuring the accuracy and controllability of the execution process; By managing the logical data through the state machine, a modular design of the logic is achieved, facilitating expansion and maintenance.
[0015] Furthermore, storing the name text corresponding to the functional text and the state machine data in the state machine further includes: Allocating a storage space according to the memory address allocation result corresponding to the functional text in the state machine, and sequentially executing the data of each functional text in the state machine. If there is an execution result, store the execution result in the result storage space corresponding to the functional text in the state machine.
[0016] As can be seen from the above description, by allocating memory addresses and result storage spaces for the functional text, it is possible to efficiently manage memory resources, avoiding memory waste or overflow; Storing the execution result in the state machine facilitates the subsequent execution and reuse of the logic, enhancing the execution efficiency of the system; Sequentially executing the functional texts in the state machine to ensure the sequentiality and correctness of the logical execution.
[0017] Furthermore, the execution result is used as a parameter input when the corresponding functional text is executed next time.
[0018] As described above, by inputting the execution result as the parameter for the next execution, the reuse and transfer of data are achieved, reducing repeated calculations and improving execution efficiency; and ensuring the logical coherence between functional texts, enabling complex logical processes to be realized and improving the functionality of the system.
[0019] Further, in the cloud, corresponding functional texts are generated according to the function configurations, including: Extracting the function name of the function as the name text; Determining whether the function has parameter data. If so, storing the parameter data in a preset parameter memory and establishing an association relationship between the name text and the parameter memory to obtain the functional text.
[0020] As described above, by extracting the function name and parameter data, standardized functional texts are generated, facilitating subsequent parsing and execution; storing the parameter data in a preset parameter memory can effectively manage the parameter data and avoid data loss or chaos; by establishing an association relationship between the name text and the parameter memory, the logical integrity and executability of the functional text are ensured.
[0021] Please refer to Figure 2 , another embodiment of the present invention provides an execution system for data scripts, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, each step of the above-described execution method for data scripts is implemented.
[0022] The above-described execution method and system for data scripts of the present invention are applicable to improving the efficiency and flexibility of the system in executing scripts, which will be described below through specific embodiments: Please refer to Figure 1 , Figures 3 to 7 , the first embodiment of the present invention is: An execution method for data scripts, including the steps of: S1. Generating corresponding functional texts according to the function configurations in the cloud.
[0023] In this embodiment, extracting the function name of the function as the name text; determining whether the function has parameter data. If so, storing the parameter data in a preset parameter memory and establishing an association relationship between the name text and the parameter memory to obtain the functional text.
[0024] Specifically, please refer to Figure 6, first, derive the name text according to the function function. For example, for the function Test01, the name text Test01 is derived. Then, determine whether the function function has parameter data. If so, allocate the maximum parameter memory. Since memory needs to be allocated in advance to save data, obtain the corresponding type size according to the type of the parameter data. For example, the int type is 4 bytes. Furthermore, use a binary tree to store the association between the established name text and the parameter memory to obtain the function text, which is convenient for subsequent identification of the function text.
[0025] In this embodiment, the function text is transmitted through the HTTP protocol to ensure that the logical text can be flexibly transmitted and configured in the cloud.
[0026] S2. Create a function module that stores the function text of the same version as the cloud and identifies the execution logic of the function text generated by the cloud.
[0027] Specifically, please refer to Figure 3 , the function module is kept in the same version as the cloud. When updating the function text logic, it is used to ensure that the function text is consistent with the function description in the module. Therefore, through the configuration and control within the cloud, the logical update of the program can be achieved without updating the file.
[0028] The steps of identifying the execution logic of the function text are specifically as follows: S21. Split the function text to obtain the name text and parameter data. The parameter data is state machine data, including logical data of state, event, action, and behavior; store the name text corresponding to the function text and the state machine data into the state machine.
[0029] Specifically, please refer to Figure 4 and Figure 5 , during the identification process, the parser parses the syntax of the function text, that is, splits the function text and obtains the execution logic. For example, Test01 is the name text of the function text; if the state machine data is parsed as 1 and 2, then Test01(1,2) is obtained.
[0030] Push the assignments and parameters in the function text into the memory to play the role of data delivery, and store them in the state machine according to the name text and parameter data of the function text.
[0031] S22. Allocate a storage space for the result according to the memory address allocation result corresponding to the function text in the state machine, and sequentially execute the data of each function text in the state machine. If there is an execution result, store the execution result in the result storage space corresponding to the function text in the state machine.
[0032] Among them, the state machine allocates a space to wait for the execution result of the function and writes the data into the memory space. This is to receive the execution result, that is, the return value. If there is no return value, this step does not exist. Therefore, the return value will be saved in the memory address. Each function has a corresponding memory address that can accommodate the return value, and the return value is used for the subsequent call of the function, such as a = Test01(0), B = Test01(a); or to view the current result, that is, the return value result.
[0033] The executor is responsible for executing the data in the state machine. When the state machine fills in the execution order, when the executor executes to the state machine, the state machine can match the function text to the corresponding memory in sequence for execution.
[0034] S3. Store the function text and its execution logic according to the code page, copy the code page to obtain the corresponding secondary page, and use the code page or the secondary page as a script for execution.
[0035] Specifically, please refer to Figure 7 , the function text of the code page is also stored in the secondary page. Therefore, the code page or the secondary page constructs the script content for operation. When executing the secondary page script, the data can be isolated and executed according to the isolation device, and it can be flexibly configured. Without affecting the original function process, an independent data system can be established.
[0036] Please refer to Figure 2 , the second embodiment of the present invention is: An execution system 1 for a data script, including a memory 2, a processor 3, and a computer program stored on the memory 2 and operable on the processor 3. When the processor 3 executes the computer program, it implements each step of the method for executing a data script in the first embodiment.
[0037] In summary, for the method and system for executing a data script provided by the present invention, by generating function text in the cloud, the program logic can be dynamically configured and updated without modifying the local code, avoiding the cumbersome process of traditional file updates, simplifying deployment and maintenance, and improving the flexibility and maintainability of the system; the function module maintains the same version of the function text as the cloud, ensuring that the function text is consistent with the module function description and avoiding logical errors caused by version inconsistencies; through the storage and copying of the code page and the secondary page, different script logics can be quickly switched and executed. By setting the secondary page, an independent data system can be established without affecting the original function process, thereby improving the efficiency and flexibility of the system for executing scripts.
[0038] The above are only embodiments of the present invention, and do not thus limit the patent scope of the present invention. All equivalent transformations made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in the relevant technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for executing a data script, characterized in that Including the steps: Generating corresponding function text according to the function configuration in the cloud; Creating a function module, which stores the function text of the same version as that in the cloud, and identifying the execution logic of the function text generated by the cloud; Storing the function text and its execution logic according to the code page, copying the code page to obtain a corresponding secondary page, and executing the code page or the secondary page as a script.
2. The method for executing a data script according to claim 1, wherein: Identifying the execution logic of the function text generated by the cloud includes: Splitting the function text to obtain a name text and parameter data, where the parameter data is state machine data, including logical data of states, events, actions, and behaviors; Storing the name text corresponding to the function text and the state machine data into the state machine.
3. The execution method of a data script according to claim 2, wherein Storing the name text corresponding to the function text and the state machine data into the state machine further includes: Allocating a result storage space according to the memory address allocation result of the function text in the state machine, sequentially executing the data of each function text in the state machine, and if there is an execution result, storing the execution result into the result storage space of the function text corresponding to the state machine.
4. A method for executing a data script according to claim 3, characterized in that: The execution result is used as a parameter input when the corresponding function text is executed next time.
5. A method for executing a data script according to claim 1, characterized in that Generating corresponding function text according to the function configuration in the cloud includes: Extracting the function name of the function as the name text; Judging whether the function has parameter data. If so, storing the parameter data in a preset parameter memory, and establishing an association relationship between the name text and the parameter memory to obtain the function text.
6. An execution system for a data script, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the following steps are implemented: Generating corresponding function text according to the function configuration in the cloud; Creating a function module, which stores the function text of the same version as that in the cloud, and identifying the execution logic of the function text generated by the cloud; Storing the function text and its execution logic according to the code page, copying the code page to obtain a corresponding secondary page, and executing the code page or the secondary page as a script.
7. A data script execution system according to claim 6, characterized in that: Identifying the execution logic of the function text generated by the cloud includes: Splitting the function text to obtain a name text and parameter data, where the parameter data is state machine data, including logical data of states, events, actions, and behaviors; Storing the name text corresponding to the function text and the state machine data into the state machine.
8. The execution system of a data script according to claim 7, wherein Storing the name text corresponding to the function text and the state machine data into the state machine further includes: Allocating a result storage space according to the memory address allocation result of the function text in the state machine, sequentially executing the data of each function text in the state machine, and if there is an execution result, storing the execution result into the result storage space of the function text corresponding to the state machine.
9. A data script execution system according to claim 8, characterized in that: The execution result is used as a parameter input when the corresponding function text is executed next time.
10. The execution system of a data script according to claim 6, wherein, Generating corresponding function text according to the function configuration in the cloud includes: Extracting the function name of the function as the name text; Judging whether the function has parameter data. If so, storing the parameter data in a preset parameter memory, and establishing an association relationship between the name text and the parameter memory to obtain the function text.