Script execution methods, apparatus and computer equipment
By using automated script execution methods, the problems of high manpower and communication costs and low efficiency in database maintenance are solved, achieving efficient and reliable database maintenance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2026-04-03
AI Technical Summary
In database maintenance, existing technologies require frequent communication between script writers and executors, resulting in high manpower and communication costs, low script execution efficiency, and a high risk of errors.
This paper provides a script execution method that obtains and reviews the script and execution rules, and automatically executes the script using a server. The script is executed in the corresponding database according to a preset order and time. The method includes task status feedback and anomaly monitoring to ensure the accuracy and efficiency of the script.
It reduces manpower and communication costs, improves the efficiency and reliability of script execution, avoids accidental operations, and is suitable for various database maintenance scenarios.
Smart Images

Figure CN113703942B_ABST
Abstract
Description
Technical Field
[0001] This application relates primarily to the field of computer technology, and more specifically to a script execution method, apparatus, and computer device. Background Technology
[0002] Currently, routine maintenance of database data requires script writers to create and execute corresponding scripts. When batch maintenance scripts need to be executed, due to differences in the execution order, execution time, and databases of each script, it is necessary for script writers and executors to communicate continuously. This process is cumbersome, consumes a lot of manpower and communication costs, and the execution efficiency of maintenance scripts is relatively low, and it is easy to make mistakes.
[0003] Therefore, determining how to execute appropriate scripts quickly and accurately for different types of databases to meet the daily maintenance needs of those databases has become an important research area in this field. Summary of the Invention
[0004] In view of this, in order to solve the above-mentioned technical problems, this application provides the following technical solution:
[0005] On the one hand, this application proposes a script execution method, the method comprising:
[0006] Obtain the first script and the first execution rule constructed for the first task; wherein, the first execution rule includes the execution time of the first task, as well as the execution database and execution order of the first script, the reviewer information and the operation and maintenance target information;
[0007] Upon detecting an approval message for the first script and the first execution rule, the first task is executed according to the execution time.
[0008] Establish a communication connection between the server and the execution database of the first script, and send the first script to the corresponding execution database for execution according to the execution order.
[0009] Optionally, if waiting nodes are configured among the multiple first scripts corresponding to the first task, the method further includes:
[0010] If the first task is detected to be in a task waiting state, stop executing the first task and send the execution status information of the first task back to the script provider client output;
[0011] If a task continuation message for the first task is received from the script provider client, the system responds to the task continuation message and sends the first script, which is not currently being executed, to the corresponding execution database for execution according to the execution order.
[0012] If a second script and / or a second execution rule constructed for the first task is received from the script provider client, the second script and / or the second execution rule are sent to the corresponding reviewer client; the second script is obtained by updating the first script that was not executed in the first task.
[0013] Upon receiving the approval message from the reviewer's client, the first task continues to be executed according to the second execution rule, and the second script or the first script that was not executed in the first task is sent to the corresponding execution database for execution.
[0014] Optionally, the method further includes:
[0015] Based on the script execution requirements, the execution process of each execution database on the corresponding first script is monitored, and corresponding monitoring results are obtained;
[0016] If the monitoring results indicate that the execution database is abnormal in executing the corresponding first script, control the execution database to terminate the execution of the first script, perform a data rollback operation, and return the first task to the script provider client so that the first task enters an execution failure state.
[0017] Optionally, the first execution rule further includes a task execution result notification method, and the method further includes:
[0018] Check whether all scripts built for the first task are in a successful execution state;
[0019] If so, in accordance with the task execution result notification method, a task execution success message for the first task is pushed to the script provider client or the script provider's preset terminal.
[0020] Furthermore, this application also proposes a script execution method, the method comprising:
[0021] Output the script task creation page;
[0022] In response to a task creation operation on the script task creation page, a first task is created;
[0023] In response to a configuration input operation for the first task, a first script and a first execution rule constructed for the first task are obtained; wherein, the first execution rule includes the execution time of the first task, and the execution database, execution order, reviewer information, and operation and maintenance target information of the first script;
[0024] In response to the task submission operation for the first task, the first script and the first execution rule of the first task are reported to the server.
[0025] Optionally, the step of obtaining the first script and first execution rule constructed for the first task in response to a configuration input operation for the first task includes:
[0026] In response to the rule selection operation for the first task, a first execution rule for the first task is generated;
[0027] In response to the script entry operation for each execution database and each operation and maintenance target information in the first execution rule, the corresponding first script is obtained.
[0028] Optionally, the method further includes:
[0029] In response to the confirmation and closure operation for the first task, send the execution result feedback information for the first task to the server;
[0030] The confirmation shutdown operation is based on the execution status of each script of the first task and whether the execution result matches the corresponding operation and maintenance target information; the execution result feedback information can indicate the script provider's satisfaction with the execution result of the first task.
[0031] Furthermore, this application also proposes a script execution apparatus, the apparatus comprising:
[0032] The task information acquisition module is used to acquire the first script and the first execution rule constructed for the first task; wherein, the first execution rule includes the execution time of the first task, as well as the execution database and execution order of the first script, the reviewer information and the operation and maintenance target information;
[0033] The task execution module is used to detect the approval message for the first script and the first execution rule, and execute the first task according to the execution time;
[0034] The script execution module is used to establish a communication connection between the server and the execution database of the first script, and to send the first script to the corresponding execution database for execution according to the execution order.
[0035] Furthermore, this application also proposes a script execution apparatus, the apparatus comprising:
[0036] The output module is used to output the script task creation page;
[0037] The task creation module is used to create a first task in response to a task creation operation on the script task creation page;
[0038] The task information acquisition module is used to obtain a first script and a first execution rule constructed for the first task in response to a configuration input operation for the first task; wherein, the first execution rule includes the execution time of the first task, as well as the execution database, execution order, reviewer information and operation and maintenance target information of the first script;
[0039] The task submission module is used to report the first script and the first execution rule of the first task to the server in response to the task submission operation for the first task.
[0040] In another aspect, this application also proposes a computer device, said computer device comprising:
[0041] The memory is used to store a first program that implements the script execution method executed on the server side as described above, or to store a second program that implements the script execution method executed on the client side as described above.
[0042] A processor is configured to call and execute a first program stored in the memory to implement a script execution method executed on the server side; or to call and execute a second program stored in the memory to implement a script execution method executed on the client side.
[0043] Therefore, this application provides a script execution method, apparatus, and computer device. Facing the maintenance needs of different types of databases, script writers (i.e., script providers) can create a first task and write the required first script for each type of database, configuring the first execution rules accordingly, such as the execution time of the first task, the execution order of each first script, the execution database, reviewer information, and maintenance target information. In other words, for different database maintenance needs, the script execution scheme for the corresponding task can be flexibly configured. After this information is reported to the server, the server can send the first script and the first execution rules to the corresponding reviewer client based on the reviewer information contained in the first execution rules, reminding the reviewer to review the received information. If the review is successful, the reviewer sends a corresponding approval message to the server. This ensures that the server ensures that both the first script and the first execution rules are qualified before automatically executing the first task according to the execution time and sending the first script to the corresponding execution database for execution according to the approved execution order, improving the reliability and efficiency of script execution and avoiding misoperation. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0045] Figure 1 A schematic diagram of the system architecture for implementing the script execution method proposed in this application;
[0046] Figure 2 A flowchart illustrating an optional example of the script execution method proposed in this application;
[0047] Figure 3 This is a flowchart illustrating yet another optional example of the script execution method proposed in this application;
[0048] Figure 4 A schematic diagram of the signaling flow, which is another optional example of the script execution method proposed in this application;
[0049] Figure 5 This is a schematic diagram of an optional example of the script execution device proposed in this application;
[0050] Figure 6 A schematic diagram of another optional example of the script execution device proposed in this application;
[0051] Figure 7 A schematic diagram of another optional example of the script execution device proposed in this application;
[0052] Figure 8 A schematic diagram of another optional example of the script execution device proposed in this application;
[0053] Figure 9 A schematic diagram of the hardware structure of an optional example of a computer device suitable for the script execution method proposed in this application;
[0054] Figure 10 A schematic diagram of the hardware structure of another alternative example of a computer device suitable for the script execution method proposed in this application. Detailed Implementation
[0055] To address the technical problems described in the background section, this application proposes using an operations and maintenance robot to execute various operations and maintenance scripts submitted by script writers. Specifically, the operations and maintenance robot sends each script contained in a task to the corresponding execution database (such as Oracle, MySQL, etc.; this application does not restrict the database type and can be used as appropriate) based on the execution time, execution database, execution order, reviewer, and operations and maintenance purpose submitted by each script writer. This eliminates the need for feedback and communication between script writers and executors, significantly saving labor and communication costs, improving script execution efficiency, avoiding misoperations, and enhancing script execution reliability.
[0056] Moreover, this application can configure execution rules in a targeted manner for different types of databases that need to be maintained for different tasks. That is, it implements personalized script execution schemes for different application scenarios. Compared with operation and maintenance automation tools that can only use fixed script execution schemes to meet the database maintenance needs in specific scenarios, this application can be applied to multiple scenarios. In any application scenario, corresponding script execution schemes can be configured for different script execution tasks, thereby quickly and efficiently executing script execution tasks and meeting the database maintenance needs of that application scenario.
[0057] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0058] Reference Figure 1 The system architecture diagram for implementing the script execution method proposed in this application, in a database operation and maintenance management application scenario, may include: terminal 100, server 200, and database 300, wherein:
[0059] Terminal 100 can be a user device connected to the database operation and maintenance management system, which may include, but is not limited to, smartphones, tablets, wearable devices, augmented reality (AR) devices, virtual reality (VR) devices, robots, desktop computers, etc. Figure 1 The terminal 100 shown is merely an example and does not impose any limitation on the product type of the terminal 100 in the embodiments of this application.
[0060] In this embodiment of the application, the script writer (i.e. the script provider) can use the script compilation client in the terminal 100 to write scripts for maintaining the corresponding databases according to the operation and maintenance requirements of each database to be maintained. Alternatively, they can log in to the database operation and maintenance management platform through the terminal 100 and enter the operation and maintenance script compilation page to complete the script writing. This application does not limit the script writing implementation method and can be determined as appropriate.
[0061] In practical applications, different script execution tasks can be created to meet different database operation and maintenance requirements. The scripts required for each script execution task can be written by the same or different script writers. The same script execution task may require the construction of one or more scripts, depending on the situation. This application does not impose any restrictions on this.
[0062] In addition, after the script writer constructs the corresponding script for the script execution task, especially when there are multiple scripts corresponding to the script execution task, the script execution rules need to be configured, such as the execution time, execution order, reviewer, operation and maintenance purpose of each script, so that the operation and maintenance robot can execute the script execution task accordingly. This application does not describe in detail the content of the execution rules and the configuration method, but can refer to, but is not limited to, the description of the corresponding part of the following embodiments.
[0063] Based on the above analysis, the script reviewers selected by the script writers can view the review task through the review terminal after receiving it. After accepting the review task, they can download the relevant information to be reviewed, such as the script corresponding to the review task and its task configuration information. Then, according to the script review requirements, they can review the information to be reviewed, such as assessing whether the data modification complies with relevant regulations, whether there are risks in executing the script according to the task configuration information, and whether there are obvious syntax errors in the script. This application does not limit the content of the script review requirements, which can be determined as appropriate and flexibly adjusted according to the needs of the scenario. This application will not elaborate on these requirements.
[0064] After reviewing the scripts in the above manner, the script reviewer can obtain the corresponding review results, such as approval; failure to approve, return of task configuration information; change of the executor specified for non-automatically executed scripts, etc. This application does not restrict the content of the review results or the output method.
[0065] As can be seen, in the entire system architecture, the aforementioned terminal 100 may include terminals used by script providers and terminals used by script reviewers. In some scenarios, it may also include user terminals for viewing operation and maintenance results. This application does not restrict the types of terminals used by users with different identities, and can determine them according to actual needs. This application will not describe them in detail.
[0066] Server 200 can be a service device providing database operation and maintenance services, also known as an operation and maintenance robot. It can be a standalone physical server, a service cluster consisting of multiple physical servers, or a cloud server with cloud computing capabilities. This application does not limit the structural type of server 200 and can be determined as appropriate. In practical applications, server 200 can communicate with terminal 100 through wired or wireless communication networks to realize data interaction between the two. This application does not limit the communication method between server 200 and terminal 100.
[0067] Based on the above analysis, the scripts for each script execution task built by each script provider, as well as the script execution rules formulated for the script execution task, i.e., the task configuration information, can be uploaded to the server 200. The server 200 will then execute the corresponding scripts according to the script execution rules. The implementation process can be referred to the description of the corresponding part of the method embodiment below, which will not be described in detail here.
[0068] Database 300 can be a data storage device for storing data, which is the object that needs to be maintained in this application. In practical applications, database 300 can be used as a standalone device or integrated into the aforementioned server 200. That is to say, server 200 can integrate commonly used databases of different types such as MySQL, Server, and Oracle to enable operations on different types of databases. For example, a script built for the database can be sent to the database, and the database can execute the received script to complete the maintenance of the database. This application does not restrict the database type or its deployment location, and can be determined as appropriate.
[0069] It should be understood that, Figure 1 The system architecture shown does not constitute a limitation on the system in the embodiments of this application. In practical applications, the system used to implement the script execution method may include more than Figure 1 The more or fewer components shown, or combinations of certain components, are not listed here.
[0070] Based on the system architecture described in the above embodiments, the implementation process of the script execution method will be described below, such as... Figure 2 The diagram shown is a flowchart of an optional example of the script execution method proposed in this application. This method can be executed by a server. It describes how the server controls the database to automatically execute the corresponding scripts after receiving scripts reported by various script providers and the execution rules of their respective tasks. However, it is not limited to the implementation process described in this embodiment. Figure 2 As shown, the script execution method may include:
[0071] Step S11: Obtain multiple first scripts and first execution rules constructed for the first task;
[0072] Based on the above description of the technical concept of this application, for the maintenance of a database or several databases of the same or different types, it is usually necessary to provide corresponding scripts. These scripts can be written and submitted by script writers. Since multiple scripts for the same task (which can be determined based on the database maintenance needs of the application scenario) are usually executed sequentially in a certain order to maintain the corresponding functions of the corresponding database and meet the task testing requirements, it is evident that after determining the multiple first scripts required for the first task, it is necessary to configure the corresponding first execution rules according to the actual scenario requirements. These rules include, but are not limited to, the execution tasks of the corresponding first task and the execution order of the first scripts contained within that first task.
[0073] Furthermore, in practical applications, the scripts and their execution rules reported by script writers (i.e., script providers) need to be reviewed and verified by reviewers to ensure that their content meets the review requirements before proceeding with subsequent operations. As for the reviewers of different scripts, the script provider can choose and determine them independently; the system can automatically assign and determine them; or the script provider's direct supervisor can be directly designated as the reviewer. This application does not restrict the method of determining the reviewer and can be determined as appropriate.
[0074] In addition, different scripts for the same task may have different maintenance purposes for the corresponding execution database. In order to detect whether the script execution result has achieved the script execution purpose, the maintenance purpose of each script can be pre-configured, that is, the script execution purpose. This purpose can be entered by the script provider according to the actual situation. This application does not limit the implementation method.
[0075] It should be noted that the content of the first execution rule (i.e., the script execution rule for each first script executing the first script task) mentioned above includes, but is not limited to, the execution time for the first task listed above, as well as the execution order of each first script, the execution database and reviewer information, and the script operation and maintenance target information (i.e., the maintenance purpose described above). Depending on application needs, it can also be pre-determined whether each first script needs to be processed first, whether it contains DDL (Data Definition Language) statements or other high-risk statements, whether to send an execution result notification message, and what method to use to send the execution result notification message, etc. This application does not limit the content of the first execution rule.
[0076] Regarding the scripts containing DDL statements described above, incomplete data may result from the successful submission of only some statements. To avoid executing such incomplete scripts, this application can pre-define that if any statement fails to submit during the script submission process, the entire script will be rolled back. Furthermore, since DDL statements often correspond to modifications to the data table structure, they may cause large-scale database locking or package failures. Therefore, operational guidelines typically require that such scripts be manually executed during system deployment, rather than automatically by the server. Thus, for any script submitted for any task, this application can pre-define whether the script contains DDL statements when configuring the execution rules for that task, to determine whether the script should be executed automatically by the server or manually.
[0077] In practical applications, the creation and submission of the above tasks, as well as the first script and first execution rule constructed for any task (which can be referred to as the first task), can be entered by the script provider by logging into the system. The implementation process can be referred to the description of the corresponding part of the method embodiment described from the terminal side below. This embodiment will not be described in detail here.
[0078] In some embodiments, the scripts and their corresponding execution rules reported by various script providers for the same or different tasks can be stored in a queue or similar manner. The server can listen to the information content in the storage space to obtain the tasks in the pending execution state and their corresponding scripts and execution rules, but is not limited to this method of acquisition.
[0079] Step S12: Upon detecting the approval message for the first script and the first execution rule, execute the first task according to the execution time contained in the first execution rule;
[0080] As described above, in order to improve the reliability and success rate of database execution scripts, for the scripts and execution rules reported by each script provider for a certain task, before executing the task, the submitted information can be sent to the corresponding reviewer for review according to the reviewer information included in the execution rule. For example, the reviewer can check whether the data modification corresponding to the script complies with the system requirements, whether the script execution plan (i.e., the execution rule) has any risks, and whether the script itself has obvious grammatical errors. This application does not restrict the reviewer's review method or review standards for scripts and execution rules, and can be determined as appropriate.
[0081] For any reviewer, the review method described above, but not limited to it, is used to review the content to be reviewed in the issued review task, such as the scripts and execution rules mentioned above. The review results can be: approved, rejected and returned to the script execution rules and / or script; for scripts requiring manual execution, the preset executor can be changed. The review result is then reported to the server so that the server can perform subsequent operations based on the review result. This application describes the processing method when the review result is "approved". Different scripts in the same task can be sent to the same reviewer or different reviewers for review; this application does not limit this and it depends on the situation.
[0082] In practical applications, the auditor's audit terminal can submit the above audit results through message reporting or other means. For example, for an audit result that has passed, a corresponding audit pass message can be generated. In response to the audit result reporting operation entered by the auditor, the audit pass message is sent to the server so that the server can update the audit status of the corresponding script and execution rules accordingly, such as updating from the pending audit status to the audited status or the audit passed status. The implementation method is not detailed in this application.
[0083] The first scripts and execution rules corresponding to the first task are reviewed in the manner described above. If the review is successful, the server can automatically execute the first task according to the execution rules. For example, if the first task requires the execution of three first scripts, and these three first scripts correspond to three execution databases, with each execution database executing one first script, and the execution is configured to take place at 2 AM, based on these execution rules, after the server detects the approval message for the first task and detects that the current time has reached 2 AM, it can execute the first task. For example, based on the detection result that the current time has reached 2 AM, the server can generate an execution request for the first task, respond to the execution request, and execute the first task. However, this task triggering method is not limited to this.
[0084] Step S13: Establish a communication connection between the server and the execution database of the first script, and send the first script to the corresponding execution database for execution according to the execution order contained in the first execution rule.
[0085] As described above regarding the first execution rule, the script provider pre-configures the first execution rule for the first task based on scenario requirements. Therefore, when the server determines that the first task can be executed based on the first execution rule, it can establish a communication connection with the corresponding execution database according to the execution order of the first scripts included in the first execution rule and the execution database, and send the sequentially executed first scripts to the corresponding execution databases for execution. This application does not limit the communication method between the server and the execution database; it can refer to, but is not limited to, the description in the corresponding parts of the system embodiment above.
[0086] It is understood that the execution databases corresponding to the multiple first scripts included in the first task can be of the same type or different, depending on the circumstances. This application does not restrict the type of execution database for executing different first scripts, and does not describe in detail the implementation method of executing the first scripts for each type of execution database.
[0087] In summary, in this embodiment of the application, in response to the maintenance needs of different types of databases, script writers (i.e., script providers) can create corresponding script execution tasks, denoted as the first task, and write the required first scripts for each type of database. They can also configure the first execution rules in a targeted manner, such as the execution time of the first task, the execution order of each first script, the execution database, the reviewer information, and the operation and maintenance target information. That is, for different database maintenance needs, the script execution scheme of the corresponding task can be flexibly configured. After this information is reported to the server, the server can send the first script and the first execution rules to the corresponding reviewer client output according to the reviewer information contained in the first execution rules, reminding the reviewer to review the received information. If the review is passed, the reviewer will send the corresponding review pass message back to the server. This ensures that the server is qualified before executing the first task according to the execution time and the first script is sent to the corresponding execution database for execution according to the approved execution order, thereby improving the reliability and success rate of script execution. Moreover, during the script execution phase, the server directly controls the execution database to execute the first script sequentially according to the first execution rule of the first task. Compared with the manual execution method, this greatly improves the script execution efficiency, avoids misoperation, and further improves the reliability of script execution.
[0088] Reference Figure 3 This is a flowchart illustrating another optional example of the script execution method proposed in this application. This embodiment describes the construction process of scripts and execution rules for different tasks in the script execution method described in the above embodiments. This method can be executed by a terminal, more specifically, it describes the process of obtaining scripts and execution rules from the corresponding client side configured on the terminal of the script provider. However, it is not limited to the implementation method described in this embodiment. Figure 3 As shown, the method may include:
[0089] Step S21: Output the script task creation page;
[0090] For script providers, i.e. script writers, when faced with database maintenance tasks, they need to provide corresponding scripts and configure the execution rules, i.e., script execution schemes, for the task execution. To do this, script providers can launch the corresponding client in the terminal, enter the corresponding account, password and other identity information, log in to the application platform of the database operation and maintenance management system, and enter the script task creation page. This application does not restrict the entry process and can be determined as appropriate.
[0091] Based on the above analysis, in some embodiments, the script task creation page output by the embodiments of this application is configured with a task creation component, a script input component, an execution rule selection input component, etc., and the script task creation page presents input windows / function buttons corresponding to these components respectively. Accordingly, the script provider is prompted to complete the input of the corresponding information according to the input prompts of each component. This application does not limit the layout structure of the script task creation page, and can make adaptive adjustments and configurations according to application requirements.
[0092] In some other embodiments, for the input windows / function buttons, etc., corresponding to the components described above, as described above, they can be displayed on the script task creation page, or a corresponding window can be popped up on the script task creation page to output, or a new window can be popped up to output the input windows / function buttons, etc., corresponding to the next level components. This application does not limit this.
[0093] Step S22: In response to the task creation operation on the script task creation page, create the first task;
[0094] When faced with database maintenance tasks, the script provider can click the task creation button on the script task creation page to create a new task that indicates the need to perform the corresponding database maintenance. This task is designated as the first task. Then, the content to be executed by the first task can be configured. This application does not restrict the creation process of the first task.
[0095] As analyzed above, in order to facilitate the configuration of the script and execution rules for the first task, a task configuration window for the first task can be output after the first task is created, so as to instruct the script provider to complete the configuration of relevant task information in the task configuration window. This application does not restrict the output method of the task configuration window, such as directly jumping from the script task creation page to the task configuration window for the first task, or popping up the task configuration window for the first task, etc., depending on the situation.
[0096] Understandably, in order to clarify which script provider or group of scripts created each task, the identity information of the script provider that requested the creation of the first task can be associated with it, such as associating the first task with the script provider's employee ID, account name / ID, or other identity identifiers.
[0097] Step S23: In response to the configuration input operation for the first task, obtain the first script and the first execution rule built for the first task;
[0098] Based on the description of the first script and the first execution rule in the above embodiments, the first script can be written online by the script provider according to the maintenance requirements of the corresponding execution database, or written in advance in offline mode according to the maintenance requirements of the execution database. In this way, the first script stored at the corresponding storage address can be directly loaded in the script input box without waiting for the script provider to enter the script online, thereby shortening the online execution time of the script. This application does not limit the method of obtaining the first script, which can be determined according to the actual situation. Furthermore, this application does not describe in detail the implementation process of how to construct the corresponding first script according to the maintenance requirements of the execution database.
[0099] As for the aforementioned first execution rule, since it includes, but is not limited to, the execution time of the first task, as well as the execution database, execution order, reviewer information, and operation and maintenance target information of each first script in the first task, the script task creation page or task configuration window may include an execution rule selection area. This execution rule selection area may include multiple rule contents that can be used as execution rules. Each rule content may include one or more options, so that the script provider can select according to actual maintenance needs.
[0100] As can be seen, for tasks built to meet different database maintenance needs, i.e. different script execution tasks, script providers can flexibly configure corresponding scripts and execution rules, which realizes personalized configuration of script execution schemes, which is conducive to improving the reliability and success rate of script execution. Moreover, in the process of configuring execution rules, this application directly provides options, allowing script providers to directly select according to actual needs, thereby improving the efficiency and standardization of execution rule configuration.
[0101] It should be noted that, in addition to the contents listed above, the content of the first execution rule constructed for the first task in this application may also include whether any first script is executed automatically, and if manual execution is selected, the executor information; the notification method for the execution result of the first task, such as SMS, email, voice, instant messaging, etc.; whether it contains DDL statements; whether it needs to be prioritized, etc. The contents of the options can be adjusted according to the needs of the scenario so as to select an execution rule that better meets the requirements of database maintenance specifications and can better perform database operation and maintenance. This application will not elaborate on each one.
[0102] Step S24: In response to the task submission operation for the first task, the first script and the first execution rule of the first task are reported to the server.
[0103] Following the above method, after loading each first script of the first task and selecting each content included in the first execution rule, the script provider can confirm the submission of the first task, such as by clicking the task submission button, and upload the first task and its included first scripts, first execution rules and other information to the server, and wait for the server to execute the first task according to the first execution rule. Regarding the execution process of the first task, you can refer to the implementation process of the script execution method described above from the server side, which will not be repeated in this embodiment.
[0104] In summary, in this embodiment, the script provider can write corresponding scripts for database maintenance needs and configure script execution schemes accordingly. This includes, but is not limited to, various execution requirements for the created task, such as task execution time, execution order of scripts for the same task, reviewer, and maintenance purpose. Instead of using fixed execution rules, uploading the first scripts and execution rules of the constructed first task to the server allows the server to automatically execute the first task according to the first execution rules, controlling the corresponding database to automatically execute the first scripts. This more efficiently meets the maintenance requirements of various databases. Compared to script executors following script provider comments or verbal instructions, this saves labor and communication costs, improves script execution efficiency, avoids misoperation, and enhances script execution reliability.
[0105] Reference Figure 4 This is a signaling flow diagram illustrating another optional example of the script execution method proposed in this application. The embodiments of this application can be an optional refined implementation of the script execution method described in the above embodiments, but are not limited to this refined implementation method. Figure 4 As shown, the method may include:
[0106] Step S31: The script provider client outputs the script task creation page;
[0107] In step S32, the script provider client responds to the task creation operation on the script task creation page, creates the first task, and jumps to output the task configuration window for the first task;
[0108] In step S33, the script provider client responds to the configuration input operation of the task configuration window and obtains the first script and the first execution rule built for the first task;
[0109] In step S34, the script provider client responds to the task submission operation in the task configuration window by reporting the first script and the first execution rule of the first task to the server.
[0110] The implementation process of steps S31 to S34 can be referred to the description of the corresponding parts of the above embodiments, and will not be repeated in this embodiment.
[0111] In practical applications, to avoid incomplete script execution scheme information reported by the script provider client, which would reduce script execution reliability, this application can constrain the response conditions of the task submission operation. For example, it can determine that the task submission operation includes information such as the first task created, the first script created and loaded for the first task, and the first execution rule constructed for the first task before responding to the task submission operation. Conversely, it can choose not to respond to the task submission operation, and may even output a prompt message indicating that the corresponding content is missing. For example, if the first script is not loaded, the script provider will not submit the script execution task when performing the task submission operation, and may output a prompt message indicating that the script is not loaded, but it is not limited to this prompt method.
[0112] Optionally, in order to improve the reliability of script execution, the selected execution rules for the above response conditions can be refined to include specific content, such as whether to select the reviewer information of each first script. This application does not restrict the content of the response conditions and can be determined as appropriate.
[0113] It should be noted that the reviewer information selected for the first script and the script operation and maintenance target information entered above can exist independently of the execution rules, and this application does not restrict this. Since the process of obtaining this information and the processing after reporting it to the server are similar, this application uses the example of reviewer information and operation and maintenance target information being part of the execution rules for explanation.
[0114] Step S35: The server constructs an audit task for the first script and the first execution rule;
[0115] Step S36: The server, based on the reviewer information contained in the first execution rule, sends the review task to the reviewer's review client.
[0116] Step S37: In response to the confirmation audit operation of the output audit task, the audit client sends a script audit request for the audit task to the server.
[0117] Step S38: The server responds to the script review request by sending the corresponding first script and first execution rule to the review client;
[0118] Step S39: Review the first script and first execution rule received by the client.
[0119] In step S310, the audit client responds to the audit result input operation for the first script and the first execution rule by sending an audit approval message for the first task to the server;
[0120] In this embodiment of the application, the reviewers of the multiple first scripts included in the first task may be the same or different. This application does not impose any restrictions on this. After the script provider reports the first task and the first scripts and first execution rules included in it to the server, these information will be in a state of pending review. In order to improve the reliability of script execution, the server can send these information to the corresponding reviewers for review. The review process is not described in detail. The implementation process of sending the information to be reviewed includes, but is not limited to, the implementation methods described above.
[0121] In practical applications, the scripts and execution rules for multiple tasks reported by different script providers can all be sent to the reviewer for review as described above. Since the purposes of different tasks are different, the review content for each task can be different. Of course, preset script review standards can also be used to review the content to be reviewed for each task, depending on the situation. This embodiment will not elaborate on this. Furthermore, the review results for different tasks may be approved or rejected. The obtained review results can be directly fed back to the server so that the server can execute corresponding subsequent processing steps based on the review results. This embodiment uses the subsequent processing of the first task that has passed the review as an example for illustration.
[0122] In some embodiments, the server monitors the review status of the scripts and execution rules of each task reported by each script provider through a built listening process, and can extract the scripts and execution rules of tasks that have passed review for subsequent processing. Of course, the review client can also directly generate a message consistent with the review result and send it to the server so that the server can determine the first script and first execution rule of the first task that has passed review based on the message. This application does not limit the method by which the server learns the review status of the information to be reviewed for each task (such as the scripts, execution rules, etc.).
[0123] Optionally, if the reviewer determines that the script and / or execution rules of the second task do not meet the review standards, i.e., any piece of information to be reviewed does not meet the review standards, the reviewer may send a review failure message to the server. The review failure message may include the reasons for not meeting the review standards, and the reviewer may also provide corresponding adjustment suggestions. This application does not restrict the content of the review failure message.
[0124] Step S311: The server detects the approval message and executes the first task according to the execution time included in the first execution rule;
[0125] Step S312: The server establishes a communication connection with the execution database of the first script executed sequentially;
[0126] Step S313: The server sends the first scripts to be executed sequentially to the corresponding execution database according to the execution order contained in the first execution rule;
[0127] Step S314: Execute the first script received by the database;
[0128] In this embodiment, during the execution of any first task after approval by the server, if the current execution time reaches the preset time, a corresponding script process can be constructed to establish a connection with the corresponding execution database. The scripts are then sent to the corresponding execution database for execution in sequence according to the preset execution order of the first scripts included in the first task. The implementation process can be referred to the description of the corresponding part of the above embodiment, and will not be repeated in this embodiment.
[0129] In practical applications, servers can use the Linux operating system to implement script execution methods. Compared to script execution methods using the Windows operating system environment, when environmental anomalies occur, such as bastion host restarts or PL / SQL software crashes, the reliability and controllability of servers with Linux operating systems can ensure the stability of large-scale script execution processes.
[0130] Step S315: The server monitors the execution process of the corresponding first script in the execution database according to the script execution requirements and obtains the corresponding monitoring results;
[0131] Step S316: Using the monitoring result, determine whether the execution process is abnormal. If yes, proceed to step S317; otherwise, proceed to step S318.
[0132] During the execution of any first script, anomaly monitoring can be performed according to preset script execution requirements. For example, if a syntax error is detected in the currently executed first script, or the number of backups of the first script differs from the number of updated or deleted records (i.e., the number of lines during execution is inconsistent with the number of lines in the script scheme), it can be considered that the execution process of the first script has an anomaly. In other words, if any information does not meet the script execution requirements during the anomaly monitoring process, it can be considered that the execution process of the first script has an anomaly. This application does not limit the content of the script execution requirements and can be determined as appropriate.
[0133] Step 317: The server controls the execution database to terminate the execution of the first script, performs a data rollback operation, and returns the first task to the script provider client, so that the first task enters the execution failure state.
[0134] According to the above-mentioned abnormal monitoring method during script execution, if it is determined that the execution database is abnormal in executing a certain first script, the records of the first script that have been successfully executed can be rolled back. Here, rollback refers to the behavior of restoring the program or data to the previous correct state when a program or data processing error occurs. In this application embodiment, the execution database can be controlled to be restored to the state before the execution of the first script, or even to the state before the execution of the first task. The implementation method of database rollback is not described in detail in this application.
[0135] Meanwhile, if a script execution fails, the task created can be considered to have failed. The first task can be rolled back to the script provider. This involves sending the first task in the failed execution state, along with its first script and first execution rules, to the corresponding script provider client. If necessary, a task execution failure message can be output, which may include the execution error content. This allows the script provider to adjust the task's script and / or execution rules accordingly before resubmitting the task. The implementation process is similar to that described above and will not be detailed in this embodiment. For scripts / execution rules that previously reported execution errors, if successful execution after adjustment and resubmission, log information indicating that the execution error has been resolved can be recorded for later review.
[0136] In step S318, the server detects that the first task is in a task waiting state, stops executing the first task, and sends the execution status information of the first task back to the script provider client output.
[0137] In practical applications, during the execution of the first task, after executing part of the first script, in order to cope with the needs of background data modification and front-end business data interaction, the script provider may need to perform external operations, such as data verification, other non-database business operations, etc. For this purpose, a waiting node can be configured between the two first scripts. That is to say, a waiting node can be configured between multiple first scripts corresponding to the first task. This application does not restrict the configuration implementation method.
[0138] Based on this, during the execution of the first script by the corresponding execution database according to the execution order, if the server detects that the next node to be executed in sequence is a waiting node rather than a script execution node, meaning the first task is in a task waiting state, an event or instruction can be generated to notify the server to pause the execution of the first task. This allows the server to stop executing the first task and first execute the external system operation configured for the waiting node. Optionally, the server can return the first task to the script provider client at the waiting node to remind the script provider to perform an external system operation.
[0139] In order to enable the script provider to understand the execution progress of the first task, the server can feed back the first script that has not been executed in the first task, i.e. the first script in the unexecuted state, as part of the execution status information of the first script to the script provider client. This application does not restrict the implementation method of how the server returns the first task to the script provider client under the waiting node, and it can be determined according to the situation.
[0140] In step S319, the script provider client responds to the rule adjustment operation for the first task by reporting the second execution rule built for the first task to the server.
[0141] In step S320, the server receives the approval message from the reviewer's client regarding the second execution rule and continues to execute the first task;
[0142] Step S321: The server sends the first script that was not executed in the first task to the corresponding execution database for execution according to the second execution rule;
[0143] In this embodiment, after the server enters the waiting node and returns the first task to the script provider, the script provider can obtain the second execution rule according to the first execution rule acquisition method described above, based on the situation after completing the external operation. When necessary, the first script that has not been executed can also be adjusted to obtain the second script. The implementation process will not be described in detail in this embodiment.
[0144] Afterwards, the script provider can resubmit the first task with the re-entered second execution rule, second script, or the first script that was not executed, and then review it according to the above review process. After the review is approved, the first task can continue to be executed.
[0145] For example, suppose five scripts are constructed for the first task, denoted as script 1, script 2, script 3, script 4, and script 5. The execution order configured in the first execution rule is script 1, script 2, script 3, waiting node, script 4, and script 5. In this way, during the execution of the first task, after script 3 is sent to the corresponding execution database and completed, it will enter the task waiting state. At this time, the first task can be returned to the script provider to complete the external operation and then resubmit the first task. Then, the corresponding execution database can be controlled to execute script 4 and script 5 in sequence.
[0146] It is understandable that after the first task is returned to the script provider client, the script provider may not update its first execution rule or the first script that has not been executed. In this way, after completing the operation outside the system, it can directly send a task continuation execution message for the first task to the server. The server responds to the task continuation execution message and continues to execute the first task. According to the execution order contained in the first execution rule, the first script that has not been executed is sent to the corresponding execution database for execution in sequence. The implementation process can be referred to the description of the corresponding steps in the first execution of the first task above, and will not be repeated here in this embodiment.
[0147] Step S322: The server checks whether all scripts built for the first task are in a successful execution state. If yes, proceed to step S323; otherwise, return to step S312 to continue executing the first task.
[0148] Step S323: The server pushes a task execution success message for the first task to the script provider client according to the task execution result notification method included in the first execution rule;
[0149] The notification methods for task execution results can include, but are not limited to, SMS notifications, telephone notifications, voice SMS notifications, and email notifications. Furthermore, successful task execution messages can be directly pushed to the script provider's preset terminal output, allowing the script provider to promptly receive the execution result of the first task.
[0150] In step S324, the script provider client responds to the confirmation and closure operation for the first task by sending the execution result feedback information for the first task to the server.
[0151] In this embodiment, the confirmation to close the task is input by the script provider based on the execution status of each script in the first task and whether the execution results match the corresponding operation and maintenance target information. That is, if it is determined that all scripts included in the first task are in an executed state, or even a successfully executed state, and the data is correct, the task close button is clicked to complete the database maintenance task. The script provider can also provide an evaluation based on the entire script execution process. Therefore, the execution result feedback information can indicate the script provider's satisfaction with the execution result of the first task. This application does not limit the method and content of obtaining the execution result feedback information and can be determined as appropriate.
[0152] In summary, in this embodiment, the script provider creates corresponding tasks based on the maintenance requirements of each database, as well as the scripts and execution rules for each database required to execute the task. This achieves flexibility and convenience in configuring the script execution scheme. This information is then reported to the server, and after reliability review by the relevant reviewer, the server controls the execution of each script in the execution database according to the execution rules. Execution is carried out without communication between the script provider and the executor, greatly improving script execution efficiency and time flexibility, avoiding misoperation, and enhancing script execution reliability. Furthermore, when there are a large number of scripts to be executed, this automatic execution method ensures the timeliness of each script's execution.
[0153] It should be understood that during the execution of the above script, each script provider can create different first tasks and submit them to the server so that the server can detect multiple approved first tasks at the same time. For these multiple first tasks, they can be executed according to the execution time in their respective first execution rules. The execution process of any first task can be referred to the description of the corresponding part of the above embodiment, which will not be repeated in this embodiment.
[0154] In some embodiments, multiple first tasks can be executed simultaneously to improve the execution speed of batch scripts. The number of tasks executed simultaneously can be pre-configured on the server to determine the number of execution threads working concurrently. Each execution thread corresponds to one first task and connects to the execution database contained in that first task to realize the transmission of the corresponding first script. If necessary, different script extraction time intervals can be pre-configured during the extraction of different scripts from the same task. In this case, after the execution or transmission of a certain first script is completed, the next first script is sequentially extracted from the multiple first scripts of that first task after the extraction time interval has elapsed.
[0155] Reference Figure 5 This is a schematic diagram of an optional example of the script execution device proposed in this application. The device can be located on the server side, such as... Figure 5 As shown, the device may include:
[0156] The task information acquisition module 210 is used to acquire the first script and the first execution rule constructed for the first task; wherein, the first execution rule includes the execution time of the first task, as well as the execution database and execution order of the first script, the reviewer information and the operation and maintenance target information;
[0157] The task execution module 220 is used to detect the approval message for the first script and the first execution rule, and execute the first task according to the execution time;
[0158] The script execution module 230 is used to establish a communication connection between the server and the execution database of the first script, and to send the first script to the corresponding execution database for execution according to the execution order.
[0159] In some embodiments, if waiting nodes are configured among the multiple first scripts corresponding to the first task, such as Figure 6 As shown, the device may further include:
[0160] The first control module 240 is used to detect that the first task is in a task waiting state, stop executing the first task, and feed back the execution status information of the first task to the script provider client for output.
[0161] The second control module 250 is used to respond to the task continue execution message when it receives the task continue execution message for the first task from the script provider client, and send the first script in the non-execution state to the corresponding execution database for execution according to the execution order;
[0162] The third control module 260 is configured to send the received second script and / or second execution rule to the corresponding reviewer client upon receiving a second script and / or second execution rule constructed for the first task from the script provider client; the second script is obtained by updating the first script that was not executed in the first task.
[0163] The fourth control module 270 is used to receive the approval message from the reviewer client, continue to execute the first task according to the second execution rule, and send the second script or the first script that was not executed in the first task to the corresponding execution database for execution.
[0164] In some other embodiments, such as Figure 6 As shown, the device may further include:
[0165] The monitoring module 280 is used to monitor the execution process of the corresponding first script by each execution database according to the script execution requirements, and obtain the corresponding monitoring results;
[0166] The data rollback control module 290 is used to control the execution database to terminate the execution of the first script, perform a data rollback operation, and return the first task to the script provider client when the monitoring result indicates that the execution database is abnormal in executing the corresponding first script, so that the first task enters the execution failure state.
[0167] Based on the descriptions of the embodiments above, if the first execution rule further includes a task execution result notification method, the apparatus may further include:
[0168] The status detection module is used to detect whether each script built for the first task is in a successful execution state;
[0169] The message push module is used to push a task execution success message for the first task to the script provider client or the script provider's preset terminal in accordance with the task execution result notification method when the detection result of the status detection module is yes.
[0170] It should be noted that the various modules and units in the above-mentioned device embodiments can all be stored in the memory as program modules in the server. The processor in the server executes the above-mentioned program modules stored in the memory to achieve the corresponding functions. The functions achieved by each program module and its combination, as well as the technical effects achieved, can be referred to the description of the corresponding part of the above-mentioned method embodiments, and will not be repeated in this embodiment.
[0171] Reference Figure 7 This is a schematic diagram of another optional example of the script execution device proposed in this application. The device is located on the terminal side, such as... Figure 7 As shown, the device may include:
[0172] Output module 110 is used to output the script task creation page;
[0173] Task creation module 120 is used to create a first task in response to a task creation operation on the script task creation page;
[0174] The task information acquisition module 130 is used to obtain a first script and a first execution rule constructed for the first task in response to a configuration input operation for the first task; wherein, the first execution rule includes the execution time of the first task, as well as the execution database, execution order, reviewer information and operation and maintenance target information of the first script;
[0175] The task submission module 140 is used to report the first script and the first execution rule of the first task to the server in response to the task submission operation for the first task.
[0176] In some embodiments, such as Figure 8 As shown, the task information acquisition module 130 mentioned above may include:
[0177] The first execution rule generation unit 131 is used to generate a first execution rule for the first task in response to a rule selection operation for the first task;
[0178] The first script acquisition unit 132 is used to obtain the corresponding first script in response to the script input operation for each execution database and each operation and maintenance target information in the first execution rule.
[0179] Based on the description of the above embodiments, as Figure 8 As shown, the device may further include:
[0180] The execution result feedback module 150 is used to send execution result feedback information for the first task to the server in response to the confirmation and closing operation for the first task.
[0181] The confirmation shutdown operation is based on the execution status of each script of the first task and whether the execution result matches the corresponding operation and maintenance target information; the execution result feedback information can indicate the script provider's satisfaction with the execution result of the first task.
[0182] It should be noted that the various modules and units in the above-mentioned terminal-side device embodiments can all be stored in the memory as program modules in the terminal. The processor in the terminal executes the above-mentioned program modules stored in the memory to realize the corresponding functions. The functions realized by each program module and its combination, as well as the technical effects achieved, can be referred to the description of the corresponding part of the above-mentioned method embodiments. This embodiment will not repeat it.
[0183] This application also provides a computer-readable storage medium on which a computer program can be stored. The computer program can be called and loaded by a processor to implement the various steps of the script execution method described in the above server or terminal side embodiments. The implementation process can be referred to the description of the corresponding part of the above method embodiments, and will not be repeated in this embodiment.
[0184] Reference Figure 9 This is a schematic diagram of the hardware structure of an optional example of a computer device adapted to the script execution method proposed in this application. The computer device can be a server or a terminal. This embodiment of the application uses a server as an example for illustration. Figure 9 As shown, the computer device may include: at least one memory 1 and at least one processor 2, wherein:
[0185] The memory 1 can be used to store a first program that implements the script execution method described on the server side above; the processor 2 can be used to call and execute the first program stored in the memory 1 to implement the script execution method described on the server side.
[0186] It is understood that when the computer device is a terminal, the memory in the terminal can be used to store a second program that implements the script execution method described above on the terminal side; the processor can be used to call and execute the second program stored in the memory to implement the script execution method described on the terminal side, and the implementation process can be referred to the description of the corresponding part of the above embodiments.
[0187] In this embodiment, memory 1 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device. Processor 2 may be a central processing unit (CPU), application-specific integrated circuit (ASIC), digital signal processor (DSP), application-specific integrated circuit (ASIC), off-the-shelf programmable gate array (FPGA), or other programmable logic device.
[0188] It should be understood that, Figure 9 The structure of the computer device shown does not constitute a limitation on the computer device in the embodiments of this application. In practical applications, the computer device may include more than Figure 9 This includes more components, or combinations of certain components, such as various types of communication interfaces. And in cases where the computer device is a terminal, such as... Figure 10 As shown, it may also include at least one output device such as a display or speaker; at least one input device such as a camera, microphone, or touch sensing unit; sensor modules, power management modules, antennas, etc., which can be determined according to the type of terminal and its functional requirements, and are not listed here.
[0189] Finally, it should be noted that, regarding the above embodiments, relational terms such as "first," "second," etc., are merely used to distinguish one operation, unit, or module from another, and do not necessarily require or imply any such actual relationship or order between these units, operations, or modules. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, or system. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, or system that includes said element.
[0190] The various embodiments in this specification are described in a progressive or parallel manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to mutually. For the apparatus, system, and computer equipment disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to in the method section.
[0191] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A script execution method, characterized in that, The method includes: Obtain the first script and first execution rule constructed for the first task; wherein, the first execution rule is the script execution rule for each first script for the first script execution task, and the first execution rule includes the execution time of the first task, as well as the execution database and execution order of the first script, the reviewer information and the operation and maintenance target information, wherein the operation and maintenance target information is the purpose of script execution; Upon detecting an approval message for the first script and the first execution rule, the first task is executed according to the execution time. Establish a communication connection between the server and the execution database of the first script, and send the first script to the corresponding execution database for execution according to the execution order; If waiting nodes are configured among the multiple first scripts corresponding to the first task, the method further includes: During the execution of the first task, the corresponding execution database is controlled to execute the first script according to the execution order. If the next node to be executed in sequence is a waiting node, it is determined that the first task is in a task waiting state, the execution of the first task is stopped, and the execution status information of the first task is fed back to the script provider client for output. If a task continuation message for the first task is received from the script provider client, the system responds to the task continuation message and sends the first script, which is not currently being executed, to the corresponding execution database for execution according to the execution order. If a second script and / or a second execution rule constructed for the first task is received from the script provider client, the second script and / or the second execution rule are sent to the corresponding reviewer client; the second script is obtained by updating the first script that was not executed in the first task. Upon receiving the approval message from the reviewer's client, the first task continues to be executed according to the second execution rule, and the second script or the first script that was not executed in the first task is sent to the corresponding execution database for execution.
2. The method according to claim 1, characterized in that, The method further includes: Based on the script execution requirements, the execution process of each execution database on the corresponding first script is monitored, and corresponding monitoring results are obtained; If the monitoring results indicate that the execution database is abnormal in executing the corresponding first script, control the execution database to terminate the execution of the first script, perform a data rollback operation, and return the first task to the script provider client so that the first task enters an execution failure state.
3. The method according to any one of claims 1 to 2, characterized in that, The first execution rule also includes a task execution result notification method, and the method further includes: Check whether all scripts built for the first task are in a successful execution state; If so, in accordance with the task execution result notification method, a task execution success message for the first task is pushed to the script provider client or the script provider's preset terminal.
4. A script execution method, characterized in that, The method includes: Output the script task creation page; In response to a task creation operation on the script task creation page, a first task is created; In response to a configuration input operation for the first task, a first script and a first execution rule constructed for the first task are obtained; wherein, the first execution rule is a script execution rule for each first script of the first script execution task, and the first execution rule includes the execution time of the first task, as well as the execution database, execution order, reviewer information and operation and maintenance target information of the first script, wherein the operation and maintenance target information is the purpose of script execution; In response to the task submission operation for the first task, the first script and the first execution rule of the first task are reported to the server; If waiting nodes are configured among the multiple first scripts corresponding to the first task, the server is further configured to: During the execution of the first task, the corresponding execution database is controlled to execute the first script according to the execution order. If the next node to be executed in sequence is a waiting node, it is determined that the first task is in a task waiting state, the execution of the first task is stopped, and the execution status information of the first task is fed back to the script provider client for output. If a task continuation message for the first task is received from the script provider client, the system responds to the task continuation message and sends the first script, which is not currently being executed, to the corresponding execution database for execution according to the execution order. If a second script and / or a second execution rule constructed for the first task is received from the script provider client, the second script and / or the second execution rule are sent to the corresponding reviewer client; the second script is obtained by updating the first script that was not executed in the first task. Upon receiving the approval message from the reviewer's client, the first task continues to be executed according to the second execution rule, and the second script or the first script that was not executed in the first task is sent to the corresponding execution database for execution.
5. The method according to claim 4, characterized in that, The step of obtaining a first script and a first execution rule constructed for the first task in response to a configuration input operation for the first task includes: In response to the rule selection operation for the first task, a first execution rule for the first task is generated; In response to the script entry operation for each execution database and each operation and maintenance target information in the first execution rule, the corresponding first script is obtained.
6. The method according to claim 4 or 5, characterized in that, The method further includes: In response to the confirmation and closure operation for the first task, send the execution result feedback information for the first task to the server; The confirmation shutdown operation is based on the execution status of each script of the first task and whether the execution result matches the corresponding operation and maintenance target information; the execution result feedback information can indicate the script provider's satisfaction with the execution result of the first task.
7. A script execution device, characterized in that, The device includes: The task information acquisition module is used to acquire the first script and the first execution rule constructed for the first task; wherein, the first execution rule is the script execution rule for each first script that executes the task for the first script, and the first execution rule includes the execution time of the first task, as well as the execution database and execution order of the first script, the reviewer information and the operation and maintenance target information, wherein the operation and maintenance target information is the purpose of script execution; The task execution module is used to detect the approval message for the first script and the first execution rule, and execute the first task according to the execution time; The script execution module is used to establish a communication connection between the server and the execution database of the first script, and to send the first script to the corresponding execution database for execution according to the execution order; If waiting nodes are configured among the multiple first scripts corresponding to the first task, the device is further configured to: During the execution of the first task, the corresponding execution database is controlled to execute the first script according to the execution order. If the next node to be executed in sequence is a waiting node, it is determined that the first task is in a task waiting state, the execution of the first task is stopped, and the execution status information of the first task is fed back to the script provider client for output. If a task continuation message for the first task is received from the script provider client, the system responds to the task continuation message and sends the first script, which is not currently being executed, to the corresponding execution database for execution according to the execution order. If a second script and / or a second execution rule constructed for the first task is received from the script provider client, the second script and / or the second execution rule are sent to the corresponding reviewer client; the second script is obtained by updating the first script that was not executed in the first task. Upon receiving the approval message from the reviewer's client, the first task continues to be executed according to the second execution rule, and the second script or the first script that was not executed in the first task is sent to the corresponding execution database for execution.
8. A script execution device, characterized in that, The device includes: The output module is used to output the script task creation page; The task creation module is used to create a first task in response to a task creation operation on the script task creation page; The task information acquisition module is used to obtain a first script and a first execution rule constructed for the first task in response to a configuration input operation for the first task; wherein, the first execution rule is the script execution rule for each first script that executes the task for the first script, and the first execution rule includes the execution time of the first task, as well as the execution database, execution order, reviewer information and operation and maintenance target information of the first script, wherein the operation and maintenance target information is the purpose of script execution; The task submission module is used to respond to the task submission operation for the first task by reporting the first script and the first execution rule of the first task to the server. If waiting nodes are configured among the multiple first scripts corresponding to the first task, the server is further configured to: During the execution of the first task, the corresponding execution database is controlled to execute the first script according to the execution order. If the next node to be executed in sequence is a waiting node, it is determined that the first task is in a task waiting state, the execution of the first task is stopped, and the execution status information of the first task is fed back to the script provider client for output. If a task continuation message for the first task is received from the script provider client, the system responds to the task continuation message and sends the first script, which is not currently being executed, to the corresponding execution database for execution according to the execution order. If a second script and / or a second execution rule constructed for the first task is received from the script provider client, the second script and / or the second execution rule are sent to the corresponding reviewer client; the second script is obtained by updating the first script that was not executed in the first task. Upon receiving the approval message from the reviewer's client, the first task continues to be executed according to the second execution rule, and the second script or the first script that was not executed in the first task is sent to the corresponding execution database for execution.
9. A computer device, characterized in that, The computer device includes: The memory is used to store a first program that implements the script execution method as described in any one of claims 1 to 3, or to store a second program that implements the script execution method as described in any one of claims 4 to 6; A processor is configured to invoke and execute a first program stored in the memory to implement the script execution method as described in any one of claims 1 to 3; or to invoke and execute a second program stored in the memory to implement the script execution method as described in any one of claims 4 to 6.
Citation Information
Patent Citations
Tool integrated automation realization and deployment method
CN107678802A
Database script management method, device, computer device, and storage medium
CN109308285A