CN109117130A - A kind of timing diagram based on MDD automatically generates the method, system and memory of state transition matrix - Google Patents
A kind of timing diagram based on MDD automatically generates the method, system and memory of state transition matrix Download PDFInfo
- Publication number
- CN109117130A CN109117130A CN201810850370.2A CN201810850370A CN109117130A CN 109117130 A CN109117130 A CN 109117130A CN 201810850370 A CN201810850370 A CN 201810850370A CN 109117130 A CN109117130 A CN 109117130A
- Authority
- CN
- China
- Prior art keywords
- state
- event
- sentence
- timing diagram
- script
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
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
- G06F8/35—Creation or generation of source code model driven
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
- G06F40/18—Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/186—Templates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Stored Programmes (AREA)
Abstract
The present invention relates to methods, system and memory that the timing diagram based on MDD automatically generates state transition matrix, the timing diagram script write according to Plantuml syntax format is parsed by ruby language, obtain all event and states, and performed active statement after some event is received under some state, and be saved as element object;Then it uses the erb technology of ruby to call the element object saved in above-mentioned analyzing step in template according to the syntax format compiling HTML file template of HTML markup language, and these element objects is combined into a state transition matrix.The present invention improves the efficiency of software development on the whole, reduces exploitation working hour, guarantees the consistency of state transition design and timing G- Design, while improving the correctness of state transition matrix design.
Description
Technical field
The present invention relates to computer software programs application fields, and in particular to a kind of timing diagram based on MDD automatically generates
Method, system and the memory of state transition matrix.
Background technique
As vehicle electronics product is more and more, function is more and more abundant, so that when interaction in each product software level
Sequence is more and more frequently and complicated, and consequent is that trigger event and state are more and more, so present software program is to shape
State transition matrix design techniques using more and more extensive.But traditional state matrix design method is comparatively laborious, expends big
Working hour is measured, needs the activity that each event triggers under state and event in the manual timing diagram of designer and each state one by one
It fills in state transition matrix, when encountering complicated interaction timing, possible state and event have tens respectively, two-by-two group
Workload altogether is very large, and error-prone.Therefore, we have proposed one kind to be based on MDD (Model Drive
Design, model-driven design) the timing diagram method that automatically generates state transition matrix.
Summary of the invention
The present invention for the technical problems in the prior art, provides a kind of timing diagram based on MDD and automatically generates shape
Method, system and the memory of state transition matrix build timing artwork by Plantuml (one kind of UML modeling language)
Then type draws chart technique using html format, generate state transition matrix according to timing diagram.
The technical scheme to solve the above technical problems is that
On the one hand, the present invention provides a kind of method that the timing diagram based on MDD automatically generates state transition matrix, including with
Lower step:
The text sentence of timing diagram script is write according to demand;
The text sentence is parsed, the execution sentence after receiving certain event under all events, state and certain state is obtained,
And the event, state, execution sentence are saved as into element object;
Using erb technology according to the syntax format compiling HTML file template of HTML markup language, and according to the HTML
File template generation includes the html file of state transition matrix.
Further, the text sentence is the timing diagram script write by Plantuml script grammer;The solution
The text sentence is analysed, parses the text sentence specifically by ruby language.
Further, the parsing text sentence obtains and receives certain event under all events, state and certain state
Execution sentence afterwards, and the event, state, execution sentence are saved as into element object, comprising:
Read each line statement of timing diagram script file;
According to receiving the execution sentence after certain event under script grammar extraction state and event and certain state;
Array is stored in using state and event as element object;
The key-value pair two-dimensional array of sentence deposit with state event binding will be executed.
Further, by after state and event deposit array, deduplication operates are executed.
Further, the html file is a table array, and the column of the table array correspond to each event, the table
The row of matrix corresponds to each state, and each cell in the table array indicates that the cell corresponds to the touching of event and state
Hair activity.
On the other hand, the present invention also provides a kind of system that the timing diagram based on MDD automatically generates state transition matrix, packets
It includes:
Script input module, for obtaining the text sentence for the timing diagram script write according to demand;
Statement parsing module obtains for parsing the text sentence and receives certain under all events, state and certain state
Execution sentence after event, and the event, state, execution sentence are saved as into element object;
Matrix generation module, for the syntax format compiling HTML file mould using erb technology according to HTML markup language
Plate, and include the html file of state transition matrix according to the html file template generation.
Further, the text sentence is the timing diagram script write by Plantuml script grammer;The sentence
Parsing module parses the text sentence by ruby language.
Further, the statement parsing module, is specifically used for:
Read each line statement of timing diagram script file;
According to receiving the execution sentence after certain event under script grammar extraction state and event and certain state;
It is stored in array using state and event as element object, then executes deduplication operates;
The key-value pair two-dimensional array of sentence deposit with state event binding will be executed.
Further, the html file that the matrix generation module generates is a table array, the column pair of the table array
Each event is answered, the row of the table array corresponds to each state, and each cell in the table array indicates the unit
Lattice correspond to the triggered activity of event and state.
The third aspect, the present invention also provides a kind of memory, which is stored with is based on for realizing above-mentioned one kind
The timing diagram of MDD automatically generates the computer program of the method for state transition matrix.
The beneficial effects of the present invention are:
1. writing timing by Plantuml script grammer, figure timing is become into text sentence, so that parsing timing
And it obtains the object in timing diagram (state, event, and execute sentence) and becomes easy.
2. use text generation mould plate technique (such as erb technology of Ruby), to the final html text for expecting to generate into
Row template is write, for object (state, the event, and hold extracted in the variable element and timing diagram in html file template
Line statement) it is bound, so that generating state transition matrix becomes possible.
The present invention improves the efficiency of software development on the whole, reduces exploitation working hour, guarantees state transition design and timing diagram
The consistency of design, while improving the correctness of state transition matrix design.
Detailed description of the invention
Fig. 1 is the method for the present invention flow chart;
Fig. 2 is present system structure chart.
Specific embodiment
The principle and features of the present invention will be described below with reference to the accompanying drawings, and the given examples are served only to explain the present invention, and
It is non-to be used to limit the scope of the invention.
The method of state transition matrix, system are automatically generated the invention discloses a kind of timing diagram based on MDD and are deposited
Reservoir parses the timing diagram script write according to Plantuml syntax format by ruby language, obtains all event and shape
Performed active statement after some event is received under state and some state, and is saved as element object;Then it uses
The erb technology of ruby is called in html file template according to the syntax format compiling HTML file template of HTML markup language
The element object saved in analyzing step is stated, and these element objects are combined into a state transition matrix, is finally presented on
It on webpage, and is provided on webpage and state matrix is adjusted for user with lower button: moved left and right event, move up and down state, compiled
Webpage is collected, webpage is saved.
MDD:Model Drive Design (model-driven design)
Here Model refers to a kind of model, for example passes through Plantuml (one kind of UML modeling language) in this method
The timing diagram built is exactly a kind of model.And model is namely based on according to timing diagram generation state transition matrix to drive shape
The design of state transition matrix.
It is specific:
As shown in Figure 1, the present invention provides a kind of method that the timing diagram based on MDD automatically generates state transition matrix, packet
Include following steps:
According to demand, timing diagram script is write by Plantuml script grammer;It is write by Plantuml script grammer
Figure timing is become text sentence by timing so that parse timing and obtain the object in timing diagram (state, event, and
Execute sentence) it becomes easy.
The text sentence is parsed by ruby language, reads each line statement of timing diagram script file;
According to receiving the execution sentence after certain event under script grammar extraction state and event and certain state;
It is stored in array using state and event as element object, and executes deduplication operates;
The key-value pair two-dimensional array of sentence deposit with state event binding will be executed.
Using erb technology according to the syntax format compiling HTML file template of HTML markup language, and according to the HTML
File template generation includes the html file of state transition matrix.
Further, the html file is a table array, and the column of the table array correspond to each event, the table
The corresponding each state of the row of matrix, ergodic state and event in text template, and the write-in of the execution sentence of the two is corresponding
Cell.
Using text generation mould plate technique (such as erb technology of Ruby), expect that the html text generated carries out to final
Template is write, for object (state, event, and the execution extracted in the variable element and timing diagram in html file template
Sentence) it is bound, so that generating state transition matrix becomes possible.
On the other hand, the present invention also provides a kind of systems that the timing diagram based on MDD automatically generates state transition matrix, such as
Shown in Fig. 2, comprising:
Script input module, for obtaining the text sentence for the timing diagram script write according to demand;
Statement parsing module obtains for parsing the text sentence and receives certain under all events, state and certain state
Execution sentence after event, and the event, state, execution sentence are saved as into element object;
Matrix generation module, for the syntax format compiling HTML file mould using erb technology according to HTML markup language
Plate, and include the html file of state transition matrix according to the html file template generation.
The third aspect, the present invention also provides a kind of memory, which is stored with is based on for realizing above-mentioned one kind
The timing diagram of MDD automatically generates the computer program of the method for state transition matrix.
The present invention improves the efficiency of software development on the whole, reduces exploitation working hour, guarantees state transition design and timing diagram
The consistency of design, while improving the correctness of state transition matrix design.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and
Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.
Claims (10)
1. a kind of method that the timing diagram based on MDD automatically generates state transition matrix, which comprises the following steps:
The text sentence of timing diagram script is write according to demand;
The text sentence is parsed, obtains the execution sentence after receiving certain event under all events, state and certain state, and will
The event, state, execution sentence save as element object;
Using erb technology according to the syntax format compiling HTML file template of HTML markup language, and according to the html file
Template generation includes the html file of state transition matrix.
2. the method according to claim 1, wherein the text sentence is to pass through Plantuml script grammer
The timing diagram script write;The parsing text sentence parses the text sentence specifically by ruby language.
3. the method according to claim 1, wherein the parsing text sentence, obtain all events,
Execution sentence after receiving certain event under state and certain state, and the event, state, execution sentence are saved as into element pair
As, comprising:
Read each line statement of timing diagram script file;
According to receiving the execution sentence after certain event under script grammar extraction state and event and certain state;
Array is stored in using state and event as element object;
The key-value pair two-dimensional array of sentence deposit with state event binding will be executed.
4. according to the method described in claim 3, it is characterized in that, by after state and event deposit array, to the shape in array
State and event execute deduplication operates.
5. the method according to claim 1, wherein the html file is a table array, the table square
The column of battle array correspond to each event, and the row of the table array corresponds to each state, each cell table in the table array
Show that the cell corresponds to the triggered activity of event and state.
6. a kind of system that the timing diagram based on MDD automatically generates state transition matrix characterized by comprising
Script input module, for obtaining the text sentence for the timing diagram script write according to demand;
Statement parsing module obtains for parsing the text sentence and receives certain event under all events, state and certain state
Execution sentence afterwards, and the event, state, execution sentence are saved as into element object;
Matrix generation module, for the syntax format compiling HTML file template using erb technology according to HTML markup language, and
It include the html file of state transition matrix according to the html file template generation.
7. system according to claim 6, which is characterized in that the text sentence is to pass through Plantuml script grammer
The timing diagram script write;The statement parsing module parses the text sentence by ruby language.
8. system according to claim 6, which is characterized in that the statement parsing module is specifically used for:
Read each line statement of timing diagram script file;
According to receiving the execution sentence after certain event under script grammar extraction state and event and certain state;
It is stored in array using state and event as element object, then executes deduplication operates;
The key-value pair two-dimensional array of sentence deposit with state event binding will be executed.
9. system according to claim 6, which is characterized in that the html file that the matrix generation module generates is a table
Lattice matrix, the column of the table array correspond to each event, the corresponding each state of the row of the table array, the table array
In each cell indicate that the cell corresponds to the triggered activity of event and state.
10. a kind of memory, which is characterized in that the memory is stored with to be based on for realizing one kind described in claim 1-5
The timing diagram of MDD automatically generates the computer program of the method for state transition matrix.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810850370.2A CN109117130B (en) | 2018-07-28 | 2018-07-28 | Method and system for automatically generating state transition matrix based on MDD timing diagram and memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810850370.2A CN109117130B (en) | 2018-07-28 | 2018-07-28 | Method and system for automatically generating state transition matrix based on MDD timing diagram and memory |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109117130A true CN109117130A (en) | 2019-01-01 |
CN109117130B CN109117130B (en) | 2022-02-11 |
Family
ID=64863556
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810850370.2A Active CN109117130B (en) | 2018-07-28 | 2018-07-28 | Method and system for automatically generating state transition matrix based on MDD timing diagram and memory |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109117130B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112614205A (en) * | 2020-12-28 | 2021-04-06 | 推想医疗科技股份有限公司 | Image reconstruction method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101282345A (en) * | 2008-03-03 | 2008-10-08 | 北京航空航天大学 | Method for converting XML based on formalization description and state ontroller system |
CN102685128A (en) * | 2012-05-09 | 2012-09-19 | 东南大学 | Protocol construction method based on state machine |
CN107292043A (en) * | 2017-06-29 | 2017-10-24 | 同济大学 | A kind of reconfigurable manufacturing system analysis method modeled based on UML OPN |
-
2018
- 2018-07-28 CN CN201810850370.2A patent/CN109117130B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101282345A (en) * | 2008-03-03 | 2008-10-08 | 北京航空航天大学 | Method for converting XML based on formalization description and state ontroller system |
CN102685128A (en) * | 2012-05-09 | 2012-09-19 | 东南大学 | Protocol construction method based on state machine |
CN107292043A (en) * | 2017-06-29 | 2017-10-24 | 同济大学 | A kind of reconfigurable manufacturing system analysis method modeled based on UML OPN |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112614205A (en) * | 2020-12-28 | 2021-04-06 | 推想医疗科技股份有限公司 | Image reconstruction method and device |
CN112614205B (en) * | 2020-12-28 | 2021-09-28 | 推想医疗科技股份有限公司 | Image reconstruction method and device |
Also Published As
Publication number | Publication date |
---|---|
CN109117130B (en) | 2022-02-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102663103B (en) | Configurable method for automatically generating database and accessing data | |
CN109918370B (en) | WEB-based development method and system for configurable form application front end | |
CN105426204A (en) | Web high-speed loading rendering method based on domestic CPU, operating system and browser | |
CN106446292B (en) | A kind of implementation method and device of the two-way binding of front end data | |
CN105183489A (en) | Extjs frame based intelligent data analysis system and method | |
CN109766529B (en) | Report generation method and equipment | |
CN104484216A (en) | Method and device for generating service interface document and on-line test tool | |
CN112083920A (en) | Front-end page design method, device, storage medium and equipment | |
CN102360290A (en) | Form building device and form building method | |
CN108595334B (en) | Method and device for calculating dynamic slices of Java program and readable storage medium | |
CN103634154A (en) | Simulation system and simulation method for network state | |
US20180225098A1 (en) | Systems and methods for producing launchers for a mobile terminal | |
CN103020112A (en) | Heterogeneous database synchronizing system and heterogeneous database synchronizing method | |
CN100449484C (en) | Method and system for generating artificial equipment panel | |
CN109117130A (en) | A kind of timing diagram based on MDD automatically generates the method, system and memory of state transition matrix | |
CN115658323A (en) | FPGA load flow calculation acceleration architecture and method based on software and hardware cooperation | |
WO2021197273A1 (en) | Redundant code removing method, apparatus and device, and computer readable storage medium | |
CN111190587A (en) | Method and system for automatically generating engineering front-end code based on JDBC | |
CN106569838A (en) | QP frame-based automatic code generator | |
CN104346378B (en) | A kind of method, apparatus and system for realizing complex data processing | |
CN106372359B (en) | A kind of equipment virtual prototype system | |
CN103051728A (en) | Remote-procedure calling method | |
CN106896956B (en) | The implementation method of multi-point touch under one kind " road " system | |
CN106776275B (en) | A kind of testing process automatic generation method based on Packet Multiplexing | |
CN106227667A (en) | A kind of method for generating test case of the Mobile solution of IFML based on extension |
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 |