Script management method, device and equipment and computer readable storage medium

By receiving and auditing database script requests and associating scripts with projects based on configuration information, the problem of inefficient script management in multi-customer and multi-version environments is solved, and efficient and accurate script management is achieved.

CN119512612APending Publication Date: 2025-02-25SHENZHEN KAIFA TECH (CHENGDU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411469801.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In multi-customer and multi-version environments, database script management relies on manual operations, which is prone to problems such as version mismatch and script conflicts, resulting in inefficient management.

Method used

By receiving script audit requests, performing security verification, and associating scripts to be reviewed and items to be executed based on configuration information, setting the script to be executable. If an execution request for the target project is received, the script associated with the target project is queried and the target script is executed.

Benefits of technology

It effectively reduces the workload of matching scripts with projects, improves the efficiency and accuracy of script management, avoids the wrong execution of mismatched scripts, and enhances the flexibility of script management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512612A_ABST
    Figure CN119512612A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a script management method, device and equipment and a computer readable storage medium, and relates to the technical field of computers. The method comprises the following steps: receiving a script auditing request of a script to be audited; wherein the script auditing request comprises configuration information used for representing a to-be-executed item associated with a to-be-audited script; if the to-be-audited script is successfully subjected to security verification, associating the to-be-audited script with the to-be-executed item based on the configuration information in response to the script auditing request, and setting the to-be-audited script to be in an executable state; if an execution request for a target item in the items to be executed is received, querying a script associated with the target item; and executing a target script selected from the scripts associated with the target item. Through the method, the script management efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a script management method, apparatus, device and computer-readable storage medium. Background Art

[0002] In modern software development, database script management is a key link, especially in a multi-client and multi-version environment, where multiple versions of database scripts need to be maintained.

[0003] In related technologies, script management often relies on manual operations by staff, which is prone to errors such as version mismatch, script conflicts, etc. It is difficult to meet the needs of rapid iteration and efficient operation and maintenance, resulting in inefficient script management.

[0004] Therefore, how to improve the efficiency of script management is an urgent problem to be solved. Summary of the invention

[0005] To solve the above technical problems, embodiments of the present application provide a script management method, apparatus, device, and computer-readable storage medium.

[0006] Among them, the technical solution adopted in this application is:

[0007] A script management method, comprising:

[0008] Receive a script review request for a script to be reviewed; wherein the script review request includes configuration information for characterizing a to-be-executed project associated with the script to be reviewed;

[0009] If the security check of the script to be reviewed is successful, in response to the script review request, the script to be reviewed is associated with the project to be executed based on the configuration information, and the script to be reviewed is set to an executable state;

[0010] If an execution request for a target project among the projects to be executed is received, querying a script associated with the target project;

[0011] A target script selected from the scripts associated with the target item is executed.

[0012] A script management device, comprising:

[0013] A transceiver unit, configured to receive a script review request for a script to be reviewed; wherein the script review request includes configuration information for representing a to-be-executed project associated with the script to be reviewed;

[0014] a processing unit, configured to, if the security check of the script to be reviewed is successful, in response to the script review request, associate the script to be reviewed with the project to be executed based on the configuration information, and set the script to be reviewed to an executable state;

[0015] A query unit, configured to query a script associated with a target project in the project to be executed if an execution request is received;

[0016] The processing unit is further configured to execute a target script selected from the scripts associated with the target project.

[0017] In one embodiment of the present application, based on the aforementioned scheme, the configuration information includes the target version number of the project to be executed; the query unit is also used to query the target project to be executed that matches the target version number from the project to be executed in response to the script review request; the processing unit is also used to associate the target project to be executed with the script to be reviewed.

[0018] In one embodiment of the present application, based on the aforementioned scheme, the processing unit is also used to detect the target database type corresponding to the target project; convert the script syntax of the target script based on the target database type to obtain an updated target script; and execute the updated target script.

[0019] In one embodiment of the present application, based on the aforementioned solution, the processing unit is further used to convert the script syntax of the target script into the syntax corresponding to the target database type if the script syntax of the target script does not match the syntax corresponding to the target database type, so as to obtain the updated target script.

[0020] In one embodiment of the present application, based on the aforementioned scheme, the processing unit is also used to detect the project type of the target project; if the project type of the target project is a general project type, the script syntax of the target script is converted into a specified syntax to obtain the updated target script.

[0021] In one embodiment of the present application, based on the aforementioned scheme, after receiving the script audit request for the script to be audited, the processing unit is also used to parse the script content contained in the script to be audited to obtain multiple verification statements; identify the statement type corresponding to each verification statement; and output the multiple verification statements and the statement type corresponding to each verification statement to the auditor, so that the auditor performs a security verification on the script to be audited based on the multiple verification statements and the statement type corresponding to each verification statement.

[0022] In one embodiment of the present application, based on the aforementioned scheme, after executing the target script selected from the scripts associated with the target project, the device also includes an acquisition unit for acquiring multiple target verification statements corresponding to the target script; the processing unit is also used to add target verification statements belonging to the same statement type to the storage area corresponding to the same statement type; if there are multiple verification statements represented as processing the same data table in the storage area corresponding to the same statement type, the multiple verification statements represented as processing the same data table are merged; wherein, the same data table is located in the target database corresponding to the target project.

[0023] A script management device includes a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the above script management method is implemented.

[0024] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor of a computer, enable the computer to execute the script management method as described above.

[0025] A computer program product includes computer-readable instructions, and when the computer-readable instructions are executed by a processor, the script management method described above is implemented.

[0026] In the above technical solution:

[0027] After receiving a script audit request for a script to be audited, a security check can be performed on the script to be audited. The script audit request includes configuration information for characterizing the project to be executed associated with the script to be audited. In this way, if the script to be audited is successfully verified, the script to be audited can be associated with the project to be executed based on the configuration information, and the script to be audited can be set to an executable state. In this way, if an execution request for a target project in the project to be executed is received later, the script associated with the target project can be queried, and the target script selected from the scripts associated with the target project can be executed.

[0028] First, this method pre-associates each script with each project to be executed, and each script is explicitly bound to a project. This can effectively reduce the workload of matching scripts with projects when the script is executed later, improve the efficiency of script management, and avoid repeated operations.

[0029] Secondly, during the execution phase, the script associated with the project will be automatically queried based on the execution request of the target project to ensure that each project executes the corresponding script, thereby ensuring the accuracy of the script, avoiding the erroneous execution of mismatched scripts, and improving the accuracy of script management.

[0030] Finally, after querying the scripts associated with the target project, you can flexibly select the target script to be executed. This allows you to select the appropriate script to meet different testing requirements or project stages, thereby improving the flexibility of script management.

[0031] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0033] Figure 1 It is a schematic diagram of an implementation environment involved in this application;

[0034] Figure 2 is a flowchart of a script management method according to an exemplary embodiment;

[0035] Figure 3 is a flowchart of a script management method according to another exemplary embodiment

[0036] Figure 4 is a flowchart of a script management method according to another exemplary embodiment;

[0037] Figure 5 is a flowchart of a script management method according to another exemplary embodiment;

[0038] Figure 6 is a block diagram of a script management device according to an exemplary embodiment;

[0039] Figure 7 The diagram is a structural diagram of a computer system of a script management device according to an exemplary embodiment. DETAILED DESCRIPTION

[0040] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments that are the same as the present application. Instead, they are only examples of devices and methods that are the same as some aspects of the present application as detailed in the attached claims.

[0041] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0042] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, while some operations / steps can be integrated or partially integrated, so the actual execution order may change according to actual conditions.

[0043] It should be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.

[0044] It should be noted that in the specific implementation of the present application, when the user-related data is involved, when the embodiment of the present application is applied to a specific product or technology, the user's permission or consent is required, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. At the same time, the formulas involved in the embodiments of the present application can be flexibly adjusted, such as increasing or decreasing the corresponding parameters.

[0045] See also Figure 1 , Figure 1 It is a schematic diagram of an implementation environment involved in this application.

[0046] Figure 1 The implementation environment shown includes a script management platform 110 , a developer 120 , an auditor 130 , and a tester 140 .

[0047] The script management platform 110 is a platform for script management and processing. It can be responsible for receiving the script to be reviewed 150 submitted by the developer 120 and providing a series of automated functions, such as parsing the script to be reviewed 150 into multiple verification statements, instructing the auditor 130 to perform security verification on the script to be reviewed 150 through the multiple verification statements, and setting the script to be reviewed 150 to an executable state when the review is passed. The script management platform 110 provides a centralized interface for the developer 120, the auditor 130, and the tester, ensuring that the entire process of script management from creation to execution is performed on the same platform.

[0048] The developer 120 refers to the creator or development team of the script, who is responsible for writing scripts related to the project and submitting these scripts to the script management platform 110, so that the script management platform 110 can instruct the auditor 130 to perform security verification on the script. The developer 120 will send the script to be reviewed 150 to the script management platform 110. After receiving the script to be reviewed 150, the script management platform 110 will associate the script to be reviewed 150 with the project to be executed, and ensure the association relationship between the script to be reviewed 150 and the corresponding project to be executed.

[0049] The auditor 130 is responsible for auditing the script 150 to be audited submitted by the developer 120 to the script management platform 110 to ensure that the script content is safe, standardized and applicable to the target project. The script management platform 110 will parse the script 150 to be audited into multiple verification statements, identify the statement type of each verification statement, and send them together to the auditor 130. These verification statements can help the auditor 130 verify whether the operations corresponding to the script 150 to be audited are legal and safe one by one. If the auditor 130 confirms that the content of the script 150 to be audited is correct and has passed the security check, the script management platform 110 will set the script to an executable state.

[0050] The test party 140 is the party responsible for project testing, and usually initiates an execution request through the script management platform 110 when the project enters the testing phase. When the test party 140 enters the number or identifier of a target project, the script management platform 110 will automatically query the scripts associated with the target project and display all scripts applicable to the target project. The test party 140 can select one or more target scripts to be executed from these scripts, and then the script management platform 110 will perform syntax conversion on the script according to the database type corresponding to the target project to ensure that it is compatible with the target database. Afterwards, the script management platform 110 is responsible for executing the selected target script and recording the execution results for subsequent archiving. In this way, the test party 140 can effectively perform project testing and ensure the normal execution of scripts in different environments.

[0051] In this implementation environment, all parties involved can communicate and collaborate efficiently through the script management platform 110. The R&D party 120 focuses on developing and submitting scripts, the review party 130 is responsible for verifying the compliance and security of the scripts, and the test party 140 can easily select and execute scripts for testing. In this process, the script management platform 110 not only provides script parsing and automated verification functions, but also manages key steps such as the association between scripts and projects, execution log recording, and script archiving, ensuring that the entire process is secure, transparent, and easy to track. Through such an environment, the efficiency of script management can be greatly improved, and the accuracy and compliance of script execution can be guaranteed.

[0052] In the present application, the R&D party 120, the review party 130 and the test party 140 may be terminal devices, and the terminal devices may be mobile phones, desktop computers, laptop computers, etc.

[0053] Optionally, the terminal device may also be a mobile internet device (MID), a vehicle-mounted device, an aircraft, a wearable device (smart devices such as smart watches, smart bracelets, pedometers, etc.), a virtual reality device (such as a virtual reality (VR) device, an augmented reality (AR) device), and the like.

[0054] Optionally, the script management platform 110 in the embodiment of the present application can be a server, which can refer to an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0055] See also Figure 2 , Figure 2 is a flowchart of a script management method according to an exemplary embodiment. The method can be applied to Figure 1 The implementation environment shown is specifically executed by the script management platform 110. Of course, the method can also be applied to other implementation environments, and the execution subject of the method is not limited here.

[0056] The script management method will be described in detail below using the script management platform 110 as an exemplary execution subject. Figure 2 As shown, in an exemplary embodiment, the method comprises at least the following steps:

[0057] S210: Receive a script review request for a script to be reviewed; wherein the script review request includes configuration information for representing a to-be-executed project associated with the script to be reviewed.

[0058] The script review request for the script to be reviewed may be sent by the developer. Specifically, the developer may operate on his / her terminal device to create a script as the script to be reviewed. Next, the developer uses the terminal device to access the script management platform and fills in the configuration information corresponding to the script to be reviewed in the specified page provided by the script management platform.

[0059] The configuration information may at least include supported project information, version numbers corresponding to supported projects, description information and script file content. Among them, the supported project information can indicate which project the script to be reviewed supports. The version number corresponding to the supported project can indicate the version corresponding to the project, wherein the version number can be expressed in the form of V (Version) and a number, such as V4.5.0, V4.5.2, etc. The description information can be content filled in by the R&D party for custom description, and can also be called remarks information. The script file content is the script content corresponding to the script to be reviewed.

[0060] Since the configuration information corresponding to the script to be reviewed includes the project information it supports and the version number of the supported project, the project to be executed associated with the script to be reviewed can be represented. The project to be executed is the project supported by the script to be reviewed, which means that the script to be reviewed can be used to execute the project to be executed.

[0061] After the developer has filled in the configuration information of the script to be reviewed on the specified page, he can click Submit to generate the script review request and send it to the script management platform. When the script to be reviewed is successfully submitted, the script management platform will set the status of the script to be reviewed to "Awaiting Review Status".

[0062] S220: If the security check of the script to be reviewed is successful, in response to the script review request, the script to be reviewed is associated with the project to be executed based on the configuration information, and the script to be reviewed is set to an executable state.

[0063] In one embodiment of the present application, after receiving a script review request for a script to be reviewed, the script management platform will verify the syntax of the script to be reviewed based on the target database type corresponding to the project to be executed supported by the script to be reviewed, so as to detect whether the script syntax of the script to be reviewed matches the syntax corresponding to the target database type.

[0064] In one embodiment of the present application, after receiving a script review request for a script to be reviewed, the script management platform will automatically parse the script content contained in the script to be reviewed to obtain multiple verification statements, wherein the verification statements may be structured query language (SQL) statements.

[0065] Furthermore, the script management platform will also identify the statement type corresponding to each verification statement. Among them, the statement type can include multiple types, such as DDL (data definition language) type and DML (data manipulation language) type. Among them, the DDL type can be used to define or modify the database structure, including statements for creating, modifying and deleting database objects, such as tables, indexes, views, etc. The DML type can be used to operate on data, such as inserting, updating, deleting and querying data.

[0066] After the script management platform identifies the statement type of each verification statement, it can output multiple verification statements and the statement type corresponding to each verification statement to the auditor, so that the auditor can perform security verification on the audit script based on the multiple verification statements and the statement type corresponding to each verification statement. By providing verification statements and their types, the auditor can more clearly understand the meaning of the script content of each part of the audit script, so as to verify the security of the script. The auditor can make different audit strategies based on different statement types (such as DDL to modify table structure, DML to operate data) to ensure the security and stability of the script.

[0067] Next, if the auditor successfully performs security verification on the script to be audited, the script management platform can respond to the script audit request, associate the script to be audited with the project to be executed based on the configuration information, and set the script to be audited to an executable state.

[0068] The configuration information includes the target version number of the to-be-executed project. In response to the script review request, the script management platform can query the to-be-executed project for a target to-be-executed project that matches the target version number from the to-be-executed project, and associate the target to-be-executed project with the to-be-reviewed script.

[0069] It should be noted that in the embodiment of the present application, there may be multiple scripts to be reviewed, and when the script to be reviewed passes the verification, it can be used as an executable script. In this way, in the script management platform, a corresponding project list can be defined for all the projects to be executed.

[0070] In an embodiment of the present application, the project list may include the following fields: project code (ProjectCode), project version (Version), and supported projects (Contain Project Code).

[0071] For example, the configuration information for project number ProjectA is as follows:

[0072] Project Code: ProjectA, Version: 4.5.0, Contain Project Code: ProjectA

[0073] Project Code: ProjectA, Version: 4.5.0, Contain Project Code: Common

[0074] In the above configuration information, the Contain Project Code field and the Version field can represent a script. The script in the first line supports ProjectA of version 4.5.0, so its corresponding Project Code is also ProjectA. Similarly, the script in the second line indicates support for Common projects of version 4.5.0, where Common represents a common productized project type that can be supported by any project. ProjectA is also a type of Common project, so ProjectA can also be supported.

[0075] It can be seen that the configuration information represents the project numbered ProjectA, and the script version at this time supports ProjectA 4.5.0 and general projects 4.5.0.

[0076] S230: If an execution request for a target project among the projects to be executed is received, query a script associated with the target project.

[0077] There may be multiple projects to be executed. The tester may also use his own terminal device to access the script management platform, so as to execute the projects to be executed.

[0078] Specifically, the tester needs to enter the project number corresponding to the project he needs to execute in the page provided by the script management platform to determine the target project. The target project can be any one of the multiple projects to be executed. For example, you can enter ProjectA, which means that the project numbered ProjectA needs to be executed. Next, the tester can click Submit to generate an execution request for the target project in the project to be executed and send it to the script management platform.

[0079] Optionally, when the project number input by the tester does not exist, or the target project corresponding to the project number does not have an associated step, a prompt message may be output to the tester.

[0080] The script management platform can query the scripts associated with the target project. The target project may correspond to multiple versions, and the script management platform will also query the scripts associated with the target project under each version. For example, if ProjectA contains three versions: 4.5.0, 4.5.1, and 4.5.2, the script management platform will query the scripts associated with ProjectA when it is 4.5.0, and will also query the scripts associated with versions 4.5.1 and 4.5.2, and each associated script is in an executable state. Based on the query results, the script management platform organizes all eligible scripts into an executable script list and displays it to the tester.

[0081] Optionally, when querying the scripts associated with the target project, the script management platform can only add the scripts that have not been executed in the target project to the executable script list, so that repeated execution of a script can be avoided.

[0082] S240: Execute a target script selected from scripts associated with the target project.

[0083] In one embodiment of the present application, the tester needs to select a target script from the executable script list provided by the script management platform, and then click an execute button to start the script running to complete the execution of the target project.

[0084] The tester can select one or more target scripts from the executable script list for execution according to different requirements.

[0085] Through this method, after receiving a script review request for a script to be reviewed, the script management platform can perform a security check on the script to be reviewed. The script review request contains configuration information for characterizing the project to be executed associated with the script to be reviewed. In this way, if the script to be reviewed is successfully verified, the script to be reviewed can be associated with the project to be executed based on the configuration information, and the script to be reviewed can be set to an executable state. In this way, if an execution request for a target project in the project to be executed is received later, the script associated with the target project can be queried, and the target script selected from the scripts associated with the target project can be executed.

[0086] First, this method pre-associates each script with each project to be executed, and each script is explicitly bound to a project. This can effectively reduce the workload of matching scripts with projects when the script is executed later, improve the efficiency of script management, and avoid repeated operations.

[0087] Secondly, during the execution phase, the script associated with the project will be automatically queried based on the execution request of the target project to ensure that each project executes the corresponding script, thereby ensuring the accuracy of the script, avoiding the erroneous execution of mismatched scripts, and improving the accuracy of script management.

[0088] Finally, after querying the scripts associated with the target project, you can flexibly select the target script to be executed. This allows you to select the appropriate script to meet different testing requirements or project stages, thereby improving the flexibility of script management.

[0089] In one embodiment of the present application, another script management method is provided, which can be executed by a script management platform. Figure 3 As shown, the script management method may include S210, S310 to S330 and S230 to S240. That is, S310 to S330 are Figure 2 The specific implementation method corresponding to S220 shown.

[0090] S310 to S330 are described below:

[0091] S310: If the security check of the script to be reviewed is successful, in response to the script review request, a target to-be-executed project that matches the target version number is searched from the to-be-executed projects.

[0092] When the security verification of the script to be reviewed is successful, the script management platform can quickly locate the corresponding target project to be executed according to the target version number specified in the configuration information. In other words, the project to be executed may have one or more version numbers, and the current script to be reviewed needs to be associated with the project to be executed belonging to the target version number, so as to accurately connect the target project to be executed with the script that has passed the review, ensuring version matching and execution efficiency.

[0093] S320, associating the target project to be executed with the script to be reviewed.

[0094] When establishing an association relationship, the script management platform can fill in the information of the target projects to be executed and the scripts to be reviewed into the project list.

[0095] S330: Set the script to be reviewed to an executable state.

[0096] The scripts that are in the executable state and awaiting review have passed the security check and can be executed normally.

[0097] Through this method, the script management platform can associate the script to be audited with the corresponding version of the pending project (i.e., the target pending project) after the security verification of the script to be audited is successful, and the association relationship is pre-set, so that the supported project can be quickly located according to the known script in the future, and the corresponding script can be quickly located according to the known project number and version number, thereby realizing efficient management between scripts and projects, reducing the workload of manual intervention, realizing automated management of scripts, and improving the efficiency of script management.

[0098] In one embodiment of the present application, another script management method is provided, which can be executed by a script management platform. Figure 4 As shown, the script management method may include S210 to S230 and S410 to S430. That is, S410 to S430 are Figure 2 The specific implementation method of S240 is shown.

[0099] S410 to S430 are described below:

[0100] S410: Detect the target database type corresponding to the target project.

[0101] Each target project will correspond to its own database. The script management platform will detect the database type of each target project and obtain the target database type to ensure that the script can interact smoothly with the target project database.

[0102] S420: Convert the script syntax of the target script based on the target database type to obtain an updated target script.

[0103] In one embodiment of the present application, if the script syntax of the target script does not match the syntax corresponding to the target database type, the script syntax of the target script is converted into the syntax corresponding to the target database type to obtain an updated target script.

[0104] Each target project may use a different database system (such as MySQL, PostgreSQL, Oracle, etc.), and the SQL syntax of these database systems is different. In order to ensure that the target script can be executed correctly, the script management platform needs to adapt the syntax of the script according to the detected target database type.

[0105] Specifically, if the syntax of the target script does not match the syntax corresponding to the target database type used by the target project, the script management platform will automatically convert the syntax of the target script to the syntax supported by the target database type. For example, some databases use different syntax or keywords when processing data types, table structures, or function calls, so they need to be adjusted before execution. By converting the original script syntax to the standard syntax of the target database, the script management platform can generate an updated target script.

[0106] In one embodiment of the present application, the script management platform can also detect the project type of the target project. If the project type of the target project is a common project type, the script syntax of the target script is converted into a specified syntax to obtain an updated target script. The common project type is the aforementioned Common project type. In the case where the target project is a Common project, the script management platform needs to convert the script syntax of the target script into a syntax that conforms to the Common project type, and the specified syntax can be PostgreSQL syntax.

[0107] S430: Execute the updated target script.

[0108] In this way, the updated target script can be converted into appropriate syntax so that it can be accurately executed in each target database, avoiding execution errors caused by syntax incompatibility and improving the stability and efficiency of script execution.

[0109] By converting the script syntax of the target script into the specified syntax, the script management platform can ensure that the target script can be smoothly applied in multiple project environments without the need for tedious manual adjustments based on different target database types. This not only improves the applicability of the script in multiple projects, but also reduces the complexity of maintenance and management, and improves the efficiency of script management.

[0110] In one embodiment of the present application, another script management method is provided, which can be executed by a script management platform. Figure 5 As shown, the script management method may include S210 to S240 and S510 to S530. That is, S510 to S530 are Figure 2 The steps to be performed after S240 are shown.

[0111] S510 to S530 are described below:

[0112] S510: Obtain multiple target verification statements corresponding to the target script.

[0113] The target script is created by the developer, so when the developer submits the target script to the script management platform, the script management platform will parse it to obtain multiple target verification statements. The multiple target verification statements may include target verification statements of different statement types, such as DDL type and DML type.

[0114] S520: Add statements belonging to the same statement type to the storage area corresponding to the same statement type.

[0115] For ease of management, the script management platform will put validation statements of the same statement type into the corresponding storage area. Each statement type (such as DDL or DML) has its own storage area, and the script management platform will classify and store multiple validation statements of the target script into the corresponding area. For example, all DDL statements will be stored in one storage area, and all DML statements will be stored in another storage area. In this way, it can be ensured that each statement is archived in order according to its functional type, which is convenient for subsequent query, analysis and archiving.

[0116] The benefit of this classification is that it facilitates auditing and review. When managers need to review the execution history or results of a script, they can quickly find relevant execution records based on the statement type. In addition, by separating the script content by type, the platform can clearly show which statements affect the database structure (DDL) and which statements modify the data (DML).

[0117] S530. If there are multiple verification statements for processing the same data table in the storage area corresponding to the same statement type, merge the multiple verification statements for processing the same data table; wherein the same data table is located in the target database corresponding to the target project.

[0118] During script execution, there may be multiple validation statements that all involve operations on the same data table. For example, different DML statements may modify different data rows in the same data table. To simplify storage and management, the script management platform will detect these validation statements. If multiple validation statements that represent processing on the same data table are found in the storage area of ​​the same statement type, the platform will merge these statements.

[0119] The merge operation does not directly merge the statements themselves, but puts these statements involving the same data table together and organizes them into a common file. For example, if multiple insert operations on the same table are recorded in different statements, after merging, managers can see all the modification details of the table in one file, making the audit process more efficient, and also facilitating tracking data changes and troubleshooting potential problems. In addition, this merge mechanism can also reduce storage space usage and avoid inefficient management caused by too scattered verification statements.

[0120] Optionally, when archiving scripts, the script management platform will archive them in order of execution time by the tester.

[0121] Optionally, during the script execution process, the script management platform will record the audit log of each script, which will include the submitter, description information, executor, execution time and execution details, etc. Through such audit records, managers can track the execution of the script at any time and understand the execution results in detail.

[0122] In addition, the script audit log may also include the execution status of the script in each target project, such as execution success, execution failure, reasons for failure, and other information.

[0123] Furthermore, you can search for information about projects and scripts that have been executed in a certain period of time based on the execution time range.

[0124] Furthermore, the script with execution problems can be found based on whether there is an execution error;

[0125] Furthermore, all execution records of the executor can be found according to the executor.

[0126] Optionally, administrators of the script management platform can download archived scripts and audit logs at any time to facilitate future review and inspection, ensuring transparency and traceability of all script executions.

[0127] This method can greatly improve the efficiency of script management, reduce the probability of human errors, and ensure data consistency and accuracy. At the same time, the detailed records of script execution and audit logs make any operation on the database have clear traces, ensuring the reliability of script management.

[0128] Figure 6 FIG. 1 is a block diagram of a script management device according to an embodiment of the present application. Figure 6 As shown, the script management device can be applied to a script management platform, and the device includes:

[0129] A script management device, comprising:

[0130] The transceiver unit 610 is used to receive a script review request for a script to be reviewed; wherein the script review request includes configuration information for representing a to-be-executed project associated with the script to be reviewed;

[0131] The processing unit 620 is used for associating the script to be reviewed with the project to be executed based on the configuration information in response to the script review request if the security check of the script to be reviewed is successful, and setting the script to be reviewed to an executable state;

[0132] A query unit 630, configured to query a script associated with a target project among the projects to be executed if an execution request for the target project is received;

[0133] The processing unit 620 is further configured to execute a target script selected from the scripts associated with the target project.

[0134] In one embodiment of the present application, based on the aforementioned scheme, the configuration information includes a target version number of the project to be executed; the query unit 630 is also used to query the target project to be executed that matches the target version number from the project to be executed in response to a script review request; the processing unit 620 is also used to associate the target project to be executed with the script to be reviewed.

[0135] In one embodiment of the present application, based on the aforementioned scheme, the processing unit 620 is further used to detect the target database type corresponding to the target project; convert the script syntax of the target script based on the target database type to obtain an updated target script; and execute the updated target script.

[0136] In one embodiment of the present application, based on the above-mentioned solution, the processing unit 620 is further used to convert the script syntax of the target script into the syntax corresponding to the target database type if the script syntax of the target script does not match the syntax corresponding to the target database type, so as to obtain an updated target script.

[0137] In one embodiment of the present application, based on the aforementioned solution, the processing unit 620 is also used to detect the project type of the target project; if the project type of the target project is a general project type, the script syntax of the target script is converted into a specified syntax to obtain an updated target script.

[0138] In one embodiment of the present application, based on the aforementioned scheme, after receiving a script audit request for the script to be audited, the processing unit 620 is also used to parse the script content contained in the script to be audited to obtain multiple verification statements; identify the statement type corresponding to each verification statement; and output the multiple verification statements and the statement type corresponding to each verification statement to the auditor, so that the auditor can perform a security check on the script to be audited based on the multiple verification statements and the statement type corresponding to each verification statement.

[0139] In one embodiment of the present application, based on the aforementioned scheme, after executing the target script selected from the scripts associated with the target project, the device also includes an acquisition unit 640 for acquiring multiple target verification statements corresponding to the target script; the processing unit 620 is also used to add target verification statements belonging to the same statement type to the storage area corresponding to the same statement type; if there are multiple verification statements represented as processing the same data table in the storage area corresponding to the same statement type, the multiple verification statements represented as processing the same data table are merged; wherein the same data table is located in the target database corresponding to the target project.

[0140] It should be noted that the apparatus provided in the aforementioned embodiment and the method provided in the aforementioned embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment.

[0141] An embodiment of the present application also provides a script management device, including: one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the above script management method.

[0142] Figure 7 It is a structural diagram of a computer system suitable for implementing the script management device of the embodiment of the present application.

[0143] It should be noted that Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0144] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703, such as executing the method in the above embodiment. In the RAM 703, various programs and data required for system operation are also stored. The CPU 701, ROM 702 and RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0145] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.

[0146] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.

[0147] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable media may be, for example, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0148] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0149] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0150] Another aspect of the present application also provides a computer readable medium having a computer program stored thereon, which implements the script management method as described above when the computer program is executed by a processor. The computer readable medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0151] Another aspect of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable medium. A processor of a computer device reads the computer instructions from the computer-readable medium, and the processor executes the computer instructions, so that the computer device executes the script management method provided in each of the above embodiments.

[0152] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A script management method, characterized in that: include: Receive a script review request for a script to be reviewed; wherein the script review request includes configuration information for characterizing a to-be-executed project associated with the script to be reviewed; If the security check of the script to be reviewed is successful, in response to the script review request, the script to be reviewed is associated with the project to be executed based on the configuration information, and the script to be reviewed is set to an executable state; If an execution request for a target project among the projects to be executed is received, querying a script associated with the target project; A target script selected from the scripts associated with the target item is executed.

2. The method according to claim 1, characterized in that: The configuration information includes the target version number of the project to be executed; The step of associating the script to be reviewed with the project to be executed based on the configuration information in response to the script review request includes: In response to the script review request, querying the target to-be-executed project matching the target version number from the to-be-executed projects; The target to-be-executed project is associated with the to-be-audited script.

3. The method according to claim 1, characterized in that The executing of the target script selected from the scripts associated with the target project includes: Detecting the target database type corresponding to the target project; Convert the script syntax of the target script based on the target database type to obtain an updated target script; The updated target script is executed.

4. The method according to claim 3, characterized in that The converting the script syntax of the target script based on the target database type to obtain an updated target script includes: If the script syntax of the target script does not match the syntax corresponding to the target database type, the script syntax of the target script is converted into the syntax corresponding to the target database type to obtain the updated target script.

5. The method according to claim 3, characterized in that: The converting the script syntax of the target script based on the target database type to obtain an updated target script includes: Detecting the project type of the target project; If the project type of the target project is a general project type, the script syntax of the target script is converted into a specified syntax to obtain the updated target script.

6. The method according to claim 1, characterized in that After receiving the script audit request for the script to be audited, the method further includes: Parsing the script content contained in the script to be reviewed to obtain multiple verification statements; Identify the statement type corresponding to each validation statement; The multiple verification statements and the statement type corresponding to each verification statement are output to the auditor, so that the auditor performs security verification on the script to be audited based on the multiple verification statements and the statement type corresponding to each verification statement.

7. The method according to claim 6, characterized in that After executing the target script selected from the scripts associated with the target project, the method further includes: Obtaining multiple target verification statements corresponding to the target script; Adding target verification statements belonging to the same statement type to the storage area corresponding to the same statement type; If there are multiple verification statements representing processing of the same data table in the storage area corresponding to the same statement type, the multiple verification statements representing processing of the same data table are merged; wherein the same data table is located in the target database corresponding to the target project.

8. A script management device, characterized in that: include: A transceiver unit, configured to receive a script review request for a script to be reviewed; wherein the script review request includes configuration information for representing a to-be-executed project associated with the script to be reviewed; A processing unit, configured to, if the security check of the script to be reviewed is successful, in response to the script review request, associate the script to be reviewed with the project to be executed based on the configuration information, and set the script to be reviewed to an executable state; A query unit, configured to query a script associated with a target project in the project to be executed if an execution request is received; The processing unit is further configured to execute a target script selected from the scripts associated with the target project.

9. A script management device, characterized in that: include: a memory storing computer-readable instructions; A processor reads the computer readable instructions stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 7.