CN115794056B - Script file processing method, device, equipment and storage medium - Google Patents

Script file processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115794056B
CN115794056B CN202211506260.7A CN202211506260A CN115794056B CN 115794056 B CN115794056 B CN 115794056B CN 202211506260 A CN202211506260 A CN 202211506260A CN 115794056 B CN115794056 B CN 115794056B
Authority
CN
China
Prior art keywords
logic
target
parameter
script file
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211506260.7A
Other languages
Chinese (zh)
Other versions
CN115794056A (en
Inventor
孙志广
姬蓬涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202211506260.7A priority Critical patent/CN115794056B/en
Publication of CN115794056A publication Critical patent/CN115794056A/en
Application granted granted Critical
Publication of CN115794056B publication Critical patent/CN115794056B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides a script file processing method, a script file processing device, script file processing equipment and a storage medium, wherein the script file processing method comprises the following steps: splitting a script file to be processed into a plurality of logic units according to preset logic keywords, generating and displaying a logic flow chart of the script file to be processed according to the logic units, responding to a first adjustment operation corresponding to the execution content and/or the execution sequence of a target logic unit in the logic flow chart, adjusting the execution content and/or the execution sequence of the target logic unit, generating an adjusted logic flow chart according to the adjusted execution content and/or the execution sequence of the target logic unit, and generating the target script file. According to the method and the device, the script file is carded into the visualized logic flow chart according to the logic keywords, and the logic units needing to be adjusted can be quickly checked on the flow chart through the display of the logic flow chart, and the corresponding execution content and/or execution sequence can be directly adjusted, so that the accuracy and the working efficiency are greatly improved.

Description

Script file processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a script file.
Background
Along with the change of the service requirement, when the software developer writes the continuous integrated script, the original script file often needs to be adjusted, and in some cases, repeated contents in the original script file need to be adjusted sequentially.
In the prior art, a text tool is generally used to search an original script file to determine repeated contents in the original script file, and the repeated contents are manually identified and distinguished to analyze the code positions to be adjusted.
However, the above method requires a high level of developer, and the manual determination of the code position to be adjusted is prone to error and has low accuracy.
Disclosure of Invention
In view of the above, the embodiments of the present application provide a method, an apparatus, a device, and a storage medium for processing a script file, so as to solve the problem in the prior art that a code position to be adjusted is easy to make an error and has low accuracy by manually checking the script file.
In a first aspect, an embodiment of the present application provides a method for processing a script file, including:
splitting a script file to be processed into a plurality of logic units according to preset logic keywords, wherein the logic units respectively correspond to one execution content;
Generating and displaying a logic flow chart of the script file to be processed according to the plurality of logic units;
responding to a first adjustment operation corresponding to the execution content and/or the execution sequence of a target logic unit in the logic flow chart, and adjusting the execution content and/or the execution sequence of the target logic unit;
and generating an adjusted logic flow chart according to the execution content and/or the execution sequence of the adjusted target logic unit, and generating a target script file.
In an alternative embodiment, before the generating the target script file, the method further includes:
determining at least one corresponding parameter module from the script file to be processed according to a preset parameter type;
generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in the at least one parameter module;
according to a second adjustment operation input for the parameter values in the target parameter modules in the parameter list, adjusting the parameter values in the target parameter modules;
the generating the target script file includes:
and generating the target script file according to the adjusted logic flow chart and the adjusted parameter list.
In an alternative embodiment, the
Generating an adjusted logic flow diagram according to the execution content and/or the execution sequence of the adjusted target logic unit, wherein the logic flow diagram comprises the following steps:
determining the execution sequence of other logic units according to the adjusted execution sequence of the target logic unit, wherein the other logic units are logic units except the target logic unit in the plurality of logic units;
and sequencing the adjusted target logic units and the other logic units in sequence according to the execution sequence of the adjusted target logic units and the execution sequence of the other logic units, so as to generate the adjusted logic flow chart.
In an alternative embodiment, the generating the target script file according to the adjusted logic flow diagram includes:
analyzing the adjusted logic flow diagram to obtain the execution content of each logic unit in the adjusted logic flow diagram and the execution sequence of each logic unit;
and generating the target script file according to the preset logic key words, the execution content of each logic unit and the execution sequence of each logic unit.
In an optional embodiment, the adjusting the execution content and/or the execution sequence of the target logic unit in response to the first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit in the logic flow chart includes:
in response to a selection operation for the target logical unit, a logical edit section of the target logical unit is presented, in which: the execution content and/or the execution sequence of the target logic unit;
and responding to the first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit, which is input through the logic editing area, and adjusting the execution content and/or the execution sequence of the target logic unit.
In an optional implementation manner, the generating and displaying the parameter list of the script file to be processed according to the parameter type and the parameter value in the at least one parameter module includes:
a parameter module that determines an adjustable parameter value from the at least one parameter module;
and generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in the parameter module capable of adjusting the parameter values.
In an optional embodiment, the adjusting the parameter value in the target parameter module in response to the second adjustment operation for the parameter value in the target parameter module in the parameter list includes:
in response to a selection operation for the target parameter module, a parameter value editing area of the target parameter module is displayed, wherein the parameter value editing area is displayed with: parameter values in the target parameter module;
and adjusting the parameter values in the target parameter module in response to the second adjustment operation for the parameter values in the target parameter module, which is input through the parameter value editing area.
In a second aspect, an embodiment of the present application further provides a device for processing a script file, including:
the splitting module is used for splitting the script file to be processed into a plurality of logic units according to the preset logic keywords, wherein the logic units respectively correspond to one execution content;
the generating module is used for generating and displaying a logic flow chart of the script file to be processed according to the plurality of logic units;
the adjusting module is used for responding to a first adjusting operation corresponding to the execution content and/or the execution sequence of the target logic unit in the logic flow chart and adjusting the execution content and/or the execution sequence of the target logic unit;
The generation module is further configured to generate an adjusted logic flow chart according to the execution content and/or the execution sequence of the adjusted target logic unit, and generate a target script file.
In an alternative embodiment, the apparatus further comprises:
the determining module is used for determining at least one corresponding parameter module from the script file to be processed according to the preset parameter type;
the generating module is further used for generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in the at least one parameter module;
the adjusting module is further configured to adjust a parameter value in a target parameter module according to a second adjusting operation input for the parameter value in the target parameter module in the parameter list;
the generating module is specifically configured to:
and generating the target script file according to the adjusted logic flow chart and the adjusted parameter list.
In an alternative embodiment, the generating module is specifically configured to:
determining the execution sequence of other logic units according to the adjusted execution sequence of the target logic unit, wherein the other logic units are logic units except the target logic unit in the plurality of logic units;
And sequencing the adjusted target logic units and the other logic units in sequence according to the execution sequence of the adjusted target logic units and the execution sequence of the other logic units, so as to generate the adjusted logic flow chart.
In an alternative embodiment, the generating module is specifically configured to:
analyzing the adjusted logic flow diagram to obtain the execution content of each logic unit in the adjusted logic flow diagram and the execution sequence of each logic unit;
and generating the target script file according to the preset logic key words, the execution content of each logic unit and the execution sequence of each logic unit.
In an alternative embodiment, the adjusting module is specifically configured to:
in response to a selection operation for the target logical unit, a logical edit section of the target logical unit is presented, in which: the execution content and/or the execution sequence of the target logic unit;
and responding to the first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit, which is input through the logic editing area, and adjusting the execution content and/or the execution sequence of the target logic unit.
In an alternative embodiment, the generating module is specifically configured to:
a parameter module that determines an adjustable parameter value from the at least one parameter module;
and generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in the parameter module capable of adjusting the parameter values.
In an alternative embodiment, the adjusting module is specifically configured to:
in response to a selection operation for the target parameter module, a parameter value editing area of the target parameter module is displayed, wherein the parameter value editing area is displayed with: parameter values in the target parameter module;
and adjusting the parameter values in the target parameter module in response to the second adjustment operation for the parameter values in the target parameter module, which is input through the parameter value editing area.
In a third aspect, an embodiment of the present application further provides an electronic device, including: the system comprises a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, when the electronic device runs, the processor and the memory are communicated through the bus, and the processor executes the machine-readable instructions to execute the method for processing the script file in any of the first aspect.
In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program is executed by a processor to perform a method for processing a script file according to any one of the first aspects.
The application provides a script file processing method, a script file processing device, script file processing equipment and a storage medium, wherein the script file processing method comprises the following steps: splitting a script file to be processed into a plurality of logic units according to preset logic keywords, generating and displaying a logic flow chart of the script file to be processed according to the logic units, responding to a first adjustment operation corresponding to the execution content and/or the execution sequence of a target logic unit in the logic flow chart, adjusting the execution content and/or the execution sequence of the target logic unit, generating an adjusted logic flow chart according to the adjusted execution content and/or the execution sequence of the target logic unit, and generating the target script file. According to the method and the device, the script file is carded into the visualized logic flow chart according to the logic keywords, and the logic units needing to be adjusted can be quickly checked on the flow chart through the display of the logic flow chart, and the corresponding execution content and/or execution sequence can be directly adjusted, so that the accuracy and the working efficiency are greatly improved.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating a method for processing a script file according to an embodiment of the present application;
FIG. 2 is a second flowchart of a method for processing a script file according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for processing a script file according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a method for processing a script file according to an embodiment of the present application;
fig. 5 is a flowchart of a method for processing a script file according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a logic flow diagram provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a parameter list provided in an embodiment of the present application;
FIG. 8 is a schematic diagram of a script file processing apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
Based on the prior art that the repeated content of the script file is determined by adopting a text tool, and the adjusted code position is manually determined so as to carry out different logic modification or parameter modification and the like on the repeated content, a developer is required to be familiar with the script content and is required to be familiar with business logic so as to accurately analyze the position of the code to be modified.
The method for processing script files provided by the application is described below with reference to several specific embodiments.
Fig. 1 is a schematic flow chart of a method for processing a script file according to an embodiment of the present application, where an execution body of the embodiment may be an electronic device, such as a terminal, a server, or other devices with data processing capability.
As shown in fig. 1, the method may include:
s101, splitting a script file to be processed into a plurality of logic units according to a preset logic keyword.
The script file to be processed comprises preset logic keywords, the script file to be processed can be split into a plurality of logic units according to the preset logic keywords, each logic unit corresponds to one preset logic keyword, each logic unit is used for executing corresponding business logic, the plurality of logic units respectively have corresponding execution content, and the execution content can be realized through an execution script, namely the script file to be processed comprises the execution script corresponding to the plurality of logic units.
The multiple split logic units may have an execution sequence, which is used to indicate an order of the execution scripts corresponding to each logic unit in the to-be-processed script file, for example, the execution sequence of the first logic unit is a first bit, the execution sequence of the second logic unit is a second bit, and the execution sequence of the third logic unit is a third bit, which indicates that the execution sequence of the execution scripts in the to-be-processed script file is an execution script corresponding to the first logic unit, an execution script corresponding to the second logic unit, and an execution script corresponding to the third logic unit, where the execution script corresponding to the first logic unit, the execution script corresponding to the second logic unit, and the execution script corresponding to the third logic unit jointly implement the overall business logic of the to-be-processed script file.
It should be noted that the script file to be processed may be any script file in any format, for example, may be a script file in a pipeline format.
The script file in the pipeline format may be:
pipeline{
agent any
stages{
stage('Example'{
steps{
echo'Hello World'
}
}
}
}
from the above, standard syntax keywords of script files in pipeline format include, but are not limited to: pipeline, stages (stage set), stage, steps (steps under stage), where the position in the text where the key pipeline is located should be the beginning position, and the script allows default value writing, and may also provide a format check to confirm whether parsing conversion can be performed.
The preset logic key may be a standard syntax key of a script file in a pipeline format, for example, may be a stage, that is, the script file to be split into multiple stages by the stage, where each stage is a logic unit. Scripts with two stage processing steps are common as follows:
pipeline{
agent none
stages{
stage('Example Build'){
agent{docker'maven:3-alpine'}
steps{
echo'Hello,Maven'
sh'mvn--version'
}
}
stage('Example Test'){
agent{docker'openjdk:8-jre'}
steps{
echo'Hello,JDK'
sh'java-version'
}
}
}
}
from the above, the script file in the pipeline format includes two stages, and the script file can be split into two logic units (i.e. code blocks) by using the structural features of the pipeline syntax format, and the logic units named as Example Build are:
stage('Example Build'){
steps{
echo'Hello,Maven'
sh'mvn--version'
}
}
The logical unit named sample Test is:
stage('Example Test'){
steps{
echo'Hello,JDK'
sh'java-version'
}
}
}
s102, generating and displaying a logic flow chart of the script file to be processed according to the plurality of logic units.
According to the execution sequence of the logic units, the logic units are sequentially connected to generate and display a logic flow chart of the script file to be processed, wherein the logic flow chart comprises the logic units, each logic unit corresponds to one execution content, and the Example is taken the Example of the Example Build, and the corresponding execution script is:
steps{
echo'Hello,Maven'
sh'mvn--version'
}
}
taking the Example sample Test as an Example, the corresponding execution script is:
steps{
echo'Hello,JDK'
sh'java-version'
}
s103, responding to a first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit in the logic flow chart, and adjusting the execution content and/or the execution sequence of the target logic unit.
The target logic unit may be a logic unit to be adjusted in the logic flow chart, and the first adjustment operation is used for adjusting the execution content and/or the execution sequence of the target logic unit, including but not limited to adding, deleting, modifying the execution content, and adjusting the execution sequence of the target logic unit in the logic flow chart.
The logic units in the logic flow chart are respectively provided with an execution sequence, and the execution sequence is used for indicating the execution sequence of the execution script corresponding to the logic units in the script file to be processed, for example, the execution sequence of the first logic unit is a first bit, the execution sequence of the second logic unit is a second bit, the execution sequence of the third logic unit is a third bit, the execution sequence of the third logic unit is adjusted from three to one through a first adjustment operation, and correspondingly, the execution sequences of the first logic unit and the second logic unit are sequentially backed by one bit and respectively two and three.
After the logic flow chart is generated and displayed on the visual interface, a user can input a first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit in the logic flow chart through the visual interface at the front end of the device according to actual requirements, the rear end of the device receives the first adjustment operation, and adjusts the execution content and/or the execution sequence of the target logic unit according to the first adjustment operation, including adding, deleting and modifying the execution content of the target logic unit and/or adjusting the execution sequence of the target logic unit in the logic flow chart.
For example, if the execution content of the target logic unit is used to implement multiplication operations of a and B, then adjustment of the execution content of the target logic unit may modify the multiplication operation between a and B to an addition operation, i.e., modify the business logic implemented by the target logic unit.
S104, generating an adjusted logic flow chart according to the execution content and/or the execution sequence of the adjusted target logic unit, and generating a target script file.
After adjusting the execution content and/or the execution sequence of the target logic unit, the execution content and/or the execution sequence of the adjusted target logic unit may be saved, and according to the execution content and/or the execution sequence of the adjusted target logic unit, an adjusted logic flow chart is generated, where the adjusted logic flow chart includes the adjusted target logic unit and other logic units except the target logic unit in the plurality of logic units that are sequentially connected according to the execution sequence, and the adjusted logic flow chart is analyzed to generate the target script file.
In the method for processing the script file according to the embodiment, the script file to be processed is split into a plurality of logic units according to the preset logic keywords, a logic flow chart of the script file to be processed is generated and displayed according to the plurality of logic units, the execution content and/or the execution sequence of the target logic unit is adjusted in response to a first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit in the logic flow chart, and the adjusted logic flow chart is generated and the target script file is generated according to the execution content and/or the execution sequence of the adjusted target logic unit. Therefore, through the display of the logic flow chart, the logic units needing to be adjusted are quickly checked on the flow chart, and the corresponding execution content and/or execution sequence are directly adjusted, so that the accuracy and the working efficiency are greatly improved.
Fig. 2 is a second flowchart of a method for processing a script file according to an embodiment of the present application, where, as shown in fig. 2, before generating a target script file, the method may further include:
s201, determining at least one corresponding parameter module from the script file to be processed according to the preset parameter type.
The script file to be processed includes a preset parameter type, according to the preset parameter type, at least one corresponding parameter module may be determined from the script file to be processed, where the parameter type of at least one parameter module is a preset parameter type, and the preset parameter type may be, for example, a agent, an environment, and parameters, and each parameter module includes: one parameter type and a parameter value, wherein the one parameter type is any parameter type in preset parameter types, namely, the parameter type included in the parameter module can be any one of agents, environments and parameters.
S202, generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in at least one parameter module.
Generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in at least one parameter module, wherein the parameter list comprises: and the at least one parameter module can be analyzed according to a grammar analysis method of a preset parameter type to obtain the parameter type and the parameter value of each parameter module, and the parameter type and the parameter value are stored in a key value table form to obtain a parameter list of the script file to be processed, wherein in the parameter list, the key is the parameter type and the value is the parameter value.
In an alternative embodiment, generating and displaying a parameter list of the script file to be processed according to the parameter type and the parameter value in at least one parameter module includes:
a parameter module that determines an adjustable parameter value from the at least one parameter module; and generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in the parameter module with adjustable parameter values.
In order to avoid invalid display of the parameter modules with non-adjustable parameter values, the parameter module with adjustable parameter values may be further determined from the at least one parameter module, and a parameter list of the file to be scripted may be generated and displayed according to the parameter types and the parameter values in the parameter module with adjustable parameter values, where the parameter list includes: a parameter module that can adjust parameter values.
S203, responding to a second adjustment operation for the parameter values in the target parameter model in the parameter list, and adjusting the parameter values in the target parameter module.
The target parameter module may be a parameter module to be adjusted in the parameter list, and the second adjustment operation is used for adjusting a parameter value in the target parameter module, including but not limited to adding, deleting, and modifying a parameter value.
After the parameter list is generated and displayed on the visual interface, a user can input a second adjustment operation for the parameter value in the target parameter module in the parameter list through visual decoding at the front end of the device according to actual requirements, and the rear end of the device receives the second adjustment operation and adjusts the parameter value in the target parameter module according to the second adjustment operation.
For example, if the parameter value in the target parameter module is 1, then the adjustment to the parameter value in the target parameter module may be to modify 1 to 5.
Accordingly, generating the target script file includes:
s204, generating a target script file according to the adjusted logic flow chart and the adjusted parameter list.
And adjusting the execution content and/or the execution sequence of the visualized logic flow chart, adjusting the parameter value of the parameter list, and then analyzing the adjusted logic flow chart and the adjusted parameter list to generate a target script file, wherein the target script file can be a script file in a pipeline format, a pipeline standard template is generated, and the analyzed execution content and the parameter value are correspondingly filled into the pipeline standard template according to the execution sequence of each logic unit in the adjusted logic flow chart to generate the target script file.
In the processing method of the script file in the embodiment, by stripping the parameter information in the script file and displaying the parameter list, the user can directly operate the parameter list to realize rapid adding and deleting or modifying operation, thereby greatly improving the working efficiency of development and maintenance personnel.
Fig. 3 is a flowchart of a method for processing a script file according to an embodiment of the present application, where, as shown in fig. 3, generating an adjusted logic flow chart according to the execution content and/or the execution sequence of the adjusted target logic unit may include:
s301, determining the execution sequence of other logic units according to the adjusted execution sequence of the target logic unit.
The other logic units are logic units except the target logic unit in the logic flow chart, the logic units respectively have execution sequences, and the execution sequences of the other logic units can be determined according to the execution sequences of the target logic units after adjustment because the execution content and/or the execution sequences of the target logic units are adjusted, for example, the execution sequence of the first logic unit in the logic flow chart is one, the execution sequence of the second logic unit is two, the execution sequence of the third logic unit is three, and the execution sequences of the first logic unit and the second logic unit are sequentially one and respectively two and three if the execution sequence of the adjusted third logic unit is one.
The adjusted target logic unit may be understood as a target logic unit with an adjusted execution content and/or an execution sequence, and if the execution content of the adjusted target logic unit is adjusted but the execution sequence is not adjusted, the execution sequence of the adjusted target logic unit in the adjusted logic flow chart is the same as that of the target logic unit in the unadjusted logic flow chart, and the execution content is different.
The device may be provided with a process stage module, and the process stage module is used to perform execution stage labeling on the adjusted target logic unit and other logic units in the adjusted logic flow chart, so as to obtain the execution sequence of the adjusted target logic unit and other logic units.
Taking the script of the two-stage processing step as an example, according to the position of the pages (stage set) in the script file to be processed, the sub-item pages contained in the script file to be processed are used as stage contents to carry out stage marking, in the example, two stages are contained in the script file to be processed at the same stage, and the processing flow for marking the script file to be processed comprises two stages which are executed in sequence.
S302, according to the execution sequence of the adjusted target logic unit and the execution sequence of other logic units, the adjusted target logic unit and the other logic units are sequentially ordered, and an adjusted logic flow chart is generated.
According to the execution sequence of the adjusted target logic unit and the execution sequence of other logic units, sequentially ordering the adjusted target logic unit and the other logic units, sequentially connecting the ordered adjusted target logic unit and the other logic units, and generating an adjusted logic flow chart, wherein the adjusted logic flow chart comprises: the adjusted target logic unit and other logic units which are sequentially connected from small to large according to the execution sequence, and connecting lines in the adjusted logic flow chart can also have directivity, and the logic unit with the front execution sequence points to the logic unit with the rear execution sequence.
It should be noted that, if the execution content of the adjusted target logic unit is adjusted, the execution content of the adjusted target logic unit is saved, and the adjusted target logic unit and other logic units are sequentially ordered according to the execution sequence of the adjusted target logic unit and the execution sequence of the other logic units, so as to generate an adjusted logic flow chart, where the adjusted logic flow chart includes the adjusted target logic unit and other logic units except the target logic unit in the plurality of logic units sequentially connected according to the execution sequence, and each logic unit in the adjusted logic flow chart has corresponding execution content.
For example, the logic flow diagram includes: the logic flow diagram sequentially comprises a first logic unit, a second logic unit and a third logic unit from front to back, wherein the execution sequence of the first logic unit is first, the execution sequence of the third logic unit is second, and the execution sequence of the second logic unit is third.
The content analysis may be performed on each logic unit to obtain a step execution sequence of each logic unit, taking the script of the two stage processing steps as an Example, and regarding steps as steps that can be independently executed, for a stage-Example Build, the steps are as follows:
echo'Hello,Maven'
sh'mvn--version'
for the phase two sample Test, the steps are:
echo'Hello,JDK'
h'java-version'
fig. 4 is a flow chart diagram of a method for processing a script file according to an embodiment of the present application, as shown in fig. 3, the generating a target script file according to the adjusted logic flow chart may include:
s401, analyzing the adjusted logic flow diagram to obtain execution contents of all logic units and execution sequences of all logic units in the adjusted logic flow diagram.
S402, generating a target script file according to preset logic keywords, execution contents of all logic units and execution sequences of all logic units.
Analyzing each node (logic unit) of the adjusted logic flow chart to obtain the execution content of each logic unit in the adjusted logic flow chart and the execution sequence of each logic unit in the adjusted logic flow chart, writing the execution content as information of the preset logic key word into a module where the preset logic key word is located according to the preset logic key word, then generating a preset standard script file template, such as a script file template in a pipeline format, and correspondingly filling the newly generated module into the preset standard script file template according to the execution sequence of each logic unit to generate a target script text.
It should be noted that, according to the execution sequence of each logic unit, the newly generated module and the adjusted parameter module may be filled into a preset standard script file template to generate the target script file.
In the script file processing method of the embodiment, the visualized logic flow chart is analyzed, and the target script file is reversely generated, so that the working efficiency of development and maintenance personnel is greatly improved.
Fig. 5 is a flowchart fifth of a method for processing a script file according to an embodiment of the present application, where, as shown in fig. 5, in response to a first adjustment operation corresponding to an execution content and/or an execution sequence of a target logic unit in a logic flow chart, adjusting the execution content of the target logic unit may include:
S501, in response to a selection operation for the target logic unit, displaying an execution content editing area of the target logic unit.
S502, adjusting the execution content and/or the execution sequence of the target logic unit in response to a first adjustment operation of the execution content and/or the execution sequence of the target logic unit, which is input through the execution content editing area.
After the visual presentation of the logic flow chart, a user can input a selection operation for a target logic unit in the logic flow chart through a visual interface at the front end of the device, the rear end of the device receives the selection operation, and in response to the selection operation, a logic editing area of the target logic unit is displayed, wherein the logic editing area is displayed with: the execution content and/or the execution order of the target logical unit.
And then, inputting a first adjustment operation of the execution content of the target logic unit through a logic editing area provided by the front end of the device, receiving the first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit input through the execution content editing area by the rear end of the device, and adjusting the execution content and/or the execution sequence of the target logic unit in response to the first adjustment operation.
Taking implementation of an execution script of an execution content and adjustment of the execution script as an Example, fig. 6 is a schematic diagram of a logic flow chart provided by an embodiment of the present application, and as shown in fig. 6, the logic flow chart includes four nodes sequentially connected, namely, a start node, a first logic unit (Example Build), a second logic unit (Example Test), and an end node, and may further display an identifier of the execution script 1 of the first logic unit at the first logic unit, and display an identifier of the execution script 1 of the second logic unit at the second logic unit.
The user selects the first logic unit or the execution script 1 of the first logic unit, and an execution script editing area of the first logic unit is displayed, wherein the execution script editing area can directly add, delete or modify the execution script 1 of the first logic unit.
It should be noted that, the execution sequence of the target logic unit may be adjusted by dragging the target logic unit in the logic flow chart displayed on the visual interface, for example, the logic flow chart includes a first logic unit, a second logic unit and a third logic unit that are sequentially connected, and the adjustment of the execution sequence of the first logic unit is implemented by dragging the first logic unit to the second logic unit.
Similarly, adjusting the parameter values in the target parameter module in response to a second adjustment operation for the parameter values in the target parameter module in the parameter list, comprising: and displaying a parameter value editing area of the target parameter module in response to the selection operation of the target parameter module, and adjusting the parameter value in the target parameter module in response to the second adjustment operation of the parameter value in the target parameter module, which is input through the parameter value editing area.
After visually presenting the parameter list, a user can input a selection operation for a target parameter module in the parameter list through a visual interface at the front end of the device, the rear end of the device receives the selection operation, and in response to the selection operation, a parameter value editing area of the target parameter module is displayed, wherein the parameter value editing area is displayed with: parameter values in the target parameter module.
And then, a second adjustment operation for the parameter value in the target parameter module is input through a parameter value editing area provided by the front end of the device, the rear end of the device receives the second adjustment operation for the parameter value in the target parameter module input through the parameter value editing area, and the parameter value in the target parameter module is adjusted in response to the second adjustment operation.
Fig. 7 is a schematic diagram of a parameter list provided in an embodiment of the present application, as shown in fig. 7, at least one parameter module in the parameter list, where parameter types in the at least one parameter module are respectively: agent, sending, environment and option, user selects parameter module corresponding to agent, displays parameter value edit area of agent, and adds parameter value, deletes parameter value or modifies parameter value directly in the parameter value edit area.
It should be noted that, options with parameter values may be displayed at each parameter type, including but not limited to any value, custom, none (no value), etc., where any value may be set for a corresponding parameter type by clicking any value, parameter values may be set according to actual requirements by clicking custom, parameter values may not be set for a corresponding parameter type by clicking none description, and this option may be set according to actual conditions.
Based on the same inventive concept, the embodiment of the application also provides a script file processing device corresponding to the script file processing method, and because the principle of solving the problem by the device in the embodiment of the application is similar to that of the script file processing method in the embodiment of the application, the implementation of the device can refer to the implementation of the method, and the repetition is omitted.
Fig. 8 is a schematic structural diagram of a script file processing apparatus according to an embodiment of the present application, where the apparatus may be integrated in an electronic device. As shown in fig. 8, the apparatus may include:
the splitting module 601 is configured to split a script file to be processed into a plurality of logic units according to a preset logic keyword, where the plurality of logic units respectively correspond to one execution content;
the generating module 602 is configured to generate and display a logic flow chart of the script file to be processed according to the plurality of logic units;
an adjustment module 603, configured to adjust the execution content and/or the execution sequence of the target logic unit in the logic flowchart in response to a first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit;
the generating module 602 is further configured to generate an adjusted logic flow chart according to the execution content and/or the execution sequence of the adjusted target logic unit, and generate a target script file.
In an alternative embodiment, the apparatus further comprises:
a determining module 604, configured to determine at least one parameter module from the script file to be processed according to a preset parameter type;
the generating module 602 is further configured to generate and display a parameter list of the script file to be processed according to the parameter type and the parameter value in the at least one parameter module;
The adjusting module 603 is further configured to adjust a parameter value in a target parameter module in the parameter list according to a second adjustment operation input for the parameter value in the target parameter module;
the generating module 602 is specifically configured to:
and generating a target script file according to the adjusted logic flow chart and the adjusted parameter list.
In an alternative embodiment, the generating module 602 is specifically configured to:
determining the execution sequence of other logic units according to the adjusted execution sequence of the target logic unit, wherein the other logic units are logic units except the target logic unit in the plurality of logic units;
and sequencing the adjusted target logic units and the other logic units in sequence according to the execution sequence of the adjusted target logic units and the execution sequence of the other logic units, so as to generate the adjusted logic flow chart.
In an alternative embodiment, the generating module 602 is specifically configured to:
analyzing the adjusted logic flow diagram to obtain the execution content of each logic unit in the adjusted logic flow diagram and the execution sequence of each logic unit;
And generating the target script file according to the preset logic key words, the execution content of each logic unit and the execution sequence of each logic unit.
In an alternative embodiment, the adjusting module 603 is specifically configured to:
in response to a selection operation for the target logical unit, a logical edit section of the target logical unit is presented, in which: the execution content and/or the execution sequence of the target logic unit;
and responding to the first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit, which is input through the logic editing area, and adjusting the execution content and/or the execution sequence of the target logic unit.
In an alternative embodiment, the generating module 602 is specifically configured to:
a target parameter module for determining an adjustable parameter value from the at least one parameter module;
and generating and displaying a parameter list of the script file to be processed according to the parameter type and the parameter value corresponding to the target parameter module.
In an alternative embodiment, the adjusting module 603 is specifically configured to:
in response to a selection operation for the target parameter module, a parameter value editing area of the target parameter module is displayed, wherein the parameter value editing area is displayed with: parameter values in the target parameter module;
And adjusting the parameter values in the target parameter module in response to the second adjustment operation for the parameter values in the target parameter module, which is input through the parameter value editing area.
The process flow of each module in the apparatus and the interaction flow between the modules may be described with reference to the related descriptions in the above method embodiments, which are not described in detail herein.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application, as shown in fig. 9, where the device may include: a processor 701, a memory 702, and a bus 703, the memory 702 storing machine-readable instructions executable by the processor 701, the processor 701 and the memory 702 communicating via the bus 703 when the electronic device is running, the processor 701 executing the machine-readable instructions to perform the method of processing script files described above.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium is stored with a computer program, the computer program is executed by a processor when being executed, and the processor executes the processing method of the script file.
In an embodiment of the present application, the computer program may further execute other machine readable instructions when executed by a processor to perform the method as described in other embodiments, and the specific implementation of the method steps and principles are referred to in the description of the embodiments and are not described in detail herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments provided in the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should be noted that: like reference numerals and letters in the following figures denote like items, and thus once an item is defined in one figure, no further definition or explanation of it is required in the following figures, and furthermore, the terms "first," "second," "third," etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present application, and are not intended to limit the scope of the present application, but it should be understood by those skilled in the art that the present application is not limited thereto, and that the present application is described in detail with reference to the foregoing examples: any person skilled in the art may, within the scope of the disclosure of the present application, still make modifications to the technical solutions described in the foregoing embodiments or easily conceive of changes, or make equivalent substitutions of some of the technical features thereof; such modifications, changes or substitutions do not depart from the spirit and scope of the corresponding technical solutions. Are intended to be encompassed within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A method for processing a script file, comprising:
splitting a script file to be processed into a plurality of logic units according to a preset logic keyword;
generating and displaying a logic flow chart of the script file to be processed according to the plurality of logic units, wherein the logic flow chart is generated by sequentially connecting the plurality of logic units according to the execution sequence of the plurality of logic units, and the execution sequence of each logic unit is the sequence of an execution script corresponding to each logic unit in the script file to be processed;
Responding to a first adjustment operation corresponding to the execution content and/or the execution sequence of a target logic unit in the logic flow chart, and adjusting the execution content and/or the execution sequence of the target logic unit;
generating an adjusted logic flow chart according to the execution content and/or the execution sequence of the adjusted target logic unit, and generating a target script file;
before the generating the target script file, the method further comprises:
determining at least one corresponding parameter module from the script file to be processed according to a preset parameter type;
generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in the at least one parameter module;
adjusting the parameter values in the target parameter module in response to a second adjustment operation for the parameter values in the target parameter module in the parameter list;
the generating the target script file includes:
and generating the target script file according to the adjusted logic flow chart and the adjusted parameter list.
2. The method according to claim 1, wherein the generating the adjusted logic flow diagram according to the execution content and/or the execution sequence of the adjusted target logic unit comprises:
Determining the execution sequence of other logic units according to the adjusted execution sequence of the target logic unit, wherein the other logic units are logic units except the target logic unit in the plurality of logic units;
and sequencing the adjusted target logic units and the other logic units in sequence according to the execution sequence of the adjusted target logic units and the execution sequence of the other logic units, so as to generate the adjusted logic flow chart.
3. The method of claim 1, wherein generating the target script file comprises:
analyzing the adjusted logic flow diagram to obtain the execution content of each logic unit in the adjusted logic flow diagram and the execution sequence of each logic unit;
and generating the target script file according to the preset logic key words, the execution content of each logic unit and the execution sequence of each logic unit.
4. The method according to claim 1, wherein the adjusting the execution contents and/or the execution sequence of the target logic unit in response to the first adjustment operation corresponding to the execution contents and/or the execution sequence of the target logic unit in the logic flow chart includes:
In response to a selection operation for the target logical unit, a logical edit section of the target logical unit is presented, in which: the execution content and/or the execution sequence of the target logic unit;
and responding to the first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit, which is input through the logic editing area, and adjusting the execution content and/or the execution sequence of the target logic unit.
5. The method according to claim 1, wherein generating and displaying the parameter list of the script file to be processed according to the parameter type and the parameter value in the at least one parameter module comprises:
a parameter module that determines an adjustable parameter value from the at least one parameter module;
and generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in the parameter module capable of adjusting the parameter values.
6. The method of claim 1, wherein adjusting the parameter values in the target parameter module in response to the second adjustment operation for the parameter values in the target parameter module in the parameter list comprises:
In response to a selection operation for the target parameter module, a parameter value editing area of the target parameter module is displayed, wherein the parameter value editing area is displayed with: parameter values in the target parameter module;
and adjusting the parameter values in the target parameter module in response to the second adjustment operation for the parameter values in the target parameter module, which is input through the parameter value editing area.
7. A script file processing apparatus, comprising:
the splitting module is used for splitting the script file to be processed into a plurality of logic units according to the preset logic keywords;
the generating module is used for generating and displaying a logic flow chart of the script file to be processed according to the plurality of logic units, wherein the logic flow chart is generated by sequentially connecting the plurality of logic units according to the execution sequence of the plurality of logic units, and the execution sequence of each logic unit is the sequence of an execution script corresponding to each logic unit in the script file to be processed;
the adjusting module is used for responding to a first adjusting operation corresponding to the execution content and/or the execution sequence of the target logic unit in the logic flow chart and adjusting the execution content and/or the execution sequence of the target logic unit;
The generation module is further used for generating an adjusted logic flow chart according to the execution content and/or the execution sequence of the adjusted target logic unit and generating a target script file;
the apparatus further comprises:
the determining module is used for determining at least one corresponding parameter module from the script file to be processed according to the preset parameter type;
the generating module is further used for generating and displaying a parameter list of the script file to be processed according to the parameter types and the parameter values in the at least one parameter module;
the adjusting module is further configured to adjust a parameter value in a target parameter module according to a second adjusting operation input for the parameter value in the target parameter module in the parameter list;
the generating module is specifically configured to:
and generating the target script file according to the adjusted logic flow chart and the adjusted parameter list.
8. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine readable instructions executable by the processor, the processor and the memory in communication over the bus when the electronic device is running, the processor executing the machine readable instructions to perform the method of processing a script file of any of claims 1 to 6.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the method of processing a script file according to any of claims 1 to 6.
CN202211506260.7A 2022-11-28 2022-11-28 Script file processing method, device, equipment and storage medium Active CN115794056B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211506260.7A CN115794056B (en) 2022-11-28 2022-11-28 Script file processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211506260.7A CN115794056B (en) 2022-11-28 2022-11-28 Script file processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115794056A CN115794056A (en) 2023-03-14
CN115794056B true CN115794056B (en) 2023-11-28

Family

ID=85442673

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211506260.7A Active CN115794056B (en) 2022-11-28 2022-11-28 Script file processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115794056B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096268A (en) * 2019-04-26 2019-08-06 北京知感科技有限公司 By the system and method for the executable program of the VR/AR/MR device secondary editor of stateization living
CN112667517A (en) * 2021-01-07 2021-04-16 卫宁健康科技集团股份有限公司 Method, device, equipment and storage medium for acquiring automatic test script
CN113778415A (en) * 2021-11-11 2021-12-10 深圳市越疆科技有限公司 ModBus communication script generation method and device based on graphical programming
CN114047953A (en) * 2021-11-05 2022-02-15 深圳Tcl新技术有限公司 Pipeline configuration method and device, computer equipment and storage medium
CN114968219A (en) * 2022-05-09 2022-08-30 中国三峡建工(集团)有限公司 Construction method based on visual dragging type logic analysis script

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096268A (en) * 2019-04-26 2019-08-06 北京知感科技有限公司 By the system and method for the executable program of the VR/AR/MR device secondary editor of stateization living
CN112667517A (en) * 2021-01-07 2021-04-16 卫宁健康科技集团股份有限公司 Method, device, equipment and storage medium for acquiring automatic test script
CN114047953A (en) * 2021-11-05 2022-02-15 深圳Tcl新技术有限公司 Pipeline configuration method and device, computer equipment and storage medium
CN113778415A (en) * 2021-11-11 2021-12-10 深圳市越疆科技有限公司 ModBus communication script generation method and device based on graphical programming
CN114968219A (en) * 2022-05-09 2022-08-30 中国三峡建工(集团)有限公司 Construction method based on visual dragging type logic analysis script

Also Published As

Publication number Publication date
CN115794056A (en) 2023-03-14

Similar Documents

Publication Publication Date Title
US20070162274A1 (en) Specifying a subset of dynamic inter-related data
CN106657192B (en) Method and equipment for presenting service calling information
US20030131342A1 (en) Debugger with activity alert
JP2013097470A (en) Source file reuse support device, source file reuse support method and program
CN114282129A (en) Information system page generation method, system, electronic equipment and storage medium
CN113590593A (en) Method and device for generating data table information, storage medium and electronic device
CN115794056B (en) Script file processing method, device, equipment and storage medium
CN111078562B (en) Interface test method, terminal device and computer readable storage medium
US20070225953A1 (en) Management system and management method of CAD data
CN111414168A (en) Web application development method and device based on mind map and electronic equipment
CN113495723B (en) Method, device and storage medium for calling functional component
CN114741158A (en) Page switching method, device, equipment and storage medium
JP5119765B2 (en) Specification creation support apparatus and support method
CN113656439A (en) Data query method and device, storage medium and electronic equipment
CN108170557B (en) Method and apparatus for outputting information
CN113495651A (en) Window control method and device
CN106569785B (en) Method and device for generating job form
CN111126015B (en) Report form compiling method and equipment
CN111290870A (en) Method and device for detecting abnormity
CN117453548B (en) Code module information determining method, apparatus, computer device and storage medium
CN116414385A (en) Interface state display method and device, electronic equipment and storage medium
CN115857941A (en) Code data display method and device, electronic equipment and storage medium
JP2022122699A (en) Information generating program, information processing apparatus, and information generating method
CN117573130A (en) Code processing method, device, electronic equipment and storage medium
CN116991735A (en) Front-end component change testing system, method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant