Script development control method and device, computer device and storage medium
Patent Information
- Application Number
- CN202111392750.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-23
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2041-11-23
AI Technical Summary
但是传统的巡检方式主要是通过审核人员分析脚本的测试报告,确定审核结果,通常耗时较长,审核速度慢、规范性差,对审核人员的专业要求较高,不能满足生产一线的快速迭代需求
[0047]上述脚本开发的控制方法、装置、计算机设备和存储介质,所述脚本开发的控制方法,对待审核脚本进行自动测试,得到测试报告,基于已训练的风险分类模型,确定待审核脚本的命令风险评分,再根据测试脚本的类别、脚本测试报告和命令风险评分,得到目标风险评分,基于目标风险评分和类别对待审核脚本进行审核,并在审核通过后发布。脚本开发的控制方法提出了从脚本测试、审核和发布的规范化流程,可以提升脚本开发的效率,自动检测待审核脚本,所述目标风险评分包括多个维度的风险评分,降低了高风险脚本引入生产环境的概率,保证了脚本质量。
Smart Images

Figure CN114064498B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer application technology, and in particular to control methods, apparatus, computer equipment and storage media for script development. Background Technology
[0002] Data centers need to perform routine inspections to ensure scripts function correctly across numerous servers. With the widespread adoption of cloud services, the number of servers has multiplied, and a single script may be used on hundreds or even thousands of servers. Inspections play a crucial role in ensuring the proper functioning of these scripts. However, traditional inspection methods primarily rely on auditors analyzing script test reports to determine the audit results. This process is typically time-consuming, slow, lacks standardization, and requires highly specialized expertise from auditors, failing to meet the rapid iteration needs of production lines. Summary of the Invention
[0003] Therefore, it is necessary to provide standardized processes for script testing, review, and release to address the aforementioned technical issues, thereby improving the efficiency and quality of script development, as well as control methods, devices, computer equipment, and storage media for script development.
[0004] Firstly, this application provides a control method for script development. The method includes:
[0005] Obtain the script to be reviewed and test the script to be reviewed to obtain a script test report;
[0006] Based on the script to be reviewed and the trained risk classification model, determine the command risk score of the script to be reviewed;
[0007] Obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report, and the command risk score;
[0008] The script to be reviewed is reviewed based on the category and the target risk score, and is released after the review is passed.
[0009] In one embodiment, determining the command risk score of the script to be reviewed based on the script to be reviewed and the trained risk classification model includes:
[0010] The script to be reviewed is segmented into words to obtain multiple word vectors to be processed;
[0011] The multiple word vectors to be processed are input into the trained risk classification model to obtain the command risk category;
[0012] Select a command risk score that matches the command risk category.
[0013] In one embodiment, the script test report includes: inspection time, execution time, detection results, and server performance curve; determining the target risk score based on the category, the script test report, and the command risk score includes:
[0014] Based on the category and the inspection time, an operational risk score is determined;
[0015] A risk score is determined based on the execution time, detection results, and server performance curve.
[0016] The target risk score is obtained by summing the operation risk score, the result risk score, and the command risk score.
[0017] In one embodiment, the category is: inspection, diagnosis, or emergency; determining the operational risk score based on the category and the inspection time includes:
[0018] If the category is inspection, the target interval corresponding to the inspection time is determined from multiple preset intervals, and the first preset score of the target interval is used as the operation risk score.
[0019] If the category is emergency, the second preset score configured for emergency will be used as the operational risk score;
[0020] If the category is diagnostic, the third preset score configured for the diagnostic category will be used as the operational risk score.
[0021] In one embodiment, obtaining the script to be reviewed and testing the script to be reviewed to obtain a script test report includes:
[0022] In response to the new script command, the system receives several basic element information and generates an initial script based on the reference template and the several basic element information.
[0023] Receive editing information, and obtain the script to be reviewed based on the initial script and the editing information;
[0024] The script to be reviewed is subjected to element information detection, function call detection, exception capture logic detection, and execution time detection to obtain a script test report.
[0025] In one embodiment, the review of the script to be reviewed based on the category and the target risk score includes:
[0026] If the category and the target risk score meet the online review conditions, the script to be reviewed will be reviewed online. The online review conditions include: the category is an inspection category or a diagnostic category, and the target risk score is less than a preset risk threshold.
[0027] Secondly, this application also provides a control device for script development. The device includes:
[0028] The development and testing module is used to obtain the script to be reviewed and to test the script to be reviewed to obtain a script test report;
[0029] The first scoring module is used to determine the command risk score of the script to be reviewed based on the script to be reviewed and the trained risk classification model.
[0030] The second scoring module is used to obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report and the command risk score;
[0031] The review and release module is used to review the script to be reviewed based on the category and the target risk score, and release it after the review is passed.
[0032] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0033] Obtain the script to be reviewed and test the script to be reviewed to obtain a script test report;
[0034] Based on the script to be reviewed and the trained risk classification model, determine the command risk score of the script to be reviewed;
[0035] Obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report, and the command risk score;
[0036] The script to be reviewed is reviewed based on the category and the target risk score, and is released after the review is passed.
[0037] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0038] Obtain the script to be reviewed and test the script to be reviewed to obtain a script test report;
[0039] Based on the script to be reviewed and the trained risk classification model, determine the command risk score of the script to be reviewed;
[0040] Obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report, and the command risk score;
[0041] The script to be reviewed is reviewed based on the category and the target risk score, and is released after the review is passed.
[0042] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0043] Obtain the script to be reviewed and test the script to be reviewed to obtain a script test report;
[0044] Based on the script to be reviewed and the trained risk classification model, determine the command risk score of the script to be reviewed;
[0045] Obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report, and the command risk score;
[0046] The script to be reviewed is reviewed based on the category and the target risk score, and is released after the review is passed.
[0047] The aforementioned script development control method, apparatus, computer equipment, and storage medium, wherein the script development control method automatically tests the script to be reviewed, obtains a test report, determines the command risk score of the script to be reviewed based on a trained risk classification model, and then obtains a target risk score based on the script category, script test report, and command risk score; reviews the script to be reviewed based on the target risk score and category, and releases it after passing the review. The script development control method proposes a standardized process from script testing, review, and release, which can improve the efficiency of script development, automatically detect scripts to be reviewed, and the target risk score includes risk scores from multiple dimensions, reducing the probability of high-risk scripts being introduced into the production environment and ensuring script quality. Attached Figure Description
[0048] Figure 1 This is a flowchart illustrating a control method developed using a script in one embodiment.
[0049] Figure 2 This is a schematic diagram illustrating the start of a script to be reviewed in one embodiment;
[0050] Figure 3 This is a schematic diagram illustrating receiving edit information based on an initial script in one embodiment.
[0051] Figure 4 This is a schematic diagram of offline review records in one embodiment;
[0052] Figure 5 A flowchart illustrating the control method developed using a script in another embodiment;
[0053] Figure 6 This is a structural block diagram of a control device developed using a script in one embodiment;
[0054] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] In one embodiment, such as Figure 1 As shown, a script review and deployment method is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0057] S101, Obtain the script to be reviewed and test the script to be reviewed to obtain a script test report.
[0058] The script to be reviewed is either edited from an existing script or generated based on basic element information, a reference template, and editing information. The script testing includes multiple test scenarios to reflect the performance of the script to be reviewed.
[0059] Specifically, the script to be reviewed is subjected to element information detection, function call detection, exception capture logic detection, and execution time detection to obtain a script test report.
[0060] S102, Based on the script to be reviewed and the trained risk classification model, determine the command risk score of the script to be reviewed.
[0061] The trained risk classification model is used to determine the command risk category of the script to be reviewed, and the command risk score is used to reflect the severity of the risk of the commands in the script to be reviewed.
[0062] Specifically, the script to be reviewed is segmented into words, and the result of the segmentation is input into a trained risk classification model to obtain the command risk category of the script to be reviewed. The score corresponding to the command risk category is used as the command risk score.
[0063] S103, obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report and the command risk score.
[0064] The categories of the scripts to be reviewed include inspection, diagnosis and emergency response, and the target risk score is the sum of the risk scores of the scripts to be reviewed in each dimension.
[0065] Specifically, based on the category and the script test report, an operational risk score and an outcome risk score are determined. The sum of the operational risk score, outcome risk score, and command risk score is calculated to obtain the target risk score. The operational risk score reflects the severity of the risk at the time of inspection, and the outcome risk score reflects whether there are any anomalies in the test results.
[0066] S104. Based on the category and the target risk score, review the script to be reviewed and release it after the review is passed.
[0067] Specifically, based on the category and the target risk score, the scripts to be reviewed are determined to be either reviewed online or offline. After the script is approved, it is entered into the script library. At regular intervals, the approved scripts are selected and deployed to the production environment by attributes such as organization number, applicable platform, and applicable business.
[0068] The aforementioned script development control method involves automatically testing the scripts to be reviewed, generating test reports, determining the command risk score of the scripts based on a trained risk classification model, and then obtaining a target risk score based on the script category, script test report, and command risk score. The scripts are then reviewed based on the target risk score and category, and released only after passing the review. This script development control method proposes a standardized process from script testing, review, and release, which can improve script development efficiency, automatically detect scripts to be reviewed, and the target risk score includes risk scores from multiple dimensions, reducing the probability of high-risk scripts being introduced into the production environment and ensuring script quality.
[0069] In one embodiment, S101 includes:
[0070] S111, in response to the new script instruction, receives several basic element information, and generates an initial script based on the reference template and the several basic element information.
[0071] Specifically, a new script is created through the script development subsystem. The script development subsystem receives the new script creation command from the user, which can be triggered by physical or virtual buttons, such as clicking a virtual button on the page. In response to the new script creation command, a new script page is displayed, where the user inputs several basic elements.
[0072] After receiving several basic element information, the script development subsystem parses this information, writes it into a reference template, creates a basic function framework including an initialization function and a main function, integrates these elements to obtain an initial script, and displays the initial script for user reference. The basic element information includes the script name, and the initial script also includes the script name.
[0073] like Figure 2 As shown, several basic information elements include: the path of the script to be reviewed, the script name, the script type (category), the platform used, and the user who executes it.
[0074] S112, Receive editing information, and obtain the script to be reviewed based on the initial script and the editing information.
[0075] Specifically, based on the initial script, user-inputted editing information is received to modify the content of the initial script, resulting in a script to be reviewed. This script is then stored in a distributed database, with an ObjectId automatically generated by the database serving as its unique identifier. The script is stored in an NFS shared directory for reading and writing.
[0076] Based on the reference template and the aforementioned basic element information, the generated initial script is as follows: Figure 3 As shown, based on the initial script, it receives editing information, which can modify the encoding format, add function descriptions, etc.
[0077] S113, perform element information detection, function call detection, exception capture logic detection, and execution time detection on the script to be reviewed to obtain a script test report.
[0078] Specifically, the script development specification module is used to inspect the scripts awaiting review. The element information inspection uses strings and regular expressions to confirm the completeness of script elements, including: functional descriptions before function calls, comments at the beginning of the script, password encryption, and basic `initialize()` and `main()` methods, etc. The function call inspection checks function call counts and declaration segments to determine if any functions are unused. The exception handling logic inspection uses keyword checks to determine if exception handling logic is defined in function branches and input parameters. The execution time inspection checks the script execution duration to determine if it exceeds limits or contains infinite loops, etc.
[0079] In one implementation, pre-developed scripts and corresponding applicable test environments can be invoked via a web front-end page and SSH protocol to conduct case tests and record test reports online, which can then be used for evaluation and reference by the subsequent professional approval system. This system includes, but is not limited to, functional testing and integration testing of related business interfaces. Test cases can be pre-entered for use or saved as templates after online testing for later use. Test environments are entered by each professional group as needed and can be managed by that group and the tools group after entry. Each test environment is assigned a responsible administrator to ensure connectivity and usability.
[0080] In another implementation, step S101, obtaining the script to be reviewed, includes: selecting candidate scripts, receiving modification information, and determining the script to be reviewed based on the modification information and the candidate scripts.
[0081] Specifically, all generated scripts are placed in a directory layer. Candidate scripts are selected from all scripts in the directory layer, modification information is received, and the candidate scripts are modified to obtain the scripts to be reviewed.
[0082] A script to be reviewed is generated based on the candidate scripts without changing the basic information of the candidate scripts. The modification information is used to modify or add script attribute parameters such as script logic, script execution user, applicable platform and business, encoding format, function description, dependent scripts and media, and timeout.
[0083] In this embodiment, a script to be reviewed can be quickly generated based on a reference template and editing information, or a script to be reviewed can be modified based on an existing script, thus improving the iteration speed.
[0084] In one embodiment, S102 includes:
[0085] S211, the script to be reviewed is segmented into words to obtain multiple word vectors to be processed.
[0086] Specifically, existing word segmenters can be used to segment the script to be reviewed, resulting in multiple word vectors to be processed. Existing word segmenters could be, for example, the WordPiece word segmenter.
[0087] S212, input the multiple word vectors to be processed into the trained risk classification model to obtain the command risk category.
[0088] Specifically, the multiple word vectors to be processed are input into the trained risk classification model, and the trained risk classification model outputs multiple probability vectors of preset command risk categories. The multiple preset command risk categories include: high-risk category, low-risk category and normal category. The high-risk category is irreversible operation that affects the business system, the low-risk category is recoverable operation that affects the business system, and the normal category is recoverable operation that may affect the business system, or irreversible operation that has no impact on the business system.
[0089] The trained risk classification model outputs a probability value for each preset command risk category. The preset command risk category corresponding to the maximum probability value of each preset command risk category is taken as the command risk category. For example, the multiple word vectors to be processed are input into the trained risk classification model, and the probability vector output by the trained risk classification model is (0.1, 0.2, 0.7), where 0.7 is the maximum value in the probability vector. Assuming that the preset command risk category corresponding to 0.7 is a high-risk category, then the command risk category is determined to be a high-risk category.
[0090] The trained risk classification model is obtained by training the model using multiple training scripts and the training categories for each script until training is complete. The trained risk classification model yields the same results as the original risk classification model. The multiple training scripts include multiple training scripts for high-risk categories, multiple training scripts for low-risk categories, and multiple training scripts for normal categories.
[0091] S213, Select a command risk score that matches the command risk category.
[0092] Specifically, a command risk score is pre-assigned to each command risk category. For example, a command risk score of 3 is assigned to the high-risk category, 2 to the low-risk category, and 1 to the normal category. If the command risk category is high-risk, then the command risk score is determined to be 3.
[0093] In one embodiment, S103 includes:
[0094] S311, Determine the operational risk score based on the category and the inspection time.
[0095] Specifically, if the category is inspection, a target interval corresponding to the inspection time is determined from multiple preset intervals, and the first preset score of the target interval is used as the operational risk score. The multiple preset intervals include: a first interval (8:00-18:00), a second interval (6:00-8:00 and 18:00-22:00), and a third interval (22:00-6:00). The first interval is the daytime peak business interval, the second interval is the secondary peak interval, and the third interval is the off-peak interval. Each interval is configured with a preset score.
[0096] S311 includes:
[0097] S321, if the category is inspection, determine the target interval corresponding to the inspection time from multiple preset intervals, and use the first preset score of the target interval as the operation risk score.
[0098] Specifically, if the inspection time of a script awaiting review falls within the first interval, then the first interval will be used as the target interval for the inspection. The first preset score for the first interval can be set according to requirements. If the inspection time of a script awaiting review falls within the second interval, then the second interval will be used as the target interval for the inspection. The first preset score for the second interval can be set according to requirements. If the inspection time of a script awaiting review falls within the third interval, then the third interval will be used as the target interval for the inspection. The first preset score for the first interval is greater than the first preset score for the second interval, and the first preset score for the second interval is greater than the first preset score for the third interval.
[0099] For example, if a script awaiting review for inspection is scheduled between 8:00 and 18:00 (first interval), and the first preset score for the first interval is 2 points, then the operational risk score is 2 points; if a script awaiting review for inspection is scheduled between 6:00 and 8:00 and between 18:00 and 22:00 (second interval), and the first preset score for the second interval is 1.5 points, then the operational risk score is 1.5 points; if a script awaiting review for inspection is scheduled between 22:00 and 6:00 (third interval), and the first preset score for the third interval is 1 point, then the operational risk score is 1 point.
[0100] S322, If the category is emergency, the second preset score configured for emergency category shall be used as the operational risk score.
[0101] Specifically, the emergency-type scripts awaiting review do not distinguish between inspection times. Regardless of when they are executed, the operational risk score is determined to be the second preset score pre-configured for the emergency type. The second preset score can be set according to needs; for example, the second preset score can be set to 2 points.
[0102] S323, If the category is a diagnostic category, the third preset score configured for the diagnostic category shall be used as the operational risk score.
[0103] Specifically, diagnostic scripts awaiting review do not distinguish between inspection times. Regardless of when they are executed, the operational risk score is always set to the third preset score pre-configured for diagnostic scripts. This third preset score can be set according to requirements, and it is lower than the second preset score. For example, the third preset score can be set to 1 point.
[0104] S311, determine the result risk score based on the execution time, detection results, and server performance curve.
[0105] Specifically, the execution time and the detection results can be obtained directly, and the server performance curve can be determined by the server pre-detection platform to determine whether there is a sudden change in the server performance curve between any two time windows.
[0106] If the execution time exceeds a preset duration, the execution time score is determined as the fourth preset score; if the execution time does not exceed the preset duration, the execution time score is determined as the fifth preset score. If the detection result is abnormal, the detection result score is determined as the sixth preset score; if the detection result is normal, the detection result score is determined as the seventh preset score. If the server performance curve shows a sudden change, the performance score is determined as the eighth preset score; if the server performance curve does not show a sudden change, the performance score is determined as the ninth preset score. The sum of the execution time score, the detection result score, and the performance score is calculated to obtain the result risk score. The fourth preset score is greater than the fifth preset score, the sixth preset score is greater than the seventh preset score, and the eighth preset score is greater than the ninth preset score.
[0107] The preset duration can be set to 10 minutes, the fourth preset score can be set to 2 points, the fifth preset score can be set to 1 point, the sixth preset score can be set to 2 points, the seventh preset score can be set to 1 point, the eighth preset score can be set to 2 points, and the ninth preset score can be set to 1 point.
[0108] For example, if the execution time is less than 10 minutes, the time score is 1 point; if the execution time is more than 10 minutes, the time score is 2 points. If the detection result is abnormal, the detection result score is 2 points; if the detection result is normal, the detection result score is 1 point. If there is a sudden change in the server performance curve, the performance score is 2 points; if there is no sudden change in server performance, the performance score is 1 point.
[0109] S311, calculate the sum of the operation risk score, the result risk score and the command risk score to obtain the target risk score.
[0110] Specifically, the operational risk score, the result risk score, and the command risk score are added together to obtain the target risk score.
[0111] The result risk score also includes: business risk score, which is determined based on the execution object of the script to be reviewed. If the execution object belongs to a preset customer application, the business risk score is determined to be the tenth preset score; if the execution object belongs to the first preset application, the business risk score is determined to be the eleventh preset score; and if the execution object belongs to the second preset application, the business risk score is determined to be the twelfth preset score.
[0112] The result risk score also includes a business risk score. Accordingly, the operation risk score, the result risk score, the command risk score and the result risk score are added together to obtain the target risk score.
[0113] The importance level of the preset customer application is higher than that of the first preset application, and the importance level of the first preset application is higher than that of the second preset application. The tenth preset score is higher than the eleventh preset score, and the eleventh preset score is higher than the twelfth preset score. The tenth preset score can be set to 2, the eleventh preset score to 1.5 points, and the tenth preset score to 1 point.
[0114] In one embodiment, S104 includes:
[0115] S411, If the category and the target risk score meet the online review conditions, then the script to be reviewed will be reviewed online.
[0116] The online review conditions include: the category is inspection or diagnosis, and the target risk score is less than a preset risk threshold.
[0117] Specifically, if the category is inspection or diagnosis, and the target risk score is less than a preset risk threshold, the script to be reviewed will be reviewed online using an existing professional online review system. After review, the script will be identified by a unique script ID and included in the script library. The reviewed script can be further developed and copied. The Wide script library enables the management and deployment of reviewed scripts, providing email notifications and report export functions to keep operations personnel informed of the details of the reviewed script management. Git (an open-source distributed version control system) is used for version management of the reviewed scripts. The professional online review system connects to the production agent via an API interface, synchronizing the agent's scripts with the scripts in the script library, supporting task scheduling and execution for upstream applications such as inspection systems, monitoring systems, platform portals, security checks, and branch operations platforms.
[0118] S411 If the target risk score does not meet the online review conditions, then an offline review shall be conducted.
[0119] Specifically, if the category is inspection or diagnosis, and the target risk score is greater than a preset risk threshold, then the script to be reviewed will be reviewed offline; or, if the category is emergency response, then an offline review will be conducted. Offline review means that the review will be carried out by professional staff.
[0120] Professional staff record and submit the review log, providing feedback to script developers and reviewers via email for confirmation and modification. The review log is retained in the database for traceability. The review log is as follows: Figure 4 As shown.
[0121] like Figure 5 As shown, the script development control method includes: script development and testing, script review, release of the test Wide script library, and synchronization and automatic deployment of the production Wide script library. Specifically, based on several basic element information, referencing templates and editing information, a script to be reviewed is quickly developed. The script to be reviewed is tested to obtain a test report. Based on the test report and the category of the script to be reviewed, the target risk score of the script to be reviewed is determined. Based on the target risk score and category, online or offline review is determined. After review, the script is included in the test Wide script library. For the scripts in the test Wide script library, at each statistical period, the scripts that have passed the review are counted, the script version package is exported from the test Wide script library, and imported into the production Wide script library to synchronize with the production environment. At the same time, the scripts in the test Git script library are automatically synchronized to the production Git script library.
[0122] After review, scripts are automatically added to the script library. Scripts in the library can be filtered, sorted, and deployed based on attributes such as organization number, applicable platform, and applicable business. They can also be automatically deployed in batches by setting the execution frequency of scheduled tasks, the script library to be deployed, and the server range for deployment, generating reports and notifying operations personnel of the deployment results via email. Integrating reviewed scripts into the script library ensures unified management, maintains production version consistency, improves script production adaptability, enhances script maintainability, and reduces the risk of introducing high-risk scripts into the production environment. For scripts that fail review and have suggested modifications, the script developers revise them and resubmit them for review until they pass.
[0123] In this embodiment of the invention, scripts to be reviewed are quickly generated based on several basic element information, reference templates, and editing information. The scripts are then automatically tested to obtain a test report. A target risk score is determined for each script, and online or offline review is determined based on the target risk score and the script's category. After approval, the scripts are incorporated into a unified script library for management, enhancing script maintainability and reducing the risk of high-risk scripts being introduced into the production environment. Script version packages are periodically exported from the script library and synchronized to the production environment, realizing the entire process of script development, testing, review, and release. This significantly improves the development efficiency of the script development team and enables the accumulation of operational script assets and the retention of experience.
[0124] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0125] Based on the same inventive concept, this application also provides a script development control device for implementing the script development control method described above. The solution provided by this device is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more script development control device embodiments provided below can be found in the limitations of the script development control method described above, and will not be repeated here.
[0126] In one embodiment, such as Figure 6 As shown, a control device for script development is provided, including:
[0127] The development and testing module is used to obtain the script to be reviewed and to test the script to be reviewed to obtain a script test report;
[0128] The first scoring module is used to determine the command risk score of the script to be reviewed based on the script to be reviewed and the trained risk classification model.
[0129] The second scoring module is used to obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report and the command risk score;
[0130] The review and release module is used to review the script to be reviewed based on the category and the target risk score, and release it after the review is passed.
[0131] In one embodiment, the first scoring module includes: a first unit, a second unit, and a third unit, wherein:
[0132] The first unit is used to perform word segmentation on the script to be reviewed to obtain multiple word vectors to be processed;
[0133] The second unit is used to input the multiple word vectors to be processed into a trained risk classification model to obtain the command risk category;
[0134] The third unit is used to select a command risk score that matches the command risk category.
[0135] In one embodiment, the script test report includes: inspection time, execution time, detection results, and server performance curve; the second scoring module includes: a fourth unit, a fifth unit, and a sixth unit, wherein:
[0136] The fourth unit is used to determine the operational risk score based on the category and the inspection time;
[0137] The fifth unit is used to determine the result risk score based on the execution time, detection results, and server performance curve.
[0138] The sixth unit is used to calculate the sum of the operation risk score, the result risk score, and the command risk score to obtain the target risk score.
[0139] In one embodiment, the category is: inspection category, or diagnostic category, or emergency category; the fourth unit includes: a first subunit, a second subunit, and a third subunit, wherein:
[0140] The first subunit is used to determine the target interval corresponding to the inspection time from multiple preset intervals if the category is inspection, and to use the first preset score of the target interval as the operation risk score.
[0141] The second subunit is used to, if the category is an emergency category, use the second preset score configured for the emergency category as the operational risk score;
[0142] The third subunit is used to, if the category is a diagnostic category, use the third preset score configured for the diagnostic category as the operational risk score.
[0143] In one embodiment, the development and testing module includes: a first development unit, a second development unit, and a testing unit, wherein:
[0144] The first development unit is configured to respond to a new script creation command by receiving several basic element information and generating an initial script based on a reference template and the several basic element information.
[0145] The second development unit is used to receive editing information and obtain the script to be reviewed based on the initial script and the editing information;
[0146] The testing unit is used to perform element information detection, function call detection, exception capture logic detection, and execution time detection on the script to be reviewed, and to obtain a script test report.
[0147] In one embodiment, the review and release module is further configured to: perform online review on the script to be reviewed if the category and the target risk score meet the online review conditions, wherein the online review conditions include: the category is an inspection category or a diagnostic category, and the target risk score is less than a preset risk threshold.
[0148] The modules in the control device developed by the above script can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0149] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a script-based control method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0150] Those skilled in the art will understand that Figure 7The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0151] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0152] Obtain the script to be reviewed and test the script to be reviewed to obtain a script test report;
[0153] Based on the script to be reviewed and the trained risk classification model, determine the command risk score of the script to be reviewed;
[0154] Obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report, and the command risk score;
[0155] The script to be reviewed is reviewed based on the category and the target risk score, and is released after the review is passed.
[0156] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining the command risk score of the script to be reviewed based on the script to be reviewed and the trained risk classification model, including:
[0157] The script to be reviewed is segmented into words to obtain multiple word vectors to be processed;
[0158] The multiple word vectors to be processed are input into the trained risk classification model to obtain the command risk category;
[0159] Select a command risk score that matches the command risk category.
[0160] In one embodiment, the script test report includes: inspection time, execution time, detection results, and server performance curve; when the processor executes the computer program, it further implements the following steps: determining the target risk score based on the category, the script test report, and the command risk score includes:
[0161] Based on the category and the inspection time, an operational risk score is determined;
[0162] A risk score is determined based on the execution time, detection results, and server performance curve.
[0163] The target risk score is obtained by summing the operation risk score, the result risk score, and the command risk score.
[0164] In one embodiment, the category is: inspection category, diagnostic category, or emergency category; when the processor executes the computer program, it further implements the following steps: determining the operational risk score based on the category and the inspection time includes:
[0165] If the category is inspection, the target interval corresponding to the inspection time is determined from multiple preset intervals, and the first preset score of the target interval is used as the operation risk score.
[0166] If the category is emergency, the second preset score configured for emergency will be used as the operational risk score;
[0167] If the category is diagnostic, the third preset score configured for the diagnostic category will be used as the operational risk score.
[0168] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the script to be reviewed and testing the script to be reviewed to obtain a script test report, including:
[0169] In response to the new script command, the system receives several basic element information and generates an initial script based on the reference template and the several basic element information.
[0170] Receive editing information, and obtain the script to be reviewed based on the initial script and the editing information;
[0171] The script to be reviewed is subjected to element information detection, function call detection, exception capture logic detection, and execution time detection to obtain a script test report.
[0172] In one embodiment, when the processor executes the computer program, it further performs the following steps: reviewing the script to be reviewed based on the category and the target risk score, including:
[0173] If the category and the target risk score meet the online review conditions, the script to be reviewed will be reviewed online. The online review conditions include: the category is an inspection category or a diagnostic category, and the target risk score is less than a preset risk threshold.
[0174] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0175] Obtain the script to be reviewed and test the script to be reviewed to obtain a script test report;
[0176] Based on the script to be reviewed and the trained risk classification model, determine the command risk score of the script to be reviewed;
[0177] Obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report, and the command risk score;
[0178] The script to be reviewed is reviewed based on the category and the target risk score, and is released after the review is passed.
[0179] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0180] The step of determining the command risk score of the script to be reviewed based on the script to be reviewed and the trained risk classification model includes:
[0181] The script to be reviewed is segmented into words to obtain multiple word vectors to be processed;
[0182] The multiple word vectors to be processed are input into the trained risk classification model to obtain the command risk category;
[0183] Select a command risk score that matches the command risk category.
[0184] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0185] The script test report includes: inspection time, execution time, detection results, and server performance curve; the determination of the target risk score based on the category, the script test report, and the command risk score includes:
[0186] Based on the category and the inspection time, an operational risk score is determined;
[0187] A risk score is determined based on the execution time, detection results, and server performance curve.
[0188] The target risk score is obtained by summing the operation risk score, the result risk score, and the command risk score.
[0189] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0190] The categories are: inspection, diagnosis, or emergency; the determination of operational risk scores based on the category and the inspection time includes:
[0191] If the category is inspection, the target interval corresponding to the inspection time is determined from multiple preset intervals, and the first preset score of the target interval is used as the operation risk score.
[0192] If the category is emergency, the second preset score configured for emergency will be used as the operational risk score;
[0193] If the category is diagnostic, the third preset score configured for the diagnostic category will be used as the operational risk score.
[0194] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0195] The process of obtaining the script to be reviewed and testing the script to be reviewed to obtain a script test report includes:
[0196] In response to the new script command, the system receives several basic element information and generates an initial script based on the reference template and the several basic element information.
[0197] Receive editing information, and obtain the script to be reviewed based on the initial script and the editing information;
[0198] The script to be reviewed is subjected to element information detection, function call detection, exception capture logic detection, and execution time detection to obtain a script test report.
[0199] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0200] The review of the script to be reviewed based on the category and the target risk score includes:
[0201] If the category and the target risk score meet the online review conditions, the script to be reviewed will be reviewed online. The online review conditions include: the category is an inspection category or a diagnostic category, and the target risk score is less than a preset risk threshold.
[0202] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0203] Obtain the script to be reviewed and test the script to be reviewed to obtain a script test report;
[0204] Based on the script to be reviewed and the trained risk classification model, determine the command risk score of the script to be reviewed;
[0205] Obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report, and the command risk score;
[0206] The script to be reviewed is reviewed based on the category and the target risk score, and is released after the review is passed.
[0207] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: determining the command risk score of the script to be reviewed based on the script to be reviewed and the trained risk classification model, including:
[0208] The script to be reviewed is segmented into words to obtain multiple word vectors to be processed;
[0209] The multiple word vectors to be processed are input into the trained risk classification model to obtain the command risk category;
[0210] Select a command risk score that matches the command risk category.
[0211] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: the script test report includes: inspection time, execution time, detection results, and server performance curve; determining the target risk score based on the category, the script test report, and the command risk score includes:
[0212] Based on the category and the inspection time, an operational risk score is determined;
[0213] A risk score is determined based on the execution time, detection results, and server performance curve.
[0214] The target risk score is obtained by summing the operation risk score, the result risk score, and the command risk score.
[0215] In one embodiment, when the computer program is executed by a processor, it further implements the following steps: the category is: inspection category, or diagnostic category, or emergency category; determining the operational risk score based on the category and the inspection time includes:
[0216] If the category is inspection, the target interval corresponding to the inspection time is determined from multiple preset intervals, and the first preset score of the target interval is used as the operation risk score.
[0217] If the category is emergency, the second preset score configured for emergency will be used as the operational risk score;
[0218] If the category is diagnostic, the third preset score configured for the diagnostic category will be used as the operational risk score.
[0219] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: obtaining the script to be reviewed and testing the script to be reviewed to obtain a script test report, including:
[0220] In response to the new script command, the system receives several basic element information and generates an initial script based on the reference template and the several basic element information.
[0221] Receive editing information, and obtain the script to be reviewed based on the initial script and the editing information;
[0222] The script to be reviewed is subjected to element information detection, function call detection, exception capture logic detection, and execution time detection to obtain a script test report.
[0223] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: reviewing the script to be reviewed based on the category and the target risk score, including:
[0224] If the category and the target risk score meet the online review conditions, the script to be reviewed will be reviewed online. The online review conditions include: the category is an inspection category or a diagnostic category, and the target risk score is less than a preset risk threshold.
[0225] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0226] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0227] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0228] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
[0229] It should be noted that the script development control method, apparatus, computer equipment, and storage medium of this application can be used in computer applications in the financial field for script development, testing, review, and release, and can also be used in computer applications in any field other than the financial field. The application fields of the script development control method, apparatus, computer equipment, and storage medium of this application are not limited.
Claims
1. A control method for script development, characterized in that, The method includes: Obtain the script to be reviewed and test the script to be reviewed to obtain a script test report; Based on the script to be reviewed and the trained risk classification model, determine the command risk score of the script to be reviewed; Obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report, and the command risk score; The script to be reviewed is reviewed based on the category and the target risk score, and is released after the review is passed; The script test report includes: inspection time, execution time, detection results, and server performance curve; the determination of the target risk score based on the category, the script test report, and the command risk score includes: Based on the category and the inspection time, an operational risk score is determined; A risk score is determined based on the execution time, detection results, and server performance curve. The target risk score is obtained by summing the operation risk score, the result risk score, and the command risk score. The categories are: inspection, diagnosis, or emergency; the determination of operational risk scores based on the category and the inspection time includes: If the category is inspection, the target interval corresponding to the inspection time is determined from multiple preset intervals, and the first preset score of the target interval is used as the operation risk score. The preset interval is determined based on the business peak time, and a preset score is configured for each preset interval. If the category is emergency, the second preset score configured for emergency will be used as the operational risk score; If the category is diagnostic, the third preset score configured for the diagnostic category will be used as the operational risk score; The step of determining the command risk score of the script to be reviewed based on the script to be reviewed and the trained risk classification model includes: The script to be reviewed is segmented into words to obtain multiple word vectors to be processed; The multiple word vectors to be processed are input into the trained risk classification model to obtain the command risk category; Select a command risk score that matches the command risk category; The step of determining the result risk score based on the execution time, detection results, and server performance curve includes: If the execution time exceeds a preset duration, the execution time score is determined as the fourth preset score; if the execution time does not exceed the preset duration, the execution time score is determined as the fifth preset score. If the detection result is abnormal, the detection result score is determined as the sixth preset score; if the detection result is normal, the detection result score is determined as the seventh preset score. If there is a sudden change in the server performance curve, the performance score is determined as the eighth preset score; if there is no sudden change in the server performance curve, the performance score is determined as the ninth preset score. The sum of the execution time score, the detection result score, and the performance score is calculated to obtain the result risk score, wherein the fourth preset score is greater than the fifth preset score, the sixth preset score is greater than the seventh preset score, and the eighth preset score is greater than the ninth preset score.
2. The method according to claim 1, characterized in that, The process of obtaining the script to be reviewed and testing the script to be reviewed to obtain a script test report includes: In response to the new script command, the system receives several basic element information and generates an initial script based on the reference template and the several basic element information. Receive editing information, and obtain the script to be reviewed based on the initial script and the editing information; The script to be reviewed is subjected to element information detection, function call detection, exception capture logic detection, and execution time detection to obtain a script test report.
3. The method according to any one of claims 1 to 2, characterized in that, The review of the script to be reviewed based on the category and the target risk score includes: If the category and the target risk score meet the online review conditions, the script to be reviewed will be reviewed online. The online review conditions include: the category is an inspection category or a diagnostic category, and the target risk score is less than a preset risk threshold.
4. A script-developed control device, characterized in that, The device includes: The development and testing module is used to obtain the script to be reviewed and to test the script to be reviewed to obtain a script test report; The first scoring module is used to determine the command risk score of the script to be reviewed based on the script to be reviewed and the trained risk classification model. The second scoring module is used to obtain the category of the script to be reviewed, and determine the target risk score based on the category, the script test report and the command risk score; The review and release module is used to review the script to be reviewed based on the category and the target risk score, and release it after the review is passed; The script test report includes: inspection time, execution time, detection results, and server performance curve; the second scoring module includes: a fourth unit, a fifth unit, and a sixth unit, wherein: The fourth unit is used to determine the operational risk score based on the category and the inspection time; The fifth unit is used to determine the result risk score based on the execution time, detection results, and server performance curve. The sixth unit is used to calculate the sum of the operation risk score, the result risk score, and the command risk score to obtain the target risk score; The categories are: inspection, diagnosis, or emergency response; the fourth unit includes: a first subunit, a second subunit, and a third subunit, wherein: The first subunit is used to determine the target interval corresponding to the inspection time from multiple preset intervals if the category is inspection, and to use the first preset score of the target interval as the operation risk score. The preset interval is determined based on the peak business time, and a preset score is configured for each preset interval. The second subunit is used to, if the category is an emergency category, use the second preset score configured for the emergency category as the operational risk score; The third subunit is used to, if the category is a diagnostic category, use the third preset score configured for the diagnostic category as the operational risk score. The first scoring module includes: a first unit, a second unit, and a third unit, wherein: The first unit is used to perform word segmentation on the script to be reviewed to obtain multiple word vectors to be processed; The second unit is used to input the multiple word vectors to be processed into a trained risk classification model to obtain the command risk category; The third unit is used to select a command risk score that matches the command risk category; The fifth unit is specifically used for: determining a time consumption score as a fourth preset score when the execution time exceeds a preset duration, and determining a time consumption score as a fifth preset score when the execution time does not exceed a preset duration; determining a detection result score as a sixth preset score when the detection result is abnormal, and determining a detection result score as a seventh preset score when the detection result is normal; determining a performance score as an eighth preset score when there is a sudden change in the server performance curve, and determining a performance score as a ninth preset score when there is no sudden change in the server performance curve; calculating the sum of the time consumption score, the detection result score, and the performance score to obtain a result risk score, wherein the fourth preset score is greater than the fifth preset score, the sixth preset score is greater than the seventh preset score, and the eighth preset score is greater than the ninth preset score.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Script auditing method and device
CN109710518A
Script auditing execution method, system and device and storage medium
CN112464175A