Electronic system arrangement method and device based on sequence graph modelTechnical field
The present invention relates to field of computer technology, more particularly, to the electronic system arrangement method based on sequence graph model andDevice.
Background technology
SysML (System Modeling Language), as the Modeling language of system engineering, for by soft or hardThe structure of integration system of complication system explanation, analysis, design and the verification that part, data and people's synthesis form.
Modelook is a system modeling tool based on SysML, and Use Case Map, activity can be designed in ModelookFigure, precedence diagram and state machine diagram.Again after the completion of system modelling, simulating, verifying need to be carried out to model.Precedence diagram therein containsThe physical structure model of system and Action logic model, and have specification can be used for emulate.But in actual application, it is based onThe precedence diagram of SysML is inaccurate to the description of emulation, and redundancy is more, and the accuracy of Model Digitization emulation is impacted.
Invention content
In view of this, the purpose of the present invention is to provide electronic system arrangement method and device based on sequence graph model,Redundancy can be rejected, improves the accuracy of digitalized artificial.
In a first aspect, an embodiment of the present invention provides the electronic system arrangement method based on sequence graph model, the methodIncluding:
The data information of the sequence graph model is obtained, the data information includes quantity and the portion of external component lifelineThe quantity of part lifeline;
The quantity of painting canvas subregion is calculated according to the quantity of the quantity of the external component lifeline and the component lifeline;
Determine the height of each painting canvas subregion and the Number of Models of the setting in each painting canvas subregion;
The Number of Models of setting in the sequence graph model and each painting canvas subregion is in the painting canvas subregionIn rearrangement is carried out to the external component lifeline and the component lifeline, obtain new model.
With reference to first aspect, an embodiment of the present invention provides the first possible embodiment of first aspect, wherein, instituteThe quantity that painting canvas subregion is calculated according to the quantity of the external component lifeline and the quantity of the component lifeline is stated, including:
It is totalized quantity according to the quantity of the quantity of the external component lifeline and the component lifeline;
According to the total quantity and preset quantity, the quantity of the painting canvas subregion is obtained;
Wherein, the preset quantity is the Number of Models of the setting in each painting canvas subregion, and each painting canvas dividesThe Number of Models of setting in area is less than 5.
The possible embodiment of with reference to first aspect the first, an embodiment of the present invention provides second of first aspectPossible embodiment, wherein, the method further includes:
If the quantity of the painting canvas subregion is decimal, the quantity of the painting canvas subregion is carried out to add 1, and round numbers.
With reference to first aspect, an embodiment of the present invention provides the third possible embodiment of first aspect, wherein, instituteThe Number of Models of the setting in the sequence graph model and each painting canvas subregion is stated in the painting canvas subregion to instituteIt states external component lifeline and the component lifeline carries out rearrangement, obtain new model, including:
The precedence diagram of the external component lifeline according to the sequence graph model and the component lifeline and everyThe Number of Models of setting in a painting canvas subregion determines external component lifeline and institute described in each painting canvas subregionState the position of component lifeline;
According to the position and the external component lifeline of the external component lifeline and the component lifeline andMessage relationship in the precedence diagram of the component lifeline carries out the external component lifeline and the component lifeline weightNew arrangement, obtains the new model.
The third possible embodiment with reference to first aspect, an embodiment of the present invention provides the 4th kind of first aspectPossible embodiment, wherein, the left end of the new model and upper end are input side, and right end and lower end is export side.
Second aspect, the embodiment of the present invention also provide the electronic system arrangement apparatus based on sequence graph model, described deviceIncluding:
Acquisition module, for obtaining the data information of the sequence graph model, the data information is given birth to including external componentOrder the quantity of line and the quantity of component lifeline;
Computing module calculates picture for the quantity of the quantity according to the external component lifeline and the component lifelineThe quantity of cloth subregion;
Determining module, for determining the mould of the setting in the height of each painting canvas subregion and each painting canvas subregionType number;
Arrangement module, the Number of Models for the setting in the sequence graph model and each painting canvas subregion existRearrangement is carried out to the external component lifeline and the component lifeline in the painting canvas subregion, obtains new model.
With reference to second aspect, an embodiment of the present invention provides the first possible embodiment of second aspect, wherein, instituteComputing module is stated to be specifically used for:
It is totalized quantity according to the quantity of the quantity of the external component lifeline and the component lifeline;
According to the total quantity and preset quantity, the quantity of the painting canvas subregion is obtained;
Wherein, the preset quantity is the Number of Models of the setting in each painting canvas subregion, and each painting canvas dividesThe Number of Models of setting in area is less than 5.
With reference to the first possible embodiment of second aspect, an embodiment of the present invention provides second of second aspectPossible embodiment, wherein, the computing module is specifically used for:
If the quantity of the painting canvas subregion is decimal, the quantity of the painting canvas subregion is carried out to add 1, and round numbers.
With reference to second aspect, an embodiment of the present invention provides the third possible embodiment of second aspect, wherein, instituteArrangement module is stated to be specifically used for:
The precedence diagram of the external component lifeline according to the sequence graph model and the component lifeline and everyThe Number of Models of setting in a painting canvas subregion determines external component lifeline and institute described in each painting canvas subregionState the position of component lifeline;
According to the position and the external component lifeline of the external component lifeline and the component lifeline andMessage relationship in the precedence diagram of the component lifeline carries out the external component lifeline and the component lifeline weightNew arrangement, obtains the new model.
With reference to the third possible embodiment of second aspect, an embodiment of the present invention provides the 4th kind of second aspectPossible embodiment, wherein, the left end of the new model and upper end are input side, and right end and lower end is export side.
An embodiment of the present invention provides electronic system arrangement method and device based on sequence graph model, including:It obtains suitableThe data information of sequence graph model, data information include the quantity of external component lifeline and the quantity of component lifeline;According to outerThe quantity of portion's component lifeline and the quantity of component lifeline calculate the quantity of painting canvas subregion;Determine the height of each painting canvas subregionWith the Number of Models of the setting in each painting canvas subregion;The model of setting in sequence graph model and each painting canvas subregionNumber carries out rearrangement in painting canvas subregion to external component lifeline and the component lifeline, obtains new model, can be withRedundancy is rejected, improves the accuracy of digitalized artificial.
Other features and advantages of the present invention will illustrate in the following description, also, partly become from specificationIt obtains it is clear that being understood by implementing the present invention.The purpose of the present invention and other advantages are in specification, claimsAnd specifically noted structure is realized and is obtained in attached drawing.
For the above objects, features and advantages of the present invention is enable to be clearer and more comprehensible, preferred embodiment cited below particularly, and coordinateAppended attached drawing, is described in detail below.
Description of the drawings
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution of the prior artEmbodiment or attached drawing needed to be used in the description of the prior art are briefly described, it should be apparent that, in being described belowAttached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative laborIt puts, can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is the electronic system arrangement method flow chart based on sequence graph model that the embodiment of the present invention one provides;
Fig. 2 is precedence diagram model schematic provided by Embodiment 2 of the present invention;
Fig. 3 is new model layout viewing provided by Embodiment 2 of the present invention;
Fig. 4 is the electronic system arrangement apparatus schematic diagram based on sequence graph model that the embodiment of the present invention three provides.
Icon:
10- acquisition modules;20- computing modules;30- determining modules;40- arrangement modules.
Specific embodiment
Purpose, technical scheme and advantage to make the embodiment of the present invention are clearer, below in conjunction with attached drawing to the present inventionTechnical solution be clearly and completely described, it is clear that described embodiment be part of the embodiment of the present invention rather thanWhole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premiseLower all other embodiments obtained, shall fall within the protection scope of the present invention.
For ease of understanding the present embodiment, describe in detail below to the embodiment of the present invention.
Embodiment one:
Fig. 1 is the electronic system arrangement method flow chart based on sequence graph model that the embodiment of the present invention one provides.
With reference to Fig. 1, this method includes the following steps:
Step S101, the data information of acquisition sequence graph model, the quantity of data information including external component lifeline andThe quantity of component lifeline;
Step S102 calculates the number of painting canvas subregion according to the quantity of the quantity of external component lifeline and component lifelineAmount;
Step S103 determines the height of each painting canvas subregion and the Number of Models of the setting in each painting canvas subregion;
Here, the model of the setting in each painting canvas subregion is rectangle, and height and width acquiescence specification are 20px*30px;, it is specified that the acquiescence specification of new painting canvas is 1024px*768px before new model generation.
Rectangle between upper and lower different subregions will have interval, and to ensure not to be overlapped between model, the height of each subregion is minimum50, if subregion is excessive, the painting canvas height of acquiescence can be led to can not ensure that the height of each subregion is more than 50 after subregion, thenThe wide height of graph area need to be expanded.15 models are at most placed in each subregion, otherwise need to expand the width of graph area.
Step S104, the Number of Models of the setting in sequence graph model and each painting canvas subregion are right in painting canvas subregionExternal component lifeline and component lifeline carry out rearrangement, obtain new model.
Specifically, the component lifeline of foundation precedence diagram, the sequence from left to right of external component lifeline in each subregion,It is equidistantly put successively from left to right in each painting canvas subregion.
After the completion of putting, according to the connection relation of component lifeline and external component lifeline in reading order graph model(i.e. message), statistical input output dependence, in painting canvas by input, the output phase with connection be determined as identical relationship.
Further, step S102 includes the following steps:
Step S201 totalizes quantity according to the quantity of the quantity of external component lifeline and component lifeline;
Step S202 according to total quantity and preset quantity, obtains the quantity of painting canvas subregion;
Wherein, Number of Models of the preset quantity for the setting in each painting canvas subregion, setting in each painting canvas subregionNumber of Models is less than 5.
Further, the method further includes:
If the quantity of the painting canvas subregion is decimal, the quantity of the painting canvas subregion is carried out to add 1, and round numbers.
Further, step S104 includes the following steps:
Step S301, according to the precedence diagram of sequence graph model outer member lifeline and component lifeline and eachThe Number of Models of setting in painting canvas subregion determines the position of each painting canvas subregion outer member lifeline and component lifelineIt puts;
Step S302, according to the position and external component lifeline and portion of external component lifeline and component lifelineMessage relationship in the precedence diagram of part lifeline carries out rearrangement to external component lifeline and component lifeline, obtains newModel.
Further, the left end of new model and upper end are input side, and right end and lower end is export side.
Embodiment two:
Fig. 2 is precedence diagram model schematic provided by Embodiment 2 of the present invention.
With reference to Fig. 2, sequence graph model includes the precedence diagram of 1 external component lifeline and 4 component lifeline compositions, suitableMessage in sequence figure between component lifeline and component lifeline, external component lifeline and component lifeline is represented by signal.RootNew model is generated according to sequence graph model, specifically can refer to Fig. 3, the generation of new model specifically includes following steps:
Step S401 totalizes quantity according to the quantity of the quantity of external component lifeline and component lifeline, wherein,The quantity of external component lifeline is 1 and the quantity of component lifeline is 4, therefore total quantity is 5;
Step S402 according to total quantity and preset quantity, obtains the quantity of painting canvas subregion, wherein, preset quantity 4,The quantity of so painting canvas subregion is 5/4+1=2 subregion, if the quantity of painting canvas subregion is decimal, to painting canvas subregionQuantity carries out adding 1, and round numbers;
Step S403 determines the height of each painting canvas subregion and the Number of Models of the setting in each painting canvas subregion, wherein,The height of each painting canvas subregion is more than 50, and preset quantity is the Number of Models of the setting in each painting canvas subregion, and each painting canvas dividesThe Number of Models of setting in area is less than 5, therefore the Number of Models of the setting in each painting canvas subregion is 4;
Step S404, according to the precedence diagram of sequence graph model outer member lifeline and component lifeline and eachThe Number of Models of setting in painting canvas subregion determines the position of each painting canvas subregion outer member lifeline and component lifelineIt puts, wherein, each subregion places 4 models, therefore external component lifeline, component lifeline 1, component life are placed in subregion ALine 2 and component lifeline 3, placing component life 4 in subregion B;
After step S405, rearrangement and calculating, the message transformation between external component lifeline 1 and component lifeline 1 isTransitive relation 1, the signal between component lifeline 1 and component lifeline 2 are converted into transitive relation 2, and component lifeline 2 is exported to portionThe signal of part lifeline 3 is converted into transitive relation 3, and component lifeline 3 exports to the signal of component lifeline 2 and is converted into transmission passIt is 4, component lifeline 3 is exported to the signal of component lifeline 4, is converted into transitive relation 5, wherein, signal 2 and signal 6 are portionsThe processing logic certainly of part lifeline 1 and component lifeline 3, does not occur in new model.
Embodiment three:
Fig. 4 is the electronic system arrangement apparatus schematic diagram based on sequence graph model that the embodiment of the present invention three provides.
With reference to Fig. 4, which includes acquisition module 10, computing module 20, determining module 30 and arrangement module 40.
Acquisition module 10, for the data information of acquisition sequence graph model, data information includes external component lifelineThe quantity of quantity and component lifeline;
Computing module 20 calculates painting canvas subregion for the quantity of the quantity according to external component lifeline and component lifelineQuantity;
Determining module 30, for determining the model of the setting in the height of each painting canvas subregion and each painting canvas subregionNumber;
Arrangement module 40 is divided for the Number of Models of the setting in sequence graph model and each painting canvas subregion in painting canvasRearrangement is carried out to external component lifeline and the component lifeline in area, obtains new model.
Further, computing module 20 is specifically used for:
It is totalized quantity according to the quantity of the quantity of external component lifeline and component lifeline;
According to total quantity and preset quantity, the quantity of painting canvas subregion is obtained;
Wherein, Number of Models of the preset quantity for the setting in each painting canvas subregion, setting in each painting canvas subregionNumber of Models is less than 5.
Further, computing module 20 is specifically used for:
If the quantity of painting canvas subregion is decimal, the quantity of painting canvas subregion is carried out to add 1, and round numbers.
Further, arrangement module 40 is specifically used for:
According in the precedence diagram and each painting canvas subregion of sequence graph model outer member lifeline and component lifelineSetting Number of Models, determine the position of each painting canvas subregion outer member lifeline and component lifeline;
According to the position and external component lifeline of external component lifeline and component lifeline and component lifelineMessage relationship in precedence diagram carries out rearrangement to external component lifeline and component lifeline, obtains new model.
Further, the left end of new model and upper end are input side, and right end and lower end is export side.
The embodiment of the present invention also provides a kind of electronic equipment, including memory, processor and storage on a memory and canThe computer program run on a processor, processor perform computer program when realize above-described embodiment provide based on sequenceThe step of electronic system arrangement method of graph model.
The embodiment of the present invention also provides a kind of computer readable storage medium, and meter is stored on computer readable storage mediumCalculation machine program performs the arrangement of the electronic system based on sequence graph model of above-described embodiment when computer program is run by processorThe step of method.
The computer program product that the embodiment of the present invention is provided, the computer-readable storage including storing program codeMedium, the instruction that said program code includes can be used for performing the method described in previous methods embodiment, and specific implementation can be joinedSee embodiment of the method, details are not described herein.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing descriptionWith the specific work process of device, the corresponding process in preceding method embodiment can be referred to, details are not described herein.
In addition, in the description of the embodiment of the present invention unless specifically defined or limited otherwise, term " installation ", " phaseEven ", " connection " should be interpreted broadly, for example, it may be being fixedly connected or being detachably connected or be integrally connected;It canTo be mechanical connection or be electrically connected;It can be directly connected, can also be indirectly connected by intermediary, Ke YishiConnection inside two elements.For the ordinary skill in the art, above-mentioned term can be understood at this with concrete conditionConcrete meaning in invention.
If the function is realized in the form of SFU software functional unit and is independent product sale or in use, can be withIt is stored in a computer read/write memory medium.Based on such understanding, technical scheme of the present invention is substantially in other wordsThe part contribute to the prior art or the part of the technical solution can be embodied in the form of software product, the meterCalculation machine software product is stored in a storage medium, is used including some instructions so that a computer equipment (can bePeople's computer, server or network equipment etc.) perform all or part of the steps of the method according to each embodiment of the present invention.And aforementioned storage medium includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-OnlyMemory), arbitrary access are depositedThe various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.
In the description of the present invention, it should be noted that term " " center ", " on ", " under ", "left", "right", " vertical ",The orientation or position relationship of the instructions such as " level ", " interior ", " outer " be based on orientation shown in the drawings or position relationship, merely toConvenient for the description present invention and simplify description rather than instruction or imply signified device or element must have specific orientation,With specific azimuth configuration and operation, therefore it is not considered as limiting the invention.In addition, term " first ", " second "," third " is only used for description purpose, and it is not intended that instruction or hint relative importance.
Finally it should be noted that:Embodiment described above, only specific embodiment of the invention, to illustrate the present inventionTechnical solution, rather than its limitations, protection scope of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hairIt is bright to be described in detail, it will be understood by those of ordinary skill in the art that:Any one skilled in the artIn the technical scope disclosed by the present invention, it can still modify to the technical solution recorded in previous embodiment or can be lightIt is readily conceivable that variation or equivalent replacement is carried out to which part technical characteristic;And these modifications, variation or replacement, do not makeThe essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover the protection in the present inventionWithin the scope of.Therefore, protection scope of the present invention described should be subject to the protection scope in claims.