CN115794056A - 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
CN115794056A
CN115794056A CN202211506260.7A CN202211506260A CN115794056A CN 115794056 A CN115794056 A CN 115794056A CN 202211506260 A CN202211506260 A CN 202211506260A CN 115794056 A CN115794056 A CN 115794056A
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.)
Granted
Application number
CN202211506260.7A
Other languages
Chinese (zh)
Other versions
CN115794056B (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

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides a processing method, a device, equipment and a storage medium of a script file, wherein the method comprises the following steps: the method comprises the steps of 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, adjusting the execution content and/or the execution sequence of a target logic unit in response 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, generating an adjusted logic flow chart according to the adjusted execution content and/or the adjusted execution sequence of the target logic unit, and generating the target script file. According to the method and the device, the script file is combed into the visual logic flow chart according to the logic keywords, the logic units needing to be adjusted can be quickly checked on the flow chart through the display of the logic flow chart, the corresponding execution content and/or the execution sequence are/is directly adjusted, and 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
With the change of business requirements, software developers often need to adjust the original script file when continuously integrating script writing, and in some cases, need to sequentially adjust the repeated contents in the original script file.
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 a code position required to be adjusted.
However, the above method has high requirements for developers, and the manual determination of the code position to be adjusted is prone to errors and has low accuracy.
Disclosure of Invention
In view of this, 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 problems that in the prior art, when a script file is manually checked to determine a code position that needs to be adjusted, an error is prone to occur, and accuracy is not high.
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 correspond to one execution content respectively;
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 adjusting 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 and an object script file according to the execution content and/or the execution sequence of the adjusted object logic unit.
In an optional embodiment, before 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 type and the parameter value in the at least one parameter module;
adjusting the parameter values in the target parameter module according to a second adjustment operation input aiming at the parameter values in the target parameter module in the parameter list;
the generating of the target script file comprises:
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 chart according to the execution content and/or the execution sequence of the adjusted target logic unit, wherein the method comprises the following steps:
determining an 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 unit and the other logic units in sequence according to the execution sequence of the adjusted target logic unit and the execution sequence of the other logic units to generate the adjusted logic flow chart.
In an optional implementation manner, the generating the target script file according to the adjusted logic flowchart includes:
analyzing the adjusted logic flow chart to obtain the execution content of each logic unit and the execution sequence of each logic unit in the adjusted logic flow chart;
and generating the target script file according to the preset logic keywords, 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 order of the target logic unit in response to the first adjustment operation corresponding to the execution content and/or the execution order of the target logic unit in the logic flow diagram includes:
in response to a selection operation for the target logical unit, presenting a logical edit area of the target logical unit, in which: the execution content and/or the execution sequence of the target logic unit;
and 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, which is input through the logic editing area.
In an optional implementation manner, the generating and displaying 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 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 type and the parameter value in the parameter module with the adjustable parameter value.
In an optional embodiment, the adjusting the parameter value in the target parameter module in response to the second adjusting operation for the parameter value in the target parameter module in the parameter list includes:
responding to the selection operation aiming at the target parameter module, and displaying a parameter value editing area of the target parameter module, wherein the parameter value editing area displays: a parameter value in the target parameter module;
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 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 a preset logic keyword, and the plurality of logic units correspond to one execution content respectively;
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;
and the generating module is further used for generating an adjusted logic flow chart according to the adjusted execution content and/or execution sequence of the target logic unit and generating a target script file.
In an optional 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 a 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 type and the parameter value in the at least one parameter module;
the adjusting module is further configured to adjust the parameter value in the target parameter module according to a second adjusting operation input for the parameter value in the target parameter module in the parameter list;
the generation 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 optional implementation manner, the generating module is specifically configured to:
determining an 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 unit and the other logic units in sequence according to the execution sequence of the adjusted target logic unit and the execution sequence of the other logic units to generate the adjusted logic flow chart.
In an optional implementation manner, the generating module is specifically configured to:
analyzing the adjusted logic flow chart to obtain the execution content of each logic unit and the execution sequence of each logic unit in the adjusted logic flow chart;
and generating the target script file according to the preset logic keywords, the execution content of each logic unit and the execution sequence of each logic unit.
In an optional implementation manner, the adjusting module is specifically configured to:
in response to a selection operation for the target logical unit, presenting a logical edit area of the target logical unit, in which: the execution content and/or the execution sequence of the target logic unit;
and 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, which is input through the logic editing area.
In an optional implementation manner, 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 type and the parameter value in the parameter module with the adjustable parameter value.
In an optional embodiment, the adjusting module is specifically configured to:
responding to the selection operation aiming at the target parameter module, and displaying a parameter value editing area of the target parameter module, wherein the parameter value editing area displays: a parameter value in the target parameter module;
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 input through the parameter value editing area.
In a third aspect, an embodiment of the present application further provides an electronic device, including: 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 communicate with each other through the bus, and the processor executes the machine-readable instructions to execute the method for processing the script file according to any one 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 on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the method for processing the script file according to any one of the first aspects.
The application provides a processing method, a device, equipment and a storage medium of a script file, wherein the method comprises the following steps: the method comprises the steps of 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, adjusting the execution content and/or the execution sequence of a target logic unit in response 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, generating an adjusted logic flow chart according to the adjusted execution content and/or the adjusted execution sequence of the target logic unit, and generating the target script file. According to the method and the device, the script file is combed into the visual logic flow chart according to the logic keywords, the logic units needing to be adjusted can be quickly checked on the flow chart through the display of the logic flow chart, the corresponding execution content and/or the execution sequence are directly adjusted, and the accuracy and the working efficiency are greatly improved.
In order to make the aforementioned 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 required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a first flowchart illustrating a method for processing a script file according to an embodiment of the present application;
fig. 2 is a second flowchart illustrating a method for processing a script file according to an embodiment of the present application;
fig. 3 is a third schematic flowchart of a method for processing a script file according to an embodiment of the present application;
fig. 4 is a fourth flowchart illustrating a method for processing a script file according to an embodiment of the present application;
fig. 5 is a fifth flowchart illustrating a processing method of a script file according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a logic flow provided by an embodiment of the present application;
FIG. 7 is a diagram illustrating a parameter list provided by an embodiment of the present application;
fig. 8 is a schematic structural diagram of a processing apparatus for a script file 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
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
Based on the prior art, a text tool is adopted to determine repeated contents of a script file, and an adjusted code position is determined manually to perform different logic modification or parameter modification on the repeated contents, so that not only is a developer required to be familiar with the script contents and more familiar with business logic to accurately analyze the code position required to be modified, but also the developer is required to have higher requirements and lower accuracy.
The following describes a method for processing a script file provided by the present application with reference to several embodiments.
Fig. 1 is a first flowchart illustrating a method for processing a script file according to an embodiment of the present application, where an execution main body of the embodiment may be an electronic device, such as a terminal, a server, and other devices with data processing capabilities.
As shown in fig. 1, the method may include:
s101, splitting the script file to be processed into a plurality of logic units according to preset logic keywords.
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 service logic, the plurality of logic units respectively have corresponding execution contents, and the execution contents can be realized through the execution script, namely the script file to be processed comprises the execution scripts corresponding to the plurality of logic units.
The split logic units may have an execution sequence, which is used to indicate the sequence of the execution script corresponding to each logic unit 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, and the execution sequence of the third logic unit is a third bit, which indicates that the execution sequence of the execution script in the script file to be processed is 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, 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 together implement the overall business logic of the script file to be processed.
It should be noted that the script file to be processed may be a script file in any format, for example, 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, the standard syntax keywords of the script file in pipeline format include, but are not limited to: pipeline, stages, steps, where the position in the text where the keyword pipeline is located should be the beginning position, and the script allows default value writing, and format check may also be provided for confirming whether parsing conversion is possible.
The preset logic keyword may be a standard syntax keyword of a script file in a pipeline format, and may be, for example, a stage (stage), that is, the stage splits the to-be-scripted file into a plurality of stages, and each stage is a logic unit. Scripts with two phase 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'
}
}
}
}
as can be seen from the above, the script file in the pipeline format includes two stages, and the script file can be split into two logical units (i.e. code blocks) by using the structural features of the pipeline syntax format, where the logical unit named Example Build is:
stage('Example Build'){
steps{
echo'Hello,Maven'
sh'mvn--version'
}
}
the logical units named Example Test are:
stage('Example Test'){
steps{
echo'Hello,JDK'
sh'java-version'
}
}
}
and 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 plurality of logic units, the plurality of logic units are sequentially connected to generate and display a logic flow chart of the script file to be processed, the logic flow chart comprises a plurality of logic units, each logic unit corresponds to one execution content, and taking the Example of the Example Build, the corresponding execution script is as follows:
steps{
echo'Hello,Maven'
sh'mvn--version'
}
}
taking the Example of the Example Test, the corresponding execution script is:
steps{
echo'Hello,JDK'
sh'java-version'
}
and S103, adjusting the execution content and/or the execution sequence of the target logic unit 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.
The target logic unit may be a logic unit to be adjusted in the logic flow diagram, and the first adjustment operation is used to adjust the execution content and/or the execution order of the target logic unit, including but not limited to adding, deleting, modifying the execution content, and adjusting the execution order of the target logic unit in the logic flow diagram.
The logic units in the logic flow chart respectively have an execution sequence for indicating an execution sequence of the execution scripts 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, and 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 by 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, which is two and three, respectively.
After generating the logic flow diagram and displaying the logic flow diagram on a visualization interface, a user can input a first adjusting operation corresponding to the execution content and/or the execution sequence of a target logic unit in the logic flow diagram through the visualization interface at the front end of the device according to actual needs, the back end of the device receives the first adjusting operation, and adjusts the execution content and/or the execution mature sequence of the target logic unit according to the first adjusting 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 diagram.
For example, if the execution content of the target logic unit is used to implement a multiplication operation of a and B, the adjustment of the execution content of the target logic unit may modify the multiplication operation between a and B into an addition operation, i.e., modify the business logic implemented by the target logic unit.
And S104, generating an adjusted logic flow chart according to the adjusted execution content and/or execution sequence of the target logic unit, and generating a target script file.
After the execution content and/or the execution sequence of the target logic unit are adjusted, the execution content and/or the execution sequence of the adjusted target logic unit can be saved, an adjusted logic flow chart is generated according to the execution content and/or the execution sequence of the adjusted target logic unit, the adjusted logic flow chart comprises the adjusted target logic unit and other logic units except the target logic unit, which are sequentially connected according to the execution sequence, and the adjusted logic flow chart is analyzed to generate a 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 a preset logic keyword, 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 a target logic unit are 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 an adjusted logic flow chart is generated according to the adjusted execution content and/or the adjusted execution sequence of the target logic unit, and a target script file is generated. Therefore, through the display of the logic flow chart, the logic units needing to be adjusted are quickly checked on the flow chart, the corresponding execution content and/or the execution sequence are directly adjusted, and the accuracy and the working efficiency are greatly improved.
Fig. 2 is a second flowchart illustrating a processing method of a script file according to an embodiment of the present application, and 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, and 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 the at least one parameter module is a preset parameter type, where the preset parameter type may be, for example, agent, environment, and parameters, and each parameter module includes: one parameter type and parameter values, wherein one parameter type is any one of preset parameter types, that is, the parameter type included in the parameter module may be any one of agent, environment, and parameters.
S202, 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.
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, wherein the parameter list comprises: the script file processing method comprises the steps of analyzing at least one parameter module according to a grammar analysis method of preset parameter types to obtain the parameter types and parameter values of each parameter module, storing the parameter types and parameter values in a key value table mode to obtain a parameter list of the script file to be processed, wherein in the parameter list, keys are the parameter types, and values are the parameter values.
In an optional 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 type and the parameter value in the parameter module with the adjustable parameter value.
In order to avoid invalid display of the parameter module with the unadjustable parameter value, the parameter module with the adjustable parameter value can be determined from the at least one parameter module, and a parameter list of the file to be scripted is generated and displayed according to the parameter type and the parameter value in the parameter module with the adjustable parameter value, wherein the parameter list comprises: a parameter module capable of adjusting parameter values.
S203, responding to the second adjusting operation aiming at 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 to adjust a parameter value in the target parameter module, including but not limited to adding, deleting, and modifying the parameter value.
After the parameter list is generated and displayed on the visual interface, a user can input a second adjustment operation aiming at the parameter value in the target parameter module in the parameter list through visual decoding at the front end of the equipment according to actual requirements, and the rear end of the equipment 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, the adjustment to the parameter value in the target parameter module may be to modify 1 to 5.
Accordingly, generating an object script file includes:
and S204, generating a target script file according to the adjusted logic flow chart and the adjusted parameter list.
The method comprises the steps of adjusting execution content and/or execution sequence of a visual logic flow chart, adjusting parameter values of a parameter list, analyzing the adjusted logic flow chart and the adjusted parameter list to generate a target script file, generating a pipeline standard template by the target script file which can be a pipeline script file, and correspondingly filling the execution content and the parameter values obtained through analysis 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, a user can directly operate the parameter list to realize rapid addition and deletion or modification operation, thereby greatly improving the working efficiency of development and maintenance personnel.
Fig. 3 is a third schematic flowchart of a processing method of a script file provided in an embodiment of the present application, and as shown in fig. 3, generating an adjusted logic flowchart according to execution content and/or execution sequence of an 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 plurality of logic units, the plurality of logic units in the logic flow chart respectively have execution sequences, and as the execution content and/or the execution sequence of the target logic unit are adjusted, the execution sequences of the other logic units can be determined according to the adjusted execution sequence of the target logic unit, 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 if the adjusted execution sequence of the third logic unit is one, the execution sequences of the first logic unit and the second logic unit are sequentially backed off by one, and are respectively two and three.
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 diagram is the same as that of the target logic unit in the unadjusted logic flow diagram, and the execution content is different.
The device may be provided with a flow stage module, and the flow stage module is used to perform execution stage labeling on the adjusted target logic unit and other logic units in the adjusted logic flow diagram, so as to obtain an execution sequence of the adjusted target logic unit and other logic units.
Taking the script of the two stage processing steps as an example, according to the position of a stage (stage set) in the to-be-processed script file, the sub-item stage contained in the to-be-processed script file is used as the stage content for stage marking, in this example, if two stages are contained at the same level, the processing flow for marking the to-be-processed script file includes two stages which are sequentially executed.
S302, sequencing the adjusted target logic unit and other logic units in sequence according to the execution sequence of the adjusted target logic unit and the execution sequence of other logic units, and generating an adjusted logic flow chart.
According to the execution sequence of the adjusted target logic unit and the execution sequence of other logic units, sequentially sequencing the adjusted target logic unit and other logic units, and sequentially connecting the sequenced adjusted target logic unit and other logic units to generate an adjusted logic flow chart, wherein the adjusted logic flow chart comprises: the adjusted target logic unit and other logic units are connected in sequence 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 back 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 order of the adjusted target logic unit and the execution order of 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, which are sequentially connected according to the execution order, and each logic unit in the adjusted logic flow chart has a corresponding execution content.
For example, the logic flow diagrams include: the logic flow chart comprises a first logic unit, a second logic unit and a third logic unit, wherein the execution sequence of the first logic unit is that 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, and then the first logic unit, the third logic unit and the second logic unit are sequentially connected from front to back.
Wherein, it can also analyze the content of each logic unit to obtain the step execution sequence of each logic unit, taking the scripts of the two stage processing steps as an Example, regarding steps as an independently executable step, and for stage one Example Build, the steps are:
echo'Hello,Maven'
sh'mvn--version'
for stage two Example Test, the procedure is:
echo'Hello,JDK'
h'java-version'
fig. 4 is a fourth flowchart of a processing method of a script file provided in the embodiment of the present application, and as shown in fig. 3, generating a target script file according to the adjusted logic flowchart may include:
s401, analyzing the adjusted logic flow chart to obtain the execution content of each logic unit and the execution sequence of each logic unit in the adjusted logic flow chart.
S402, generating a target script file according to the preset logic keywords, the execution content of each logic unit and the execution sequence of each logic unit.
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 serving as the information of the preset logic keyword into a module where the preset logic keyword is located according to the preset logic keyword, 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 in a preset standard script file template to generate a target script file.
In the script file processing method of the embodiment, the visual logic flow chart is analyzed, and the target script file is generated reversely, so that the working efficiency of development and maintenance personnel is greatly improved.
Fig. 5 is a fifth flowchart illustrating a processing method of a script file according to an embodiment of the present application, where as shown in fig. 5, adjusting the execution content of a target logic unit in response to a first adjustment operation corresponding to the execution content and/or the execution sequence of the target logic unit in a logic flowchart may include:
s501, responding to the selection operation aiming at the target logic unit, and displaying the execution content editing area of the target logic unit.
S502, in response to the first adjusting operation which is input by the execution content editing area and aims at the execution content and/or the execution sequence of the target logic unit, adjusting the execution content and/or the execution sequence of the target logic unit.
After the logic flow chart is visually presented, 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 back end of the device receives the selection operation and responds to the selection operation to display a logic editing area of the target logic unit, and the logic editing area is displayed with: the execution content and/or execution order of the target logical unit.
And then inputting a first adjustment operation aiming at the execution content of the target logic unit through a logic editing area provided by the front end of the equipment, receiving a first adjustment operation corresponding to the execution content and/or the execution sequence aiming at the target logic unit and input through the execution content editing area by the back end of the equipment, and adjusting the execution content and/or the execution sequence of the target logic unit in response to the first adjustment operation.
Taking the implementation of the execution content execution script and the adjustment of the execution script as examples, fig. 6 is a schematic diagram of a logic flow chart provided in the embodiment of the present application, as shown in fig. 6, the logic flow chart includes four nodes connected in sequence, which are respectively a start node, a first logic unit (Example Build), a second logic unit (Example Test), and an end node, and further, an identifier of the execution script 1 of the first logic unit may be displayed at the first logic unit, and an identifier of the execution script 1 of the second logic unit may be displayed 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 1 of the first logic unit can be directly added, deleted or modified in the execution script editing area.
It should be noted that the execution order of the target logic unit may also 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 which are sequentially connected, and the adjustment of the execution order of the first logic unit is realized by dragging the first logic unit to the second logic unit.
Similarly, in response to a second adjustment operation for a parameter value in a target parameter module in the parameter list, adjusting the parameter value in the target parameter module includes: and displaying the parameter value editing area of the target parameter module in response to the selection operation aiming at the target parameter module, and adjusting the parameter value in the target parameter module in response to a second adjustment operation aiming at the parameter value in the target parameter module, which is input through the parameter value editing area.
After the parameter list is visually presented, a user can input a selection operation aiming at a target parameter module in the parameter list through a visual interface at the front end of the equipment, the rear end of the equipment receives the selection operation and responds to the selection operation to display a parameter value editing area of the target parameter module, and the parameter value editing area is displayed with: parameter values in the target parameter module.
And then inputting a second adjustment operation aiming at parameter values in the target parameter module through a parameter value editing area provided by the front end of the equipment, receiving the second adjustment operation aiming at the parameter values in the target parameter module and input through the parameter value editing area by the rear end of the equipment, and responding to the second adjustment operation to adjust the parameter values in the target parameter module.
Fig. 7 is a schematic diagram of a parameter list provided in an embodiment of the present application, and as shown in fig. 7, the parameter types in at least one parameter module in the parameter list are respectively: the method comprises the steps of proxy, sending, environment and option, wherein a user selects a parameter module corresponding to the proxy, and a parameter value editing area of the proxy is displayed, and parameter values can be directly added, deleted or modified in the parameter value editing area.
It should be noted that options of parameter values may also be displayed at each parameter type, including but not limited to any value, self-definition, none (no value), and the like, where clicking any may set any value for a corresponding parameter type, clicking self-definition may set a parameter value according to actual requirements, clicking none may not set a parameter value for a corresponding parameter type, and regarding the option, setting may be according to actual conditions, this embodiment is not particularly limited to this, where any and none may directly set a parameter value without displaying a parameter value editing region, and self-definition may set a parameter value through a parameter value editing region.
Based on the same inventive concept, the embodiment of the present application further provides a device for processing a script file corresponding to the method for processing a script file, and since the principle of solving the problem of the device in the embodiment of the present application is similar to the method for processing a script file described above in the embodiment of the present application, the implementation of the device may refer to the implementation of the method, and repeated details are not described again.
Fig. 8 is a schematic structural diagram of a processing apparatus for a script file 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 the script file to be processed into a plurality of logic units according to a preset logic keyword, where the plurality of logic units correspond to one execution content respectively;
a generating module 602, configured to generate and display a logic flowchart of the script file to be processed according to the multiple logic units;
an adjusting module 603, configured to adjust an execution content and/or an execution order of a target logic unit in the logic flowchart in response to a first adjusting operation corresponding to the execution content and/or the execution order of the target logic unit;
the generating module 602 is further configured to generate an adjusted logic flowchart according to the execution content and/or the execution sequence of the adjusted target logic unit, and generate a target script file.
In an optional 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 adjusting 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 optional implementation, the generating module 602 is specifically configured to:
determining an 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 unit and the other logic units in sequence according to the execution sequence of the adjusted target logic unit and the execution sequence of the other logic units to generate the adjusted logic flow chart.
In an optional embodiment, the generating module 602 is specifically configured to:
analyzing the adjusted logic flow chart to obtain the execution content of each logic unit and the execution sequence of each logic unit in the adjusted logic flow chart;
and generating the target script file according to the preset logic keywords, the execution content of each logic unit and the execution sequence of each logic unit.
In an optional embodiment, the adjusting module 603 is specifically configured to:
in response to a selection operation for the target logical unit, presenting a logical edit area of the target logical unit, in which: the execution content and/or the execution sequence of the target logic unit;
and 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, which is input through the logic editing area.
In an optional implementation, the generating module 602 is specifically configured to:
a target 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 type and the parameter value corresponding to the target parameter module.
In an optional implementation, the adjusting module 603 is specifically configured to:
responding to the selection operation aiming at the target parameter module, and displaying a parameter value editing area of the target parameter module, wherein the parameter value editing area displays: a parameter value in the target parameter module;
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 input through the parameter value edit area.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 9, the electronic device may include: the processor 701, the memory 702 and the bus 703, the memory 702 stores machine-readable instructions executable by the processor 701, when the electronic device runs, the processor 701 and the memory 702 communicate through the bus 703, and the processor 701 executes the machine-readable instructions to execute the processing method of the script file.
The embodiment of the application also provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the processor executes the processing method of the script file.
In the embodiments of the present application, when being executed by a processor, the computer program may further execute other machine-readable instructions to perform other methods as described in the embodiments, and for details of the method steps and principles of the specific execution, reference is made to the description of the embodiments and detailed descriptions are omitted here.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into 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 such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures, and moreover, 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-mentioned embodiments are only specific embodiments of the present application, and are used to illustrate the technical solutions of the present application, but not to limit the technical solutions, and the scope of the present application is not limited to the above-mentioned embodiments, although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can adjust or easily conceive the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present application, or make equivalent substitutions for some technical features; such modifications, changes or substitutions do not depart from the spirit and scope of the present disclosure. Are intended to be covered by 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 (10)

1. A method for processing a script file, comprising:
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 plurality of logic units;
responding to a first adjusting 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 and an object script file according to the execution content and/or the execution sequence of the adjusted object logic unit.
2. The method of claim 1, wherein prior to 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 type and the parameter value 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 of the target script file comprises:
and generating the target script file according to the adjusted logic flow chart and the adjusted parameter list.
3. The method according to claim 1, wherein generating the adjusted logic flow diagram according to the execution content and/or the execution sequence of the adjusted target logic unit comprises:
determining an 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 unit and the other logic units in sequence according to the execution sequence of the adjusted target logic unit and the execution sequence of the other logic units to generate the adjusted logic flow chart.
4. The method of claim 1, wherein generating the object script file comprises:
analyzing the adjusted logic flow chart to obtain the execution content of each logic unit and the execution sequence of each logic unit in the adjusted logic flow chart;
and generating the target script file according to the preset logic keywords, the execution content of each logic unit and the execution sequence of each logic unit.
5. The method according to claim 1, wherein the adjusting the execution content and/or the execution order of the target logical unit in response to a first adjustment operation corresponding to the execution content and/or the execution order of the target logical unit in the logic flow diagram comprises:
in response to a selection operation for the target logical unit, presenting a logical edit area of the target logical unit, in which: the execution content and/or the execution sequence of the target logic unit;
and 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, which is input through the logic editing area.
6. The method according to claim 2, wherein 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 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 type and the parameter value in the parameter module with the adjustable parameter value.
7. The method of claim 2, 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:
responding to the selection operation aiming at the target parameter module, and displaying a parameter value editing area of the target parameter module, wherein the parameter value editing area displays: a parameter value in the target parameter module;
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 input through the parameter value editing area.
8. An apparatus for processing a script file, comprising:
the splitting module is used for splitting the script file to be processed into a plurality of logic units according to a preset logic keyword;
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;
and the generating module is further used for generating an adjusted logic flow chart according to the adjusted execution content and/or execution sequence of the target logic unit and generating a target script file.
9. An electronic device, comprising: 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 communicate through the bus, and the processor executes the machine-readable instructions to execute the processing method of the script file according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, performs the method of processing a script file according to any one of claims 1 to 7.
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 true CN115794056A (en) 2023-03-14
CN115794056B 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
CN115794056B (en) 2023-11-28

Similar Documents

Publication Publication Date Title
CN108897496B (en) Disk array configuration management method and device, computer equipment and storage medium
CN113360144B (en) Auxiliary processing method, device, storage medium and program product for software development
CN109710631A (en) Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN113590593A (en) Method and device for generating data table information, storage medium and electronic device
CN112685040A (en) Method, device, equipment and storage medium for generating interface file in android system
CN115794056B (en) Script file processing method, device, equipment and storage medium
CN114201382A (en) Test case generation method and device, storage medium and electronic equipment
CN116009847A (en) Code generation method, device, electronic equipment and storage medium
CN116049215A (en) Method, device, electronic equipment and medium for inquiring options
CN114579120A (en) Application code processing method and device, electronic equipment and storage medium
CN114518881A (en) Page generation method, system and storage medium
CN114490519A (en) GIM file analysis method, device, equipment and storage medium
CN113626409B (en) Test data processing method, device, equipment and storage medium
CN117519837B (en) Interface management method and interface management system
CN115576265B (en) PLC equipment simulation method, device, equipment and storage medium
CN111126015B (en) Report form compiling method and equipment
CN111522737B (en) Automatic test verification method and device for front-end interface and storage medium
CN112486847B (en) Error reproduction method, apparatus, system, device and storage medium
CN116521616A (en) Baseline management method, device, electronic equipment and storage medium
US8136059B2 (en) Indeterminate state logic insertion
CN117573130A (en) Code processing method, device, electronic equipment and storage medium
CN115879966A (en) Quotation automatic generation method, device, equipment and storage medium
CN116501752A (en) Data query method, device, electronic equipment and storage medium
CN116775197A (en) Algorithm editing method and device

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