CN114090071A - Matlab-based simulink model specification generation method - Google Patents
Matlab-based simulink model specification generation method Download PDFInfo
- Publication number
- CN114090071A CN114090071A CN202111432547.5A CN202111432547A CN114090071A CN 114090071 A CN114090071 A CN 114090071A CN 202111432547 A CN202111432547 A CN 202111432547A CN 114090071 A CN114090071 A CN 114090071A
- Authority
- CN
- China
- Prior art keywords
- simulink
- model
- matlab
- description data
- subsystems
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/73—Program documentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
- G06F9/449—Object-oriented method invocation or resolution
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the technical field of computers, in particular to a matlab-based simulink model specification generation method, which comprises the following steps: s1, establishing connection between the matlab script and the simulink model, calling an instruction of the matlab script, identifying and acquiring all subsystems of the software model, and storing specific simulink paths of all identified subsystems; s2, extracting simulink paths of all subsystems; calling an operation instruction of the matlab script to copy a vector diagram under a simulink path of the subsystem; s3, calling an interface function of the document in the first format through the matlab script, and pasting the vector diagram into the document in the first format; the technical scheme of the invention realizes automatic export of the model specification based on remarks of engineers during software development, reduces the workload of software engineers, ensures high consistency of the specification and the design and development process of software, does not need secondary writing, greatly shortens project development time and saves time and cost.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a matlab-based simulink model specification generation method.
Background
When software engineers develop software, remarks are written in the software, and the logic realized by the software is labeled. After project software is finished, an engineer is required to write a model specification for project delivery, software implementation logic needs to be written once manually, and even a model implementation mode needs to be reviewed, so that the workload is large, errors are prone to occurring, and valuable project development time is wasted.
Disclosure of Invention
The invention aims to solve the problems and provides a simulink model specification generation method based on matlab, which can replace manual work to generate a simulink model specification.
In order to realize the effect of the invention, the invention provides the following technical scheme:
a matlab-based simulink model specification generation method comprises the following steps:
s1, establishing connection between the matlab script and the simulink model, calling an instruction of the matlab script, identifying and acquiring all subsystems of the software model, and storing specific simulink paths of all identified subsystems;
s2, extracting simulink paths of all subsystems; calling an operation instruction of the matlab script to copy a vector diagram under a simulink path of the subsystem;
s3, calling an interface function of the document in the first format through the matlab script, and pasting the vector diagram into the document in the first format;
s4, calling an instruction of a matlab script, identifying and acquiring model description data of the current subsystem, and storing specific simulink paths of all identified model description data into a cache region;
s5, extracting the simulink path of the model description data of the current subsystem through the cache region, calling an operation instruction of the matlab script, and copying the model description data under the simulink path of the model description data of the subsystem;
s6, calling an interface function of the document in the first format through the matlab script, and pasting the model description data into the document in the first format;
and S7, closing and saving the document in the first format after all the subsystems in the model and the model description data thereof are pasted, and sending a completion prompt.
Further, a loop step is included between steps S6 and S7, the matlab script determines whether copying and pasting of vector diagrams and model description data of all subsystems is completed, and if not, the steps S2 to S6 are continuously executed; if so, the step S7 is executed.
Further, in the steps S2-S6, the vector diagrams and model description data of all subsystems are copied to the document in the first format in the order of the cross arrangement of the simulink model.
The matlab script is connected with the software model through operation, automatic derivation of vector diagrams and model description data of the subsystems is achieved based on remarks of engineers during software development, the vector diagrams and the model description data are stored according to the original arrangement sequence, the high consistency of the design and development processes of the specification and the software is guaranteed, manual participation is not needed during working, iteration upgrading is carried out on subsequent software, only regeneration is needed, the cost of the iteration upgrading is greatly reduced, the workload is reduced, the project development time is greatly shortened, and the time cost is saved.
Further, the find _ system instruction of the matlab script is called in the steps S1 and S4, and model description data of all subsystems and the current subsystem of the software model are identified and obtained.
Further, the operation instruction of the print of the matlab script is called in the steps S2 and S5, so as to copy the vector diagram and the model description data of the subsystem.
Further, the interface function Paste of the document in the first format is called in the steps S3 and S6, and the vector diagram and the model description data are pasted to the document in the first format.
Compared with the prior art, the invention has the beneficial effects that: based on remarks of engineers in software development, automatic derivation of the model specification is achieved, workload of software engineers is reduced, high consistency between the specification and the software design and development process is ensured, secondary writing is not needed, project development time is greatly shortened, and time cost is saved.
Description of the drawings:
fig. 1 is a schematic view of the working process of the present invention.
Detailed Description
The present invention will be described in further detail with reference to test examples and specific embodiments. It should be understood that the scope of the above-described subject matter is not limited to the following examples, and any techniques implemented based on the disclosure of the present invention are within the scope of the present invention.
A matlab-based simulink model specification generation method comprises the following steps:
s1, establishing connection between the matlab script and the simulink model, calling an instruction of the matlab script, identifying and acquiring all subsystems of the software model, and storing specific simulink paths of all identified subsystems;
s2, extracting simulink paths of all subsystems; calling an operation instruction of the matlab script to copy a vector diagram under a simulink path of the subsystem;
s3, calling an interface function of the document in the first format through the matlab script, and pasting the vector diagram into the document in the first format;
s4, calling an instruction of a matlab script, identifying and acquiring model description data of the current subsystem, and storing specific simulink paths of all identified model description data into a cache region;
s5, extracting the simulink path of the model description data of the current subsystem through the cache region, calling an operation instruction of the matlab script, and copying the model description data under the simulink path of the model description data of the subsystem;
s6, calling an interface function of the document in the first format through the matlab script, and pasting the model description data into the document in the first format;
and S7, closing and saving the document in the first format after all the subsystems in the model and the model description data thereof are pasted, and sending a completion prompt.
After the matlab script is started, manual participation is not needed, the specification of the simulink model is automatically generated, the time consumption is short, and the problem of errors existing in the traditional manual specification writing process is solved.
Specifically, a loop step is further included between steps S6 and S7, the matlab script determines whether copying and pasting of vector diagrams and model description data of all subsystems is completed, and if not, steps S2 to S6 are continuously executed; if so, go to step S7.
And the circulation step ensures that the matlab script copies the vector diagram and the model description data of the simulink model, thereby ensuring the comprehensive content of the description.
Specifically, in steps S2-S6, the vector diagrams and model description data of all subsystems are copied to the document in the first format in the order of the cross arrangement of the simulink model.
In the Simulink model, vector diagrams and model description data of all subsystems are arranged in a cross mode, namely the vector diagrams, the model description data, the vector diagrams and the model description data are arranged in a cross mode, and matlab scripts are copied in sequence according to the arrangement mode in the subsystems and are pasted in sequence in a first format document.
The matlab script is connected with the software model through operation, automatic derivation of vector diagrams and model description data of the subsystems is achieved based on remarks of engineers during software development, the vector diagrams and the model description data are stored according to the original arrangement sequence, the high consistency of the design and development processes of the specification and the software is guaranteed, manual participation is not needed during working, iteration upgrading is carried out on subsequent software, only regeneration is needed, the cost of the iteration upgrading is greatly reduced, the workload is reduced, the project development time is greatly shortened, and the time cost is saved.
Specifically, the find _ system command of the matlab script is called in steps S1 and S4, and model description data of all subsystems and the current subsystem of the software model are identified and acquired.
Specifically, in steps S2 and S5, the operation instruction of the print of the matlab script is called, and the vector diagram and the model specification data of the subsystem are copied.
Further, the interface function Paste of the document in the first format is called in steps S3 and S6, and the vector diagram and the model specification data are pasted to the document in the first format.
In practical applications, the document in the first format is often used by using a Microsoft word document.
The software engineer can manually select the simulink software description model to be generated by running the matlab script, or select all models by default through the matlab script, and the find _ system instruction of the matlab script is called to acquire all subsystems of the software model and store the identified specific simulink paths of all the subsystems into the cache region until the matlab script completes all work and sends a completion prompt.
In the later software updating, the traditional manual gradual writing of the specification is not needed, the scheme provided by the invention can be directly adopted, and the generation cost of the model specification of the software iterative upgrading is greatly reduced.
Claims (6)
1. A matlab-based simulink model specification generation method is characterized by comprising the following steps:
s1, establishing connection between the matlab script and the simulink model, calling an instruction of the matlab script, identifying and acquiring all subsystems of the software model, and storing specific simulink paths of all identified subsystems;
s2, extracting simulink paths of all subsystems; calling an operation instruction of the matlab script to copy a vector diagram under a simulink path of the subsystem;
s3, calling an interface function of the document in the first format through the matlab script, and pasting the vector diagram into the document in the first format;
s4, calling an instruction of a matlab script, identifying and acquiring model description data of the current subsystem, and storing specific simulink paths of all identified model description data into a cache region;
s5, extracting the simulink path of the model description data of the current subsystem through the cache region, calling an operation instruction of the matlab script, and copying the model description data under the simulink path of the model description data of the subsystem;
s6, calling an interface function of the document in the first format through the matlab script, and pasting the model description data into the document in the first format;
and S7, closing and saving the document in the first format after all the subsystems in the model and the model description data thereof are pasted, and sending a completion prompt.
2. The matlab-based simulink model specification generation method according to claim 1, wherein: a loop step is further included between steps S6 and S7, the matlab script judges whether copying and pasting of vector diagrams and model description data of all subsystems are completed, if not, the steps S2 to S6 are continuously executed; if so, the step S7 is executed.
3. The matlab-based simulink model specification generation method according to claim 1, wherein: in the steps S2-S6, the vector diagrams and model description data of all subsystems are copied to the document in the first format in the order of the cross arrangement of the simulink model.
4. The matlab-based simulink model specification generation method according to claim 1, wherein: the find _ system instruction of the matlab script is called in the steps S1 and S4, and model description data of all subsystems and the current subsystem of the software model are identified and obtained.
5. The matlab-based simulink model specification generation method according to claim 1, wherein: in the steps S2 and S5, the operation instruction of the print of the matlab script is called to copy the vector diagram and the model description data of the subsystem.
6. The matlab-based simulink model specification generation method according to claim 1, wherein: the interface function Paste of the document in the first format is called in the steps S3 and S6, and the vector diagram and the model specification data are pasted to the document in the first format.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111432547.5A CN114090071A (en) | 2021-11-29 | 2021-11-29 | Matlab-based simulink model specification generation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111432547.5A CN114090071A (en) | 2021-11-29 | 2021-11-29 | Matlab-based simulink model specification generation method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114090071A true CN114090071A (en) | 2022-02-25 |
Family
ID=80305468
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111432547.5A Pending CN114090071A (en) | 2021-11-29 | 2021-11-29 | Matlab-based simulink model specification generation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114090071A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115657634A (en) * | 2022-09-30 | 2023-01-31 | 成都赛力斯科技有限公司 | Automobile software architecture, module association method, computer device and storage medium |
-
2021
- 2021-11-29 CN CN202111432547.5A patent/CN114090071A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115657634A (en) * | 2022-09-30 | 2023-01-31 | 成都赛力斯科技有限公司 | Automobile software architecture, module association method, computer device and storage medium |
CN115657634B (en) * | 2022-09-30 | 2024-06-04 | 重庆赛力斯凤凰智创科技有限公司 | Automobile software architecture, module association method, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103473067B (en) | Built-in Linux subregion and data restoration method, system and system development method | |
CN108614718B (en) | The method, apparatus and realization device of start-up operation system | |
CN102567193B (en) | Method and system for converting test case to automated testing script | |
CN105867977B (en) | The upgrading of DSP user program and Flash method for down loading | |
CN101923448A (en) | Method for reading and writing conversion layer of NAND flash memory | |
US12056391B2 (en) | SSD-based log data storage method and apparatus, device and medium | |
CN114090071A (en) | Matlab-based simulink model specification generation method | |
WO2020140354A1 (en) | Full address calibration method and system supporting ultra-large calibration data volume | |
CN112463656B (en) | Method and system for recovering abnormal power failure of solid state disk and storage medium | |
WO2022188690A1 (en) | Method and apparatus for upgrading electronic device | |
CN105700890A (en) | Skill program realization method automatically deleting dangling vias in PCB design | |
CN114942965B (en) | Method and system for accelerating synchronous operation of main database and standby database | |
CN112559056B (en) | Techniques for reducing firmware activation time | |
WO2016127557A1 (en) | Method for re-establishing standby database, and apparatus thereof | |
CN112540780A (en) | System and method for realizing batch firmware upgrade of formation unmanned aerial vehicles | |
CN115391237A (en) | Garbage recovery system and method applied to flash memory storage controller | |
CN108897576A (en) | A method of the quick start BOOT based on ARM chip | |
CN101944033A (en) | Device and method for dynamically supporting multiple protocols in embedded system | |
CN109614682B (en) | Method and device for FPGA pin exchange based on Expedition PCB and storage medium | |
CN110633102A (en) | Micro-service-framework-based interface document automatic generation method and tool | |
CN107145367A (en) | A kind of visualization dissemination method developed for front end and system | |
CN106445504A (en) | Update method and system of mobile terminal device driver | |
CN201898554U (en) | Self-copying and data-recovering mobile phone | |
CN116501357A (en) | Online upgrade method of singlechip | |
CN109324929B (en) | Snapshot creating method, device and equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |