CN111857679B - Method and device for generating script program and script program processing system - Google Patents
Method and device for generating script program and script program processing system Download PDFInfo
- Publication number
- CN111857679B CN111857679B CN201910354019.9A CN201910354019A CN111857679B CN 111857679 B CN111857679 B CN 111857679B CN 201910354019 A CN201910354019 A CN 201910354019A CN 111857679 B CN111857679 B CN 111857679B
- Authority
- CN
- China
- Prior art keywords
- script
- script program
- program
- input
- description information
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000004364 calculation method Methods 0.000 claims abstract description 59
- 238000012795 verification Methods 0.000 claims description 81
- 230000006870 function Effects 0.000 claims description 73
- 238000012360 testing method Methods 0.000 claims description 42
- 238000004088 simulation Methods 0.000 claims description 22
- 230000004044 response Effects 0.000 claims description 15
- 238000012545 processing Methods 0.000 claims description 10
- 230000008569 process Effects 0.000 claims description 6
- 238000011161 development Methods 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 15
- 238000007781 pre-processing Methods 0.000 description 6
- 230000003993 interaction Effects 0.000 description 4
- 238000004590 computer program Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013481 data capture Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The present disclosure provides a method and system for generating script programs. In the method, script basic description information, input/output definition information, and calculation function description information are received. Then, based on the script basic description information, the input/output definition information, and the calculation function description information, a script program and a script program description file are generated. By using the method, a script writer can write the script without having experience in script programming and development of the edge device.
Description
Technical Field
The present disclosure relates generally to the field of edge computing, and more particularly, to a method and apparatus for generating a script program and a script program processing system.
Background
As cloud servers cannot withstand more and more devices and data, and the delay of the cloud servers due to unavoidable network traffic cannot meet real-time applications, edge computation becomes increasingly important. Data preprocessing in edge devices, including, for example, data filtering, aggregation of factory references, or computation, is widely used in industrial internet of things solutions. Typically, data preprocessing in an edge device is implemented using script programs.
In current data preprocessing solutions used in edge devices, development script programs need to be customized for each industrial application instance. In addition, when the script program development is performed, not only script programming and edge device development experience are required, but also domain knowledge of the industrial application instance, such as knowing the meaning of data acquired by the edge device under the industrial application instance and the data processing flow for the data, is required. However, in practical applications, the script program developer usually only has script programming and edge device development experience, but does not have domain knowledge of an industrial application instance, so that communication with a domain expert is required to obtain corresponding domain knowledge when the script program development is performed, which results in low script program development efficiency.
In addition, in performing script program development, script development tools used by developers are expensive and heavy and are not suitable for industrial application scenarios requiring only low cost and lightweight preprocessing.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a method, apparatus, and script program processing system for generating a script program. By using the method and the system, the script program is automatically generated by providing the script basic description information, the input/output definition information and the calculation function description information required by script program generation and based on the input script basic description information, the input/output definition information and the calculation function description information, so that script program writers are not required to have script programming and edge equipment development experience.
According to one aspect of the present disclosure, there is provided a method for generating a script program, comprising: receiving script basic description information, input/output definition information and calculation function description information; and generating a script program and a script program description file based on the script basic description information, the input/output definition information, and the calculation function description information.
By utilizing the method, the required script basic description information, input/output definition information and calculation function description information are generated by receiving the script program input by a script program writer, and the script program is generated based on the input script basic description information, the input/output definition information and the calculation function description information, so that the script program writer does not need to have script programming and edge equipment development experience.
Optionally, in one example of the above aspect, generating a script program based on the script basic description information, the input/output definition information, and the calculation function description information includes: the script program is generated using a script program template based on the script basic description information, the input/output definition information, and the calculation function description information.
By using the method, the script program is automatically generated by using the script program template, so that the script program is written more conveniently.
Optionally, in one example of the above aspect, the method may further include: after receiving a trigger request generated by a script program, displaying a script editing interface, wherein the script editing interface comprises a script basic description input area, an input/output definition input area and a calculation function description input area; and receiving script basic description information, input/output definition information, and calculation function description information includes: script basic description information, input/output definition information, and calculation function description information input via the script editing interface are received.
By using the method, script basic description information, input/output definition information and calculation function description information required by script program generation are input by providing a script editing interface for script program writers, so that the input process of information required by the script program becomes more visual and concise.
Optionally, in one example of the above aspect, the method may further include: performing script verification on the generated script program; and in response to the script verification passing, storing the generated script program description file and the script program in a script program description file database and a script program database respectively for the configuration file generating device and the script program application device to call.
By using the method, when the script program is generated, the script program is required to be checked, and when the script check passes, the generated script program and the script program description file are stored, so that the correctness of the generated script program can be ensured.
Optionally, in one example of the above aspect, the script editing interface includes a script verification result display area, and before storing the generated script program description file and the script program in the script program description file database and the script program database, respectively, the method may further include: and displaying a script verification result aiming at the script program in the script verification result display area.
By using the method, the script verification result for the script program is displayed before the script program description file and the script program are stored, and the script program description file and the script program are stored only when the script verification is passed, so that the generated script program can be interactively verified, thereby avoiding generating an error script program and further avoiding deploying an error function on the edge equipment. In addition, when the script program writer learns that the script verification fails through the script verification result displayed in the script verification result display area, the script basic description input area, the input/output definition input area and/or the content input of the computing function description input area can be adjusted on the script editing interface, and the script program is generated again for verification based on the adjusted content input, so that the script program generation operation is simpler and more convenient.
Optionally, in one example of the above aspect, the script verification includes a grammar verification and a script test verification.
Optionally, in one example of the above aspect, the script editing interface includes a script syntax check result display area, a simulation data input area, and a script test check result display area, and displaying a script check result for a script program in the script check result display area may include: displaying a script grammar check result aiming at the script program in the script grammar check result display area; and displaying a script test verification result for the script program in the script test verification result display area in response to completion of input of the simulation data, the script test verification result being obtained by running the script program using the simulation data.
By utilizing the method, script test verification can be triggered by inputting the simulation data in the simulation data input area, so that script test verification for the script program is realized.
Optionally, in one example of the above aspect, the script editing interface includes a script program publishing area, and the method may further include: and publishing the generated script program in the script program publishing area for use by the script program application device.
By utilizing the method, the generated script program can be intuitively displayed in the script editing interface, so that script program writers can intuitively know the generated script program information.
Optionally, in one example of the above aspect, the script program application device is an edge device.
According to another aspect of the present disclosure, there is provided an apparatus for generating a script program, comprising: an information receiving unit configured to receive script basic description information, input/output definition information, and calculation function description information; a script program generating unit configured to generate a script program based on the script basic description information, the input/output definition information, and the calculation function description information; and a script program description file generating unit configured to generate a script program description file based on the script basic description information, the input/output definition information, and the calculation function description information.
Optionally, in one example of the above aspect, the script program generating unit is configured to: the script program is generated using a script program template based on the script basic description information, the input/output definition information, and the calculation function description information.
Optionally, in one example of the above aspect, the apparatus may further include: the interface display unit is configured to display a script editing interface after receiving a script program generation trigger request, wherein the script editing interface comprises a script basic description input area, an input/output definition input area and a calculation function description input area; and the information receiving unit is configured to: script basic description information, input/output definition information, and calculation function description information input via the script editing interface are received.
Optionally, in one example of the above aspect, the apparatus may further include: a script verification unit configured to perform script verification on the generated script program; and a script storage unit configured to store the generated script program description file and script program in a script program description file database and a script program database, respectively, for the configuration file generation device and the script program application device to call in response to the script verification passing.
Optionally, in one example of the above aspect, the script editing interface includes a script verification result display area, and the apparatus further includes: and a verification result display unit configured to display a script verification result for the script program in the script verification result display area before storing the generated script program description file and script program in a script program description file database and a script program database, respectively.
Optionally, in one example of the above aspect, the script editing interface includes a script syntax check result display area, a simulation data input area, and a script test check result display area, and the check result display unit is configured to: displaying a script grammar check result aiming at the script program in the script grammar check result display area; and displaying a script test verification result for the script program in the script test verification result display area in response to completion of the simulation data input for the simulation data input area, the script test verification result being obtained by running the script program using the simulation data.
Optionally, in one example of the above aspect, the script editing interface includes a script program publishing area, and the apparatus further includes: and a script program issuing unit configured to issue the generated script program in the script program issuing area for use by the script program application apparatus.
According to another aspect of the present disclosure, there is provided a system for script processing, including: a script program generating device comprising means for generating a script program as described above, configured to generate a script program and a script program description file; a configuration file generation device configured to generate a script program configuration file based on a script program description file generated in the script program generation device, the script program configuration file including a workflow of a script and a work context; and a script program application device configured to execute a script program based on the script program configuration file.
According to another aspect of the present disclosure, there is provided a computing device comprising: at least one processor; and a memory coupled to the at least one processor configured to store instructions that, when executed by the at least one processor, cause the at least one processor to perform the method for generating a script program as described above.
According to another aspect of the disclosure, there is provided a machine-readable storage medium storing executable instructions that, when executed, cause the machine to perform a method for generating a script program as described above.
According to another aspect of the present disclosure, there is provided a computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed, cause at least one processor to perform the method for generating a script program as described above.
Drawings
A further understanding of the nature and advantages of the present disclosure may be realized by reference to the following drawings. In the drawings, similar components or features may have the same reference numerals.
FIG. 1 illustrates a block diagram of a system for script program processing, in accordance with an embodiment of the present disclosure;
FIG. 2 illustrates a schematic diagram of a script editing interface in accordance with an embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of one example of a computational function description in accordance with embodiments of the present disclosure;
FIG. 4 illustrates a schematic diagram of one example of a script program description file in accordance with an embodiment of the present disclosure;
FIG. 5 illustrates a schematic diagram of one example of a script program configuration file in accordance with an embodiment of the present disclosure;
FIG. 6 illustrates a flow chart of a method for generating a script program in accordance with an embodiment of the present disclosure;
FIG. 7 illustrates a schematic diagram of operations performed at a scripting program application device according to an embodiment of the present disclosure; and
FIG. 8 illustrates a block diagram of a computing device for generating script programs, according to an embodiment of the present disclosure.
Reference numerals
10. Script program processing system
100. Script program generating device and script program generating apparatus
110. Interface display unit
120. Information receiving unit
130. Script program generating unit
140. Script program description file generating unit
150. Script verification unit
160. Script verification result display unit
170. Script storage unit
180. Script program issuing unit
200. Configuration file generating device
300. Script program application device
310. Script program execution engine
20. Script editing interface
210. Script basic description input area
211. Script name edit field
213. Script description content editing area
220. Input/output definition input area
221. Input variable name edit field
222. Input variable data type selection field
223. Input variable adding button
224. Output variable name edit field
225. Output variable data type selection area
226. Output variable unit selection field
227. Output variable numerical range editing area
230. Computing function description input area
231. Script type selection field
233. Computing function description edit areas
240. Grammar check result display area
250. Analog data input area
260. Script test verification result display area
270. Test operation start button
280. Script program issuing area
281. Script program add button
282. Script program delete button
283. Script program release button
290. Script program save button
S600 script program generation process
S610 displays script editing interface
S620 receives content input for script basic description input area, input/output definition input area, and calculation function description input area
S630, generating script program and script program description file
S640 executing script verification on script program
S650 displays script verification results
S660 script checks to see if it passes?
S670 stores script programs and script program description files
S680 issues script program
320. Script program
330. Script program
340. Script program configuration file
350. Data input
360. Data output
800. Computing device
810. At least one processor
820. Memory device
Detailed Description
The subject matter described herein will now be discussed with reference to example embodiments. It should be appreciated that these embodiments are discussed only to enable a person skilled in the art to better understand and thereby practice the subject matter described herein, and are not limiting of the scope, applicability, or examples set forth in the claims. Changes may be made in the function and arrangement of elements discussed without departing from the scope of the disclosure. Various examples may omit, replace, or add various procedures or components as desired. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. In addition, features described with respect to some examples may be combined in other examples as well.
As used herein, the term "comprising" and variations thereof mean open-ended terms, meaning "including, but not limited to. The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment. The term "another embodiment" means "at least one other embodiment". The terms "first," "second," and the like, may refer to different or the same object. Other definitions, whether explicit or implicit, may be included below. Unless the context clearly indicates otherwise, the definition of a term is consistent throughout this specification.
Methods and systems for generating script programs according to embodiments of the present disclosure will be described below with reference to the accompanying drawings.
Fig. 1 shows a block diagram of a system for script program processing (hereinafter, script program processing system) 10 according to an embodiment of the present disclosure. As shown in fig. 1, the script program processing system 10 includes a script program generating apparatus 100, a configuration file generating apparatus 200, and a script program application apparatus 300.
The script program generating apparatus 100 includes script program generating means (hereinafter also referred to as script program generating means 100 for simplicity of description). The script program generating apparatus 100 is configured to generate a script program and a script program description file based on a script basic description, an input/output definition, and a calculation function (Calculation Function) description input by a user (i.e., a script program writer). The script program description file is used by the profile generating apparatus 200 to generate a script program profile, and the script program is used by the script program application apparatus 300 to perform a corresponding process. For example, the script program generating apparatus 100 may generate a script program and a script program description file based on the input script basic description, input/output definition, and calculation function description in response to a user (i.e., script program writer) inputting the script basic description, input/output definition, and calculation function (Calculation Function) description via the script editing interface 20.
The profile generation device 200 communicates with the script program generation device 100. For example, the configuration file generation device 200 and the script program generation device 100 may communicate with each other by wired or wireless means. The profile generation device 200 is configured to acquire a script program description file from the script program generation device 100, and generate a script program profile based on the acquired script program description file. The script program configuration file may include, for example, a workflow of the script and a work context. Here, the workflow of the script may be described using input parameters and output parameters of the script. The working context of a script refers to the working environment of the script.
The profile generation device 200 is also configured to communicate with the script program application device 300. Also, communication between the profile generating apparatus 200 and the script program application apparatus 300 may be performed by a wired or wireless manner. When the script program application apparatus 300 needs to execute a script program, a script program configuration file is acquired from the configuration file generating apparatus 200.
The script program application apparatus 300 is configured to acquire a script program from the script program generating apparatus 100 and acquire a script program configuration file from the configuration file generating apparatus 200. For example, the script program application apparatus 300 downloads the script program from the script program generating apparatus 100, or the script program generating apparatus 100 actively issues the generated script program to the script program application apparatus 300. The script program application apparatus 300 requests or downloads a script program configuration file from the configuration file generating apparatus 200, or the configuration file generating apparatus 200 actively issues the generated script program configuration file to the script program application apparatus 300.
The script program application apparatus 300 has a script program execution engine 310. After the script program and script program configuration files are obtained, the script program execution engine 310 uses the script file configuration files to organize the workflows of the script program, including, for example, but not limited to: a message bus containing all data points running on the script program execution engine, sending data from the message bus to the input of the script program, and sending data from the output of the script program to the message bus. Then, the script program execution engine 310 uses data captured by the data capturing means on the script program application device 300 (e.g., an edge device) as input data of the script program execution engine 310 based on the organized script program workflow to provide the corresponding script program for script calculation (i.e., data preprocessing). After the script program completes the script calculation, the script calculation result is supplied to the output of the script program execution engine 310 to perform result output.
Note here that the script program generating apparatus 100 and the profile generating apparatus 200 may include, but are not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, personal Digital Assistants (PDAs), handheld devices, and the like. Preferably, the script program generating apparatus 100 and the script program profile generating apparatus 200 are server apparatuses. Script application device 300 may include, for example, an edge device.
As shown in fig. 1, the script program generating apparatus 100 includes an interface display unit 110, an information receiving unit 120, a script program generating unit 130, a script program description file generating unit 140, a script verifying unit 150, a script verifying result display unit 160, a script storing unit 170, and a script issuing unit 180.
The interface display unit 110 is configured to display the script editing interface 20 after receiving a script program generation trigger request. For example, an apparatus for generating a script program according to an embodiment of the present disclosure may be implemented as an application program module. The script program generation trigger request may be issued, for example, by clicking on the application module. Here, the script editing interface 20 may be drawn based on a script editing interface program written in advance after receiving a script program generation trigger request. FIG. 2 shows a schematic diagram of a script editing interface 20 in accordance with embodiments of the present disclosure.
As shown in FIG. 2, the script editing interface 20 includes a script basic description input area 210, an input/output definition input area 220, and a calculation function description input area 230.
The script basic description input area 210 is configured for use by a user to input script basic descriptions. The script basic description includes, for example, a script name and a script description. Specifically, the script basic description input area 210 includes a script name editing area 211 and a script description content editing area 213. The user can edit (e.g., fill out) the name of the script to be generated, for example, fill out script name FPY, in the script name editing area 211. In addition, the user can write script description contents, for example, "Message Type for FPY", in the script description contents editing area 213.
The input/output definition input area 220 is configured for use by a user to input information about input/output definitions. Specifically, the input/output definition input area 220 includes an input definition input area and an output definition input area. The Input definition Input area (Input) includes an Input variable name edit area 221, an Input variable data type selection area 222, and an Input variable add button 223. The input variable name editing area 221 is configured for use by a user to edit input variable names, such as GoodItem, badItem. The input variable data type selection field 222 may be designed, for example, to have a drop-down menu form for a user to select the data type of the input variable, e.g., INT. The input variable addition button 223 is configured for a user to add an input variable. After the user clicks the input variable adding button 223, a blank line is added in the input definition input area for the user to edit the input variable name and select the input variable data type. After the user has completed editing the name of the input variable and has selected the input variable data type, a new input variable is defined.
The Output definition input area (Output) includes an Output variable name edit area 224, an Output variable data type selection area 225, an Output variable unit selection area 226, and an Output variable numerical range edit area 227. The output variable name editing area 224 is configured for use by a user to edit output variable names, such as FPY. The output variable data type selection field 225 may be designed, for example, to have a drop-down menu form for a user to select the data type of the output variable, e.g., DOUBLE. The output variable unit selection area 226 may be designed, for example, to have a pull-down menu form for a user to select units of an output variable, for example,%. The output variable value range editing area 227 is configured for a user to edit the value range of the output variable, e.g., 0-100.
The computational function description input area 230 is configured for use by a user to input a computational function description. The calculation function description input section 230 includes a script type selection section 231 and a calculation function description editing section 233. The script type selection field 231 may be designed to have a pull-down menu form, for example, for a user to select a script type, for example, python. The calculation function description edit section 233 is configured for a user to edit the description content of the input calculation function. Here, the description contents are generally described in a program code language corresponding to the selected script type. FIG. 3 shows a schematic diagram of one example of a computational function description, according to an embodiment of the present disclosure.
The information receiving unit 120 is configured to receive script basic description information, input/output definition information, and calculation function description information. For example, the information receiving unit 120 may be configured to receive script basic description information, input/output definition information, and calculation function description information input by a user via a script editing interface.
The script program generating unit 130 is configured to generate a script program based on the script basic description information, the input/output definition information, and the calculation function description information.
The script program description file generating unit 140 is configured to generate a script program description file based on the script basic description information, the input/output definition information, and the calculation function description information. FIG. 4 shows a schematic diagram of one example of a script program description file, according to an embodiment of the present disclosure. In the present disclosure, the script program description file is used by the profile generating apparatus 200 to generate a script program profile. FIG. 5 illustrates a schematic diagram of one example of a script program profile in accordance with embodiments of the present disclosure.
The script verification unit 150 is configured to verify the generated script program. After completion of the script program verification, the script verification result display unit 160 displays the script verification result. In the present disclosure, the verification performed for the script program may include syntax verification. Accordingly, the script editing interface 20 includes a script syntax check result display area 240, as shown in fig. 2. The script syntax check result display area 240 is configured to display syntax check results for the generated script program. After the user completes the content input operation for the script basic description input area 210, the input/output definition input area 220, and the calculation function description input area 230, a script program is generated based on the content inputs of the script basic description input area 210, the input/output definition input area 220, and the calculation function description input area 230, and the generated script program is subjected to syntax check, and then the syntax check result is returned to the script editing interface 20 (i.e., to a display unit for displaying the script editing interface, also referred to as a front end) to be displayed in the script syntax check result display area 240, for example, to display that the syntax check is correct, or to display a program line in which a syntax error exists in the script program, or the like. The user confirms whether the generated script program satisfies the requirement, i.e., whether the grammar check is passed, according to the display result in the script grammar check result display area 240.
Further, in another example of the present disclosure, the verification performed for the script program may also include script test verification. Accordingly, the script editing interface 20 may also include an analog data input field 250 and a script test verification result display field 260. The simulation data input area 250 is configured for use by a user to input simulation data for script testing for use by the back-end processing device to conduct script testing. The script test result display area 260 is configured to display the script test result of the back-end processing apparatus for the user to determine whether the generated script program satisfies the requirements, i.e., whether the script test check is passed.
In addition, script editing interface 20 also includes test run start button 270. After the test run start button 270 is operated, a script test for the simulation data is started.
The script storage unit 170 is configured to store the generated script program description file and script program in the script program description file database and the script program database, respectively, for the configuration file generating apparatus 200 and the script program application apparatus 300 to call in response to the script verification passing. For example, the generated script program description file is stored in the script program description file database for the configuration file generating apparatus 200 to call, and the generated script program is stored in the script program database for the script program application apparatus 300 to call.
In addition, the script editing interface 20 may also include a script program issuing area 280. The script program issuing section 280 is configured to display a script program to be issued. As shown in fig. 2, the script program issuing section 280 may include a script program adding button 281, a script program deleting button 282, and/or a script program issuing button 283. Accordingly, the script program generating apparatus 100 may further include a script program issuing unit 180. The script program issuing unit 180 is configured to issue the generated script program in the script program issuing section 280 for use by the script program application apparatus 300.
In addition, script editing interface 20 may also include script program save button 290. After the user confirms that the generated script program satisfies the requirements, i.e., that the grammar check and/or the test check pass, the script program save button 290 is clicked to perform a script program save operation. For example, in response to a user clicking a save operation, the generated script program and script program description file are saved.
As described above with reference to fig. 1 to 5, the script program generating apparatus 100 according to the embodiment of the present disclosure is described. In the present disclosure, the script program generating apparatus 100 may be divided into a front-end interaction part for performing a data interaction operation that needs to be performed at a front end when generating a script program, and a back-end processing part. The back-end processing section is configured to perform data processing operations performed at the back-end when the script program is generated. For example, the interface display unit 110, the information receiving unit 120, and the script verification result display unit 160 may belong to a front-end interaction part, and the script program generating unit 130, the script program description file generating unit 140, the script verification unit 150, the script storage unit 170, and the script issuing unit 180 may belong to a back-end processing part.
Fig. 6 shows a flowchart of a method for generating a script program, according to an embodiment of the present disclosure.
As shown in fig. 6, first, at block S610, after receiving a script program generation trigger request, the script editing interface 20 is displayed.
Next, at block S620, content inputs are received for the script basic description input area 210, the input/output definition input area 220, and the calculation function description input area 230.
After receiving the content inputs for the script basic description input area 210, the input/output definition input area 220, and the calculation function description input area 230, at block S630, a script program and a script program description file are generated using the content inputs of the script basic description input area, the input/output definition input area, and the calculation function description input area. In one example of the present disclosure, a script program may be automatically generated based on a script program template using script basic description input fields, input/output definition input fields, and content inputs of a computation function description input field.
Then, at block S640, script verification is performed on the generated script program. The script verification may include grammar verification. The syntax checking may be automatically performed by the script checking unit 150 at the back end. In addition, the script verification may also include script test verification. Accordingly, the script editing interface 20 also includes an analog data input field 250 and a script test verification result display field 260. In this case, the method may further include: in response to completion of the simulated data input for the simulated data input area 250, the script program is run using the simulated data for script test verification and script test verification results are returned to the script editing interface 20 for display. Further, when the script editing interface 20 includes the test run start button 270, a script test for the simulation data is run in response to the test run start button 270 being operated.
After the script verification is completed, at block 650, the script verification results are returned to the script editing interface 20 for display. Next, at block S660, it is determined whether the script check passes. In one example, this step may be judged by the user based on the script grammar check result display area 240/script test check result display area 260, or may be judged by the back-end processing portion and the judgment result is provided to the front-end interaction portion to be displayed to the user on the script editing interface 20.
Upon determining that the script verification for the script program fails, returning to block 620, the user again performs content input for the script basic description input area 210, the input/output definition input area 220, and/or the computing function description input area 230 to adjust the content input for the script basic description input area 210, the input/output definition input area 220, and/or the computing function description input area 230. Then, the script program generating process is sequentially executed again based on the adjusted content input.
After it is determined that the script verification is passed, in response to the script verification being passed, the generated script program and script program description file are stored in the script program storage unit and the script program description file storage unit, respectively, for the script program application apparatus 300 to call the script program to perform the corresponding operation, and for the script program file configuration device 200 to call the script program description file to generate the script program configuration file. For example, after it is determined that the script verification is passed and the user triggers a save operation for the script program, the generated script program and script program description file are stored in the script program storage unit and script program description file storage unit, respectively. In the present disclosure, when the script editing interface 20 further includes the script program save button 290, a save operation for the generated script program is performed by operating the script save button 290.
Further, in another example of the present disclosure, the method may further include: at block 680, in response to the script verification passing, the generated script program is published for use by the script program application device 300. For example, in the case where the script editing interface 20 includes the script program issuing section 280, the generated script program is issued in the script program issuing section 280 for use by the script program application apparatus 300.
The script program generating apparatus 100 and the script program processing system 10 according to the embodiment of the present disclosure are described above with reference to fig. 1 to 6. It should be noted that, fig. 1 to 6 illustrate only one embodiment of the script program generating method and apparatus according to the present disclosure, and in other embodiments of the present disclosure, modifications may be made to the embodiments of the script program generating method and apparatus illustrated in fig. 1 to 6.
For example, in another embodiment of the present disclosure, the script program generating apparatus 100 may not include the interface display unit 110 and the script verification result display unit 160. That is, in this embodiment, the script editing interface 20 need not be provided to the user.
Further, in another embodiment of the present disclosure, the script editing interface 20 may include only the syntax checking result display area 240. Alternatively, the script editing interface 20 may include only the simulation data input area 250 and the script test result display area 260.
FIG. 7 illustrates a schematic diagram of operations performed at a scripting program application device according to an embodiment of the present disclosure.
As shown in fig. 7, the script program application apparatus 300 has a script program execution engine 310. After acquiring the script program 330 and the script program configuration file 340, the script program execution engine 310 installs the acquired script program 300 (i.e., script programs 320-1, 320-2 in fig. 7). Script program execution engine 310 then uses script file configuration file 340 to organize the workflows of the script program, including, for example, but not limited to: a message bus containing all data points running on the script program execution engine, sending data from the message bus to the input of the script program, and sending data from the output of the script program to the message bus. The script program execution engine 310 then provides the data captured by the data capture device on the script program application 300 (i.e., the input 350 of the script program execution engine 310) to the corresponding script program 320 for script computation (i.e., data preprocessing) based on the organized script program workflow. After the script program completes the script calculation, the script calculation result is provided to the output 360 of the script program execution engine 310 for result output.
Embodiments of a method and system for generating a script program according to the present disclosure are described above with reference to fig. 1 through 7. The script program generating apparatus 100 above may be implemented in hardware, or may be implemented in software or a combination of hardware and software.
Fig. 8 illustrates a block diagram of a computing device 800 for generating a script program in accordance with embodiments of the present disclosure. According to one embodiment, computing device 800 may include at least one processor 810, with processor 810 executing at least one computer readable instruction (i.e., the elements described above as being implemented in software) stored or encoded in a computer readable storage medium (i.e., memory 820).
In one embodiment, computer-executable instructions are stored in memory 820 that, when executed, cause at least one processor 810 to: receiving script basic description information, input/output definition information and calculation function description information; and generating a script program and a script program description file based on the script basic description information, the input/output definition information, and the calculation function description information.
It should be appreciated that the computer-executable instructions stored in memory 820, when executed, cause at least one processor 810 to perform the various operations and functions described above in connection with fig. 1-7 in various embodiments of the present disclosure.
According to one embodiment, a machine-readable medium is provided. The machine-readable medium may have machine-executable instructions (i.e., elements described above implemented in software) that, when executed by a machine, cause the machine to perform the various operations and functions described above in connection with fig. 1-7 in various embodiments of the disclosure.
According to one embodiment, a computer program is provided that includes computer-executable instructions that, when executed, cause at least one processor to perform the various operations and functions described above in connection with fig. 1-7 in various embodiments of the present disclosure.
According to one embodiment, a computer program product is provided that includes computer-executable instructions that, when executed, cause at least one processor to perform the various operations and functions described above in connection with fig. 1-7 in various embodiments of the present disclosure.
The detailed description set forth above in connection with the appended drawings describes exemplary embodiments, but does not represent all embodiments that may be implemented or fall within the scope of the claims. The term "exemplary" used throughout this specification means "serving as an example, instance, or illustration," and does not mean "preferred" or "advantageous over other embodiments. The detailed description includes specific details for the purpose of providing an understanding of the described technology. However, the techniques may be practiced without these specific details. In some instances, well-known structures and devices are shown in block diagram form in order to avoid obscuring the concepts of the described embodiments.
The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the scope of the disclosure. Thus, the disclosure is not limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (18)
1. A method (S600) for generating a script program, comprising:
receiving (S620) script basic description information, input/output definition information, and calculation function description information input via an interface; the computing function description information includes program code describing a computing function computing process in a program code language corresponding to the selected script type;
and
Generating (S630) a script program and a script program description file based on the script basic description information, the input/output definition information, and the calculation function description information; the script program description file is used for generating a script program configuration file, and the script program configuration file is used for indicating input and output parameters of a script and a working environment of the script when the script program is executed; the script program and the script program configuration file are used for being provided for an edge device in the industrial Internet of things to execute;
The interface supports inputting simulation data and displays a verification result after a script program is run based on the simulation data.
2. The method (S600) of claim 1, wherein generating (S630) a script program based on the script basic description information, the input/output definition information, and the computation function description information comprises:
the script program is generated (S630) using a script program template based on the script basic description information, the input/output definition information, and the calculation function description information.
3. The method (S600) of claim 1, further comprising:
after receiving a script program generation trigger request, displaying (S610) a script editing interface (20), the script editing interface (20) comprising a script basic description input area (210), an input/output definition input area (220) and a calculation function description input area (230); and
receiving (S620) script basic description information, input/output definition information, and calculation function description information input via an interface includes:
script basic description information, input/output definition information, and calculation function description information input via the script editing interface (20) are received (S620).
4. The method (S600) of claim 1, further comprising:
performing script verification on the generated script program (S640); and
in response to the script verification passing, storing (S660) the generated script program description file and script program in a script program description file database and a script program database, respectively, for the configuration file generating device (200) and the edge device to call.
5. The method (S600) of claim 4, wherein the script editing interface (20) comprises a script verification result display area (240, 260), the method further comprising, prior to storing (S660) the generated script program description file and script program in a script program description file database and a script program database, respectively:
and displaying (S650) a script verification result for the script program in the script verification result display area (240, 260).
6. The method (S600) of claim 5, wherein the script verification comprises a grammar verification and/or a script test verification.
7. The method (S600) of claim 6, wherein the script editing interface (20) includes a script syntax check result display area (240), a simulation data input area (250), and a script test check result display area (260), and displaying (S650) script check results for a script program in the script check result display area (240, 260) includes:
Displaying a script syntax check result for the script program in the script syntax check result display area (240); and/or
In response to completion of input of the simulation data, a script test result for the script program is displayed in the script test result display area (260), the script test result being obtained by running the script program using the simulation data.
8. A method (S600) according to claim 3, wherein the script editing interface (20) comprises a script program issuing area (280), the method further comprising:
the generated script program is published in the script program publishing area (280) for use by the edge device.
9. An apparatus (100) for generating a script program, comprising:
an information receiving unit (120) configured to receive script basic description information, input/output definition information, and calculation function description information input via an interface; the computing function description information includes program code describing a computing function computing process in a program code language corresponding to the selected script type; and
a script program generating unit (130) configured to generate a script program based on the script basic description information, the input/output definition information, and the calculation function description information; and
A script program description file generating unit (140) configured to generate a script program description file based on the script basic description information, the input/output definition information, and the calculation function description information; the script program description file is used for generating a script program configuration file, and the script program configuration file is used for indicating input and output parameters of a script and a working environment of the script when the script program is executed; the script program and the script program configuration file are used for being provided for an edge device in the industrial Internet of things to execute;
the interface supports inputting simulation data and displays a verification result after a script program is run based on the simulation data.
10. The apparatus (100) of claim 9, wherein the script program generating unit (130) is configured to:
the script program is generated using a script program template based on the script basic description information, the input/output definition information, and the calculation function description information.
11. The apparatus (100) of claim 9, further comprising:
an interface display unit (110) configured to display a script editing interface (20) after receiving a script program generation trigger request, the script editing interface (20) including a script basic description input area (210), an input/output definition input area (220), and a calculation function description input area (230); and
The information receiving unit (120) is configured to:
script basic description information, input/output definition information, and calculation function description information input via the script editing interface (20) are received.
12. The apparatus (100) of claim 9, further comprising:
a script verification unit (150) configured to perform script verification on the generated script program; and
and a script storage unit (170) configured to store the generated script program description file and script program in a script program description file database and a script program database, respectively, for the configuration file generation device (200) and the edge device to call in response to the script verification passing.
13. The apparatus (120) of claim 12, wherein said script editing interface (20) comprises a script verification result display area (240, 260), said apparatus (100) further comprising:
and a verification result display unit (160) configured to display a script verification result for the script program in the script verification result display area (240, 260) before storing the generated script program description file and script program in a script program description file database and a script program database, respectively.
14. The apparatus (100) of claim 13, wherein the script editing interface (20) comprises a script syntax verification result display area (240), a simulation data input area (250), and a script test verification result display area (260), and the verification result display unit (170) is configured to:
displaying a script syntax check result for the script program in the script syntax check result display area (240); and/or
In response to completion of the simulated data input for the simulated data input area (250), a script test check result for the script program is displayed in the script test check result display area (260), the script test check result being obtained by running the script program using the simulated data.
15. The apparatus (100) of claim 10, said script editing interface (20) comprising a script program issuing area (280), said apparatus (100) further comprising:
a script program issuing unit (180) configured to issue the generated script program in the script program issuing area (280) for use by the edge device.
16. A system (10) for script processing, comprising:
a script program generating device (100), the script program generating device comprising the apparatus (100) of any of claims 9 to 15, configured to generate a script program and a script program description file;
A profile generation device (200) configured to generate a script program profile based on a script program description file generated in the script program generation device (100), the script program profile comprising a workflow of a script and a work context; and
and an edge device configured to execute a script program based on the script program configuration file.
17. A computing device (800), comprising:
at least one processor (810); and
a memory (820) coupled to the at least one processor (810) and configured to store instructions that, when executed by the at least one processor (810), cause the at least one processor (810) to perform the method of any of claims 1 to 8.
18. A machine-readable storage medium storing executable instructions that when executed cause the machine to perform the method of any one of claims 1 to 8.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910354019.9A CN111857679B (en) | 2019-04-29 | 2019-04-29 | Method and device for generating script program and script program processing system |
PCT/CN2020/081801 WO2020220889A1 (en) | 2019-04-29 | 2020-03-27 | Method and device for generating script program, and script program processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910354019.9A CN111857679B (en) | 2019-04-29 | 2019-04-29 | Method and device for generating script program and script program processing system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111857679A CN111857679A (en) | 2020-10-30 |
CN111857679B true CN111857679B (en) | 2024-03-15 |
Family
ID=72965350
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910354019.9A Active CN111857679B (en) | 2019-04-29 | 2019-04-29 | Method and device for generating script program and script program processing system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111857679B (en) |
WO (1) | WO2020220889A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113467985A (en) * | 2021-07-28 | 2021-10-01 | 浙江大华技术股份有限公司 | Function checking method and device, electronic equipment and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6113649A (en) * | 1996-03-27 | 2000-09-05 | International Business Machines Corporation | Object representation of program and script components |
CN102306102A (en) * | 2011-08-25 | 2012-01-04 | 中兴通讯股份有限公司 | Method and device for automatically generating program file |
CN103186377A (en) * | 2011-12-30 | 2013-07-03 | 鸿富锦精密工业(深圳)有限公司 | Intelligent code generation system and method |
CN104461528A (en) * | 2014-12-01 | 2015-03-25 | 陕西海泰电子有限责任公司 | Method and device for generating signal-oriented application program codes in visualization mode |
CN106469064A (en) * | 2016-09-04 | 2017-03-01 | 深圳市云智易联科技有限公司 | Code generating method and code generating unit |
US9870205B1 (en) * | 2014-12-29 | 2018-01-16 | Palantir Technologies Inc. | Storing logical units of program code generated using a dynamic programming notebook user interface |
CN108170809A (en) * | 2017-12-28 | 2018-06-15 | 平安科技(深圳)有限公司 | Build table scenario generation method, device, equipment and computer readable storage medium |
CN108647049A (en) * | 2018-03-18 | 2018-10-12 | 平安科技(深圳)有限公司 | Configurableization system, method, equipment and the storage medium of rule-based engine |
CN109117127A (en) * | 2018-08-21 | 2019-01-01 | 水木康益(北京)信息技术有限公司 | Program code generation method, device and computer readable storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106598556B (en) * | 2015-10-15 | 2020-08-25 | 阿里巴巴集团控股有限公司 | User interface generation method and device |
CN105488181A (en) * | 2015-12-01 | 2016-04-13 | 深圳联友科技有限公司 | Static page website generating method and system |
US10713015B2 (en) * | 2016-05-15 | 2020-07-14 | Servicenow, Inc. | Visual programming system |
-
2019
- 2019-04-29 CN CN201910354019.9A patent/CN111857679B/en active Active
-
2020
- 2020-03-27 WO PCT/CN2020/081801 patent/WO2020220889A1/en active Application Filing
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6113649A (en) * | 1996-03-27 | 2000-09-05 | International Business Machines Corporation | Object representation of program and script components |
CN102306102A (en) * | 2011-08-25 | 2012-01-04 | 中兴通讯股份有限公司 | Method and device for automatically generating program file |
CN103186377A (en) * | 2011-12-30 | 2013-07-03 | 鸿富锦精密工业(深圳)有限公司 | Intelligent code generation system and method |
CN104461528A (en) * | 2014-12-01 | 2015-03-25 | 陕西海泰电子有限责任公司 | Method and device for generating signal-oriented application program codes in visualization mode |
US9870205B1 (en) * | 2014-12-29 | 2018-01-16 | Palantir Technologies Inc. | Storing logical units of program code generated using a dynamic programming notebook user interface |
CN106469064A (en) * | 2016-09-04 | 2017-03-01 | 深圳市云智易联科技有限公司 | Code generating method and code generating unit |
CN108170809A (en) * | 2017-12-28 | 2018-06-15 | 平安科技(深圳)有限公司 | Build table scenario generation method, device, equipment and computer readable storage medium |
CN108647049A (en) * | 2018-03-18 | 2018-10-12 | 平安科技(深圳)有限公司 | Configurableization system, method, equipment and the storage medium of rule-based engine |
CN109117127A (en) * | 2018-08-21 | 2019-01-01 | 水木康益(北京)信息技术有限公司 | Program code generation method, device and computer readable storage medium |
Non-Patent Citations (3)
Title |
---|
一种可通用的参数编辑软件设计及实现;雷丽萍等;工业控制计算机(第12期);全文 * |
基于可视化编程的自动化编程工具;王敏等;计算机应用与软件(第12期);全文 * |
数据文件自动产生和配置平台的软件设计与实现;沙永祥;中国优秀硕士论文全文库 信息科技辑;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN111857679A (en) | 2020-10-30 |
WO2020220889A1 (en) | 2020-11-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9342237B2 (en) | Automated testing of gesture-based applications | |
CN107453960B (en) | Method, device and system for processing test data in service test | |
CN110659569B (en) | Electronic signature method, device, storage medium and electronic equipment | |
CN111209202A (en) | Terminal application testing method and device | |
CN112559354A (en) | Front-end code specification detection method and device, computer equipment and storage medium | |
CN107807841B (en) | Server simulation method, device, equipment and readable storage medium | |
US20150261505A1 (en) | Method and system for generating stateflow models from software requirements | |
CN109933534B (en) | Method and device for determining financial test object | |
CN112286806A (en) | Automatic testing method and device, storage medium and electronic equipment | |
CN108984202B (en) | Electronic resource sharing method and device and storage medium | |
CN114089986A (en) | Method, system, device and medium for configuring low code development platform function expression | |
CN111078539A (en) | Test method, device, system and computer readable storage medium | |
US11366704B2 (en) | Configurable analytics for microservices performance analysis | |
US9563541B2 (en) | Software defect detection identifying location of diverging paths | |
CN113821433A (en) | Method, device, equipment, medium and product for testing cloud mobile phone application program | |
CN111475388A (en) | Data push test method and device, computer equipment and storage medium | |
CN111857679B (en) | Method and device for generating script program and script program processing system | |
CN110717315B (en) | System data batch modification method and device, storage medium and electronic equipment | |
CN116661936A (en) | Page data processing method and device, computer equipment and storage medium | |
CN110958243A (en) | Network vulnerability submitting method and device, storage medium and electronic equipment | |
CN110532186B (en) | Method, device, electronic equipment and storage medium for testing by using verification code | |
CN114218166A (en) | Data processing method and device, electronic equipment and readable storage medium | |
CN113626301B (en) | Method and device for generating test script | |
US20210089992A1 (en) | Method for automated code reviewer recommendation | |
CN108170557B (en) | Method and apparatus for outputting information |
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 |