A recording and saving script generation method, device, electronic device and storage medium

By reading and processing the .sib file in RSCAD, the wave recording saving script is generated, which solves the problem of cumbersome generation of wave recording saving scripts in the existing technology, and realizes the automatic generation without manual saving of wave recording operations.

CN114756516BActive Publication Date: 2024-09-20ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210510661.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-11
Publication Date
2024-09-20
Estimated Expiration
2042-05-11

AI Technical Summary

Technical Problem

The existing wave recording saving script generation method requires the user to manually save the wave recording operation before it can be generated, which is cumbersome to operate.

Method used

By reading the .sib file, searching for the preset character segment, reading the line value, determining the target line value, obtaining the waveform name, filling it into the preset template, generating text information, and saving it in the preset file to determine whether the search is completed. If not, return to the search step. If yes, generate the wave recording saving script.

Benefits of technology

There is no need for users to manually save wave recording operations, which simplifies the generation process of wave recording saving scripts and makes the operation easier.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756516B
    Figure CN114756516B
Patent Text Reader

Abstract

The present invention discloses a method, device, electronic device and storage medium for generating a recording and saving script, which is used to solve the problem that the existing recording and saving script generation method requires the user to manually save the recording operation once before it can be generated, and the operation is cumbersome. The present invention comprises: reading a .sib file; searching for a preset character segment in the .sib file, and reading the row value of the preset character segment; determining a target row value according to the row value, and obtaining a waveform name according to the target row value; filling the waveform name into a preset template to generate text information; saving the text information in a preset file; judging whether the preset character segment has been searched; if not, returning to the step of searching for the preset character segment in the .sib file and reading the row value of the preset character segment; if so, using the preset file to generate a recording and saving script.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of script generation, and in particular to a method, device, electronic device and storage medium for generating a recording and saving script. Background Art

[0002] RSCAD is a real-time simulation platform software development kit, which is mainly used in the fields of real-time simulation of power systems. The kit contains special software such as Draft and Runtime. Among them, Draft is mainly used for the construction, editing and modification of real-time simulation models (.dft format), and Runtime is used for downloading, running and monitoring the running status of real-time simulators. Runtime can edit .sib format files, which are generated by Draft after compiling .dft format files. After the Runtime software opens the .sib file, the user can add variables and images to be monitored as needed. At the same time, Runtime also supports the operation of .scr files. .scr can record the user's operation on the .sib file (such as saving the recording), and the user first operates the .sib file. In this way, the user only needs to manually save the recording operation once, and the Runtime will record the operation process and save it as a .scr file. The result of the next test can be automatically recorded by the Runtime software running the .scr file, without the user having to operate again.

[0003] However, in the above process, the user still needs to perform a recording operation (equivalent to demonstrating the operation steps to the Runtime software), and the Runtime will record the operation process and save it as a .scr file, so that the waveform data of the next test can be automatically recorded and saved in the specified directory by the Runtime software running the .scr file. The operation process is not simple enough. Summary of the invention

[0004] The present invention provides a recording and saving script generation method, device, electronic device and storage medium, which are used to solve the problem that the existing recording and saving script generation method requires the user to manually save the recording operation once before the script can be generated, which is cumbersome to operate.

[0005] The present invention provides a method for generating a recording and saving script, which is applied to RSCAD. The method comprises:

[0006] Read .sib file;

[0007] Searching for a preset character segment in the .sib file, and reading the row value of the preset character segment;

[0008] Determine a target row value according to the row value, and obtain a waveform name according to the target row value;

[0009] Fill the waveform name into a preset template to generate text information;

[0010] Saving the text information in a preset file;

[0011] Determine whether the preset character segment has been searched; if not, return to the step of searching the preset character segment in the .sib file and reading the row value of the preset character segment;

[0012] If so, the preset file is used to generate a recording and saving script.

[0013] Optionally, the step of filling the waveform name into a preset template to generate text information includes:

[0014] Select a file format from the preset template;

[0015] The waveform name is saved in the preset template in the file format to generate text information.

[0016] Optionally, the file format includes: one or more of Comtrade format, mpb format, jpg format, pdf format, emf format and csv format.

[0017] Optionally, before the step of reading the .sib file, the step further includes:

[0018] Acquiring power system data, and generating a waveform using the power system data;

[0019] The waveforms are saved in the .sib file, and a waveform name is added to each of the waveforms.

[0020] The present invention also provides a recording and saving script generation device, which is applied to RSCAD, and the device comprises:

[0021] Reading module, used to read .sib files;

[0022] A search module, used for searching a preset character segment in the .sib file and reading a row value of the preset character segment;

[0023] A waveform name acquisition module, used to determine a target row value according to the row value, and acquire a waveform name according to the target row value;

[0024] A text information generating module, used for filling the waveform name into a preset template to generate text information;

[0025] A text information saving module, used to save the text information in a preset file;

[0026] A judging module, used for judging whether the preset character segment has been searched; if not, returning to the step of searching the preset character segment in the .sib file and reading the row value of the preset character segment;

[0027] The recording and saving script generation module is used to use the preset file to generate the recording and saving script.

[0028] Optionally, the text information generating module includes:

[0029] A file format selection submodule, used to select a file format in the preset template;

[0030] The text information generation submodule is used to save the waveform name in the preset template in the file format to generate text information.

[0031] Optionally, the file format includes: one or more of Comtrade format, mpb format, jpg format, pdf format, emf format and csv format.

[0032] Optionally, the device further comprises:

[0033] A waveform generation module, used to obtain power system data and generate a waveform using the power system data;

[0034] The waveform saving module is used to save the waveform in the .sib file and add a waveform name to each waveform.

[0035] The present invention also provides an electronic device, the device comprising a processor and a memory:

[0036] The memory is used to store program code and transmit the program code to the processor;

[0037] The processor is used to execute the recording and saving script generation method as described in any of the above items according to the instructions in the program code.

[0038] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the method for generating a recording and saving script as described in any one of the above items.

[0039] It can be seen from the above technical scheme that the present invention has the following advantages: the present invention reads the .sib file; searches for the preset character segment in the .sib file, and reads the row value of the preset character segment; determines the target row value according to the row value, and obtains the waveform name according to the target row value; fills the waveform name into the preset template to generate text information; saves the text information in the preset file; determines whether the preset character segment has been searched; if not, returns to the step of searching for the preset character segment in the .sib file and reading the row value of the preset character segment; if so, generates a recording and saving script using the preset file. This makes the generation of the recording and saving script unnecessary for the user to manually save the recording operation, and the operation is simpler. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0041] Figure 1 A flowchart of a method for generating a recording and saving script provided by an embodiment of the present invention;

[0042] Figure 2 A flowchart of a method for generating a recording and saving script provided by another embodiment of the present invention;

[0043] Figure 3 A structural block diagram of a recording and saving script generation device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The embodiments of the present invention provide a recording saving script generation method, device, electronic device and storage medium, which are used to solve the problem that the existing recording saving script generation method requires the user to manually save the recording operation once before generating it, which is cumbersome to operate.

[0045] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] See also Figure 1 , Figure 1 A flowchart of the steps of a method for generating a recording and saving script provided in an embodiment of the present invention.

[0047] A method for generating a recording and saving script provided by the present invention is applied to RSCAD and may specifically include the following steps:

[0048] Step 101, read the .sib file;

[0049] In the embodiment of the present invention, .sib is a picture format file, which can be used to store waveform data in the power system.

[0050] For example, in the simulation scenario where the generator transmits power to the load, it is necessary to obtain data such as the active power, reactive power, rotor speed, transmission line current, load active power, load reactive power, etc. Any .sib file stores the data of various instruments, waveforms, parameter setting inputs, and switch status inputs that need to be observed.

[0051] In actual application, the .sib file can be compiled by the Draft software to generate a file with the same name as the .dft file. For example, after fangzhen.dft is compiled by Draft, the fangzhen.sib file is generated. The fangzhen.sib and fangzhen.dft are in the same folder directory. The user needs to open fangzhen.sib in the Runtime software, add the waveforms to be monitored, and name each waveform.

[0052] It should be noted that waveform names cannot be repeated.

[0053] Step 102, searching for a preset character segment in the .sib file, and reading the row value of the preset character segment;

[0054] In the embodiment of the present invention, the .sib file can be opened in a program development environment such as Python or C++ in text mode, a preset character segment, such as "COMPONENT:PLOT", can be searched, and the row value of the character segment can be read.

[0055] "COMPONENT:PLOT" is the keyword used to mark the waveform graph in the .sib file, indicating that starting from this line, a series of properties for the PLOT component will be set.

[0056] Step 103, determining a target row value according to the row value, and obtaining a waveform name according to the target row value;

[0057] After reading the row value of the preset character segment, the target row value of the script row recording the waveform name can be found according to the set difference value, and the waveform name can be obtained from the script row corresponding to the target row value.

[0058] If the row value of the preset character segment is k, the target row value may be k+2.

[0059] Step 104, filling the waveform name into the preset template to generate text information;

[0060] In the embodiment of the present invention, after the name of the waveform to be monitored is obtained, it can be written into a preset template to generate text information.

[0061] Step 105, saving the text information in a preset file;

[0062] After the text information is generated by using a preset template, the generated text information may be saved in a file of a preset format, such as a .scr file.

[0063] Step 106, determining whether the preset character segment has been searched; if not, returning to the step of searching the preset character segment in the .sib file and reading the row value of the preset character segment;

[0064] Step 107: If yes, generate a recording and saving script using a preset file.

[0065] After the text information is saved in the preset file, the preset character segment in the .sib file can be continuously searched. If the search is not completed, the process returns to step 102. If the search is completed, the preset file containing the preset character segments is used as a recording saving script.

[0066] The present invention reads a .sib file; searches for a preset character segment in the .sib file and reads the row value of the preset character segment; determines a target row value according to the row value and obtains a waveform name according to the target row value; fills the waveform name into a preset template to generate text information; saves the text information in a preset file; determines whether the preset character segment is searched; if not, returns to the step of searching for the preset character segment in the .sib file and reading the row value of the preset character segment; if yes, generates a recording and saving script using the preset file. This makes the generation of the recording and saving script unnecessary for the user to manually save the recording operation, and the operation is simpler.

[0067] See also Figure 2 , Figure 2 A flowchart of a method for generating a recording and saving script provided in another embodiment of the present invention may specifically include the following steps:

[0068] Step 201, read the .sib file;

[0069] In the embodiment of the present invention, before reading the .sib file, it is necessary to generate the .sib file first.

[0070] In one example, the process of generating a .sib file may include the following steps:

[0071] S1, acquiring power system data and generating a waveform using the power system data;

[0072] S2, save the waveforms in .sib files and add waveform names to each waveform.

[0073] In the specific implementation, after the .dft file is compiled, the Draft software will generate a .sib file with the same name in the same directory as dft. After the user opens the .sib file (the .sib file is a blank file at this time) in the Runtime software, he needs to create various instruments, waveform diagrams, parameter setting inputs, switch status inputs and other components based on the power system data according to the research needs. The waveform diagram is the waveform data that needs to be saved. After creating the waveform, you need to add a waveform name for each waveform.

[0074] Step 202, searching for a preset character segment in the .sib file, and reading the row value of the preset character segment;

[0075] Step 203, determining a target row value according to the row value, and obtaining a waveform name according to the target row value;

[0076] Steps 202-203 are the same as steps 102-103. For details, please refer to the description of steps 102-103, which will not be repeated here.

[0077] Step 204, selecting a file format from a preset template;

[0078] Step 205, saving the waveform name in a preset template in a file format to generate text information;

[0079] In one example, the text information generated based on the preset template may include one or more of the following six lines of scripts, which correspond to six file formats: Comtrade format, mpb format, jpg format, pdf format, emf format, and csv format:

[0080] Line 1: ComtradePlotSave "Plot_name1", "C:\PLOT\Plot_name1.cfg", YEAR, 1991, MIN, 0, MAX, 65535;

[0081] Line 2: SavePlot"Plot_name1","C:\PLOT\Plot_name1.mpb";

[0082] Line 3: SavePlotToJpeg"Plot_name1","C:\PLOT\Plot_name1.jpg",COMPRESSION,75,WIDTH,10.0,HEIGHT,14.0,UNITS,inches;

[0083] Line 4: PlotPrintToPDF"Plot_name1","C:\PLOT\Plot_name1.pdf";

[0084] Line 5: SavePlotToEMF"Plot_name1","C:\PLOT\Plot_name1.emf",WIDTH,548,HEIGHT,933;

[0085] Line 6: SavePlotToCSV "Plot_name1", "C:\PLOT\Plot_name1.csv".

[0086] Among them, "Plot_name1" is the name of the waveform read.

[0087] The recording file in the above format is saved in the PLOT folder of the C drive. Users can modify "C:\PLOT\" as needed to change the path where the recording file is saved. For example, this text can be modified to "D:\PLOT\", and the recording file is saved in the PLOT folder of the D drive.

[0088] It should be noted that in the jpg format text saved in line 3, the width and height of the jpg image can be modified, such as setting the width to 10 inches and the height to 14 inches.

[0089] In the 5th line, when saving the text in EMF format, you can modify the width and height of the EMF image, such as setting the width to 548 and the height to 933.

[0090] Step 206, saving the text information in a preset file;

[0091] After the text information is generated by using a preset template, the generated text information may be saved in a file of a preset format, such as a .scr file.

[0092] Step 207, determining whether the preset character segment has been searched; if not, returning to the step of searching the preset character segment in the .sib file and reading the row value of the preset character segment;

[0093] Step 208: If yes, generate a recording and saving script using a preset file.

[0094] After the text information is saved in the preset file, the preset character segment in the .sib file can be continuously searched. If the search is not completed, the process returns to step 202. If the search is completed, the preset file containing each preset character segment is used as a recording saving script.

[0095] The present invention reads a .sib file; searches for a preset character segment in the .sib file and reads the row value of the preset character segment; determines a target row value according to the row value and obtains a waveform name according to the target row value; fills the waveform name into a preset template to generate text information; saves the text information in a preset file; determines whether the preset character segment is searched; if not, returns to the step of searching for the preset character segment in the .sib file and reading the row value of the preset character segment; if yes, generates a recording and saving script using the preset file. This makes the generation of the recording and saving script unnecessary for the user to manually save the recording operation, and the operation is simpler.

[0096] See also Figure 3 , Figure 3 A structural block diagram of a recording and saving script generation device provided in an embodiment of the present invention.

[0097] The embodiment of the present invention provides a recording and saving script generation device, which is applied to RSCAD, and the device includes:

[0098] A reading module 301 is used to read a .sib file;

[0099] A search module 302, used for searching a preset character segment in a .sib file and reading a row value of the preset character segment;

[0100] The waveform name acquisition module 303 is used to determine the target row value according to the row value, and acquire the waveform name according to the target row value;

[0101] The text information generating module 304 is used to fill the waveform name into the preset template to generate text information;

[0102] The text information saving module 305 is used to save the text information in a preset file;

[0103] The judging module 306 is used to judge whether the preset character segment has been searched; if not, return to the step of searching the preset character segment in the .sib file and reading the row value of the preset character segment;

[0104] The recording and saving script generating module 307 is used to generate the recording and saving script using a preset file if so.

[0105] In the embodiment of the present invention, the text information generating module 304 includes:

[0106] The file format selection submodule is used to select the file format from the preset templates;

[0107] The text information generation submodule is used to save the waveform name in a preset template in a file format to generate text information.

[0108] In an embodiment of the present invention, the file format includes: one or more of Comtrade format, mpb format, jpg format, pdf format, emf format and csv format.

[0109] In an embodiment of the present invention, the device further includes:

[0110] A waveform generation module, used for acquiring power system data and generating a waveform using the power system data;

[0111] The waveform saving module is used to save the waveform in a .sib file and add a waveform name to each waveform.

[0112] An embodiment of the present invention further provides an electronic device, the device comprising a processor and a memory:

[0113] The memory is used to store the program code and transmit the program code to the processor;

[0114] The processor is used to execute the recording and saving script generation method of the embodiment of the present invention according to the instructions in the program code.

[0115] The embodiment of the present invention further provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the method for generating a recording and saving script according to the embodiment of the present invention.

[0116] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0117] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0118] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0119] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0120] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0122] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0123] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0124] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating a recording and saving script, characterized in that: Applied to RSCAD, the method comprises: Read .sib file; Searching for a preset character segment in the .sib file, and reading the row value of the preset character segment; Determine a target row value according to the row value, and obtain a waveform name according to the target row value; Fill the waveform name into a preset template to generate text information; Saving the text information in a preset file; Determine whether the preset character segment has been searched; if not, return to the step of searching the preset character segment in the .sib file and reading the row value of the preset character segment; If so, the preset file is used to generate a recording and saving script.

2. The method according to claim 1, characterized in that The step of filling the waveform name into a preset template to generate text information includes: Select a file format from the preset template; The waveform name is saved in the preset template in the file format to generate text information.

3. The method according to claim 2, characterized in that The file formats include: one or more of Comtrade format, mpb format, jpg format, pdf format, emf format and csv format.

4. The method according to claim 1, characterized in that: Before the step of reading the .sib file, the method further includes: Acquiring power system data, and generating a waveform using the power system data; The waveforms are saved in the .sib file, and a waveform name is added to each of the waveforms.

5. A recording and saving script generation device, characterized in that: Applied to RSCAD, the device comprises: Reading module, used to read .sib files; A search module, used for searching a preset character segment in the .sib file and reading a row value of the preset character segment; A waveform name acquisition module, used to determine a target row value according to the row value, and acquire a waveform name according to the target row value; A text information generating module, used for filling the waveform name into a preset template to generate text information; A text information saving module, used to save the text information in a preset file; A judging module, used for judging whether the preset character segment has been searched; if not, returning to the step of searching the preset character segment in the .sib file and reading the row value of the preset character segment; The recording and saving script generation module is used to use the preset file to generate the recording and saving script.

6. The device according to claim 5, characterized in that The text information generating module comprises: A file format selection submodule, used to select a file format in the preset template; The text information generation submodule is used to save the waveform name in the preset template in the file format to generate text information.

7. The device according to claim 6, characterized in that The file formats include: one or more of Comtrade format, mpb format, jpg format, pdf format, emf format and csv format.

8. The device according to claim 5, characterized in that The device also includes: A waveform generation module, used to obtain power system data and generate a waveform using the power system data; The waveform saving module is used to save the waveform in the .sib file and add a waveform name to each waveform.

9. An electronic device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the recording and saving script generation method described in any one of claims 1-4 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program code, and the program code is used to execute the recording and saving script generation method described in any one of claims 1-4.