Summary of the invention
In view of this, the object of the present invention is to provide a kind of emulation mode and system, to overcome the shortcoming that above-mentioned Model Reuse is lower, and then improve simulation efficiency, reduce design alteration cost.
The invention discloses a kind of analogue system, comprise that N physical equipment realistic model, data sharing module, communication service module and M for connecting physical equipment, and receiving the hardware interface of the second formatted data that physical equipment sends, described M and N are not less than 1 natural number; Wherein:
Described data sharing module, is used to data sharing that storage area is provided, and described data sharing module comprises the first data sharing unit and the second data sharing unit;
Described physical equipment realistic model, arrives described the second data sharing unit for sending the data of the first form;
Described communication service module, be connected with a described M hardware interface, for when described the second data sharing unit being detected and store the data of the first form that described physical equipment realistic model sends, determine the data of the second form of the physical equipment demand accessing, corresponding relation according to predefined the second formatted data and the first formatted data, from described the second data sharing unit, obtain the data of first form corresponding with the data of the second form of described physical equipment demand, and by data described second formatted data of foundation of the first form obtaining and the corresponding relation of the first formatted data, be converted to the data of described the second form, and the data of described the second form are sent to described physical equipment, and for when receiving the data of the second form that physical equipment sends by described hardware interface, corresponding relation according to predefined the second formatted data and the first formatted data is converted to the data of the second form receiving the data of the first form, and the data of described the first form converting to are sent to described the first data sharing unit, using as described each physical equipment realistic model according to obtaining the foundation that demand is obtained from described the first data sharing unit.
Preferably, in above-mentioned analogue system, described physical equipment realistic model is also for send the data of the first form to described the first data sharing unit, and from described the first data sharing unit, obtains the data of corresponding the first form according to obtaining demand.
Analogue system based on above-mentioned, the invention also discloses a kind of emulation mode, and this emulation mode comprises:
When described communication service module detects described the second data sharing unit and stores the data of the first form that described physical equipment realistic model sends, determine the data of the second form of the physical equipment demand accessing, corresponding relation according to predefined the second formatted data and the first formatted data, from described the second data sharing unit, obtain the data of first form corresponding with the data of the second form of described physical equipment demand, and by data described second formatted data of foundation of the first form obtaining and the corresponding relation of the first formatted data, be converted to the data of described the second form, and the data of described the second form are sent to described physical equipment,
When described communication service module receives the data of the second form that physical equipment sends, corresponding relation according to predefined the second formatted data and the first formatted data is converted to the data of the second form receiving the data of the first form, and the data of described the first form converting to are sent to described the first data sharing unit, using as described each physical equipment realistic model according to obtaining the foundation that demand is obtained from described the first data sharing unit.
Preferably, above-mentioned emulation mode also comprises:
When described communication service module does not detect the data that described the second data sharing unit stores the first form of described physical equipment realistic model transmission, and described communication service module is not while receiving the data of the second form that physical equipment sends, each physical equipment realistic model sends the data of the first data layout to the first data sharing unit of described data sharing module, and from described the first data sharing unit, obtains the data of corresponding the first data layout according to obtaining demand.
Preferably, in above-mentioned emulation mode, when the data of described the first form are physical descriptor, when the data of described the second form are ICD data block, the described data by the first form obtaining are according to the corresponding relation of described the second formatted data and the first formatted data, and the data that are converted to described the second form are specially:
Corresponding relation by the physical descriptor of obtaining according to described ICD data block ID and described physical descriptor ID, is packaged into ICD data block.
Preferably, in above-mentioned emulation mode, the data that the corresponding relation of predefined the second formatted data of described foundation and the first formatted data is converted to the first form by the data of the second form receiving are specially:
Corresponding relation according to predefined described ICD data block ID and described physical descriptor ID, is bundled into physical descriptor by the ICD data block solution receiving.
In analogue system provided by the invention, the data of the first form that communication service module sends physical equipment realistic model are converted to the data of the second form, send it to afterwards physical equipment, the data of the second form that the physical equipment receiving is sent are converted to the data of the first form, for each physical equipment realistic model, obtain.Visible, while carrying out semi-physical simulation based on analogue system disclosed by the invention, the Data Format Transform effect providing by communication service module, realized the information interaction between each physical equipment realistic model and each physical equipment of access analogue system, when switching to semi-physical simulation from digital l-G simulation test, directly physical equipment is accessed to analogue system disclosed by the invention and can carry out semi-physical simulation, without the physical equipment realistic model in analogue system of the present invention, modify, also without the structure to analogue system, change, improved the reusability of analogue system, thereby improved simulation efficiency, reduced design alteration cost.
Embodiment
For making object, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The invention discloses a kind of analogue system and method, be applicable to physical equipment to carry out digital or semi-physical simulation, below will to analogue system disclosed by the invention and method, be elaborated by each embodiment.
Embodiment mono-
The embodiment of the present invention one discloses a kind of analogue system, and this system is used for realizing semi-physical simulation.Refer to Fig. 2, this analogue system comprises that N physical equipment realistic model 100, data sharing module 200, communication service module 300 and M for connecting physical equipment, and receiving the hardware interface 400 of the second formatted data that physical equipment sends, M and N are not less than 1 natural number.Wherein:
Data sharing module 200, is used to data sharing that storage area is provided, and data sharing module 200 comprises the first data sharing unit 210 and the second data sharing unit 220.
Physical equipment realistic model 100, for the data that send the first form to the second data sharing unit 220.
In the present embodiment, physical equipment can have different types according to actual application scenarios, and concrete application scenarios can have aviation avionics, vehicle, cannon, boats and ships or warship etc.The main emulation of analogue system be the data exchange process under these scenes.In the present embodiment, be specifically as follows the Aerial Electronic Equipment under aviation avionics scene, physical equipment realistic model is specially Aerial Electronic Equipment realistic model, wherein, Aerial Electronic Equipment realistic model can be used Simulink based on Aerial Electronic Equipment, the modeling tools such as Rhapsody are built, also can use the C/C++ language development of standard, logic function and the algorithm of the Aerial Electronic Equipment of the Aerial Electronic Equipment realistic model program internal description institute emulation of developing, externally use the simple data form with obvious physical meaning to carry out input and output, for example concrete use highly, speed, the physical descriptors such as longitude and latitude are carried out outside input and output.Concrete physical device type and emulator type can be set according to actual application scenarios, and the present embodiment does not limit.
Communication service module 300, be connected with M hardware interface 400, for when the second data sharing unit 220 being detected and store the data of the first form that physical equipment realistic model sends, determine the data of the second form of the physical equipment demand accessing, corresponding relation according to predefined the second formatted data and the first formatted data, from the second data sharing unit 220, obtain the data of first form corresponding with the data of the second form of physical equipment demand, and by data foundation second formatted data of the first form obtaining and the corresponding relation of the first formatted data, be converted to the data of the second form, and the data of the second form are sent to physical equipment, and for when receiving the data of the second form that physical equipment sends by hardware interface 400, corresponding relation according to predefined the second formatted data and the first formatted data is converted to the data of the second form receiving the data of the first form, and the data of the first form converting to are sent to the first data sharing unit 210, using as each physical equipment realistic model according to obtaining the foundation that demand is obtained from the first data sharing unit 210.
In the present embodiment, the data of the first form are specially physical descriptor, the data of the second form are specially the data of ICD form, all physical equipment realistic models are externally physical descriptor interface, communication service module 300 is externally ICD interface, it is actual bus communication by its ICD interface conversion that communication service module 300 based on ICD interface specifically can adopt hardware driving, realizes the data interaction with hardware interface 400.
In the present embodiment, each physical descriptor has all been defined a physical descriptor ID(Identity for identify label, identify label number), this physical descriptor ID is overall unique ID, in simulation process, the physical descriptor that physical equipment realistic model 100 has carried physical descriptor ID to 200 issues of data sharing module, other physical equipment realistic models 100 or communication service module 300 are identified physical descriptor by physical descriptor ID, realize and subscribing to.The data of ICD data layout specifically comprise ICD data block, and correspondingly, each ICD data block has all been defined an ICD data block ID, and this ICD data block ID is similarly overall unique ID, for identify ICD data block at simulation process.
The data converting function of communication service module 300 specifically can be realized by the function of packetization/depacketization, particularly, before emulation, those skilled in the art determine the corresponding relation between physical descriptor and ICD data block, by the corresponding relation between physical descriptor ID and ICD data block ID, above-mentioned corresponding relation is described, and generating configuration file, during emulation, communication service module 300 is subscribed to physical descriptor from the second data sharing unit 220, according to configuration file, the physical descriptor of subscription is packaged into corresponding ICD data block, and ICD data block is sent to physical equipment; Communication service module 300 receives after the ICD data block of physical equipment, according to configuration file, ICD data block solution is bundled into physical descriptor, and physical descriptor is distributed to the first data sharing unit 210.
To sum up, in analogue system disclosed by the invention, the data of the first form that communication service module sends physical equipment realistic model are converted to the data of the second form, send it to afterwards physical equipment, the data of the second form that the physical equipment receiving is sent are converted to the data of the first form, for each physical equipment realistic model, obtain.Visible, while carrying out semi-physical simulation based on analogue system disclosed by the invention, the Data Format Transform effect providing by communication service module 300, has realized the information interaction between each physical equipment realistic model and each physical equipment of access analogue system.When switching to semi-physical simulation from digital l-G simulation test, directly physical equipment is accessed to analogue system disclosed by the invention and can carry out semi-physical simulation, without the physical equipment realistic model in analogue system of the present invention, modify, also without the structure to analogue system, change, improved the reusability of analogue system, thereby improved simulation efficiency, reduced design alteration cost.
Embodiment bis-
The embodiment of the present invention two is on the basis of embodiment mono-, above-mentioned analogue system is further described, embodiment mono-stresses from semi-physical simulation state, and each module of analogue system is described, and the present embodiment continues the module in analogue system under digital state to expand explanation.
In simulation process, if communication service mould 300 does not detect the data that the second data sharing unit 220 stores the first form of physical equipment realistic model 100 transmissions, and communication service module 300 do not receive the data of the second form that physical equipment sends, this emulation is digital emulation.Now, communication service module 300 is no longer carried out the conversion of data layout, under this kind of state, each physical equipment realistic model 100 is for send the data of the first forms to the first data sharing unit 210, and from the first data sharing unit 210, obtains the data of corresponding the first form according to obtaining demand.
Particularly, each physical equipment realistic model 100 is issued physical descriptors to the first data sharing unit 210, and subscribes to required separately physical descriptor from the first data sharing unit 210.
In above-mentioned two embodiment, between each physical equipment realistic model and data sharing module 200, and between communication service module 300 and data sharing module 200, specifically can adopt the mechanism based on data sharing agreement usage data publish/subscribe, in the mode of sharing, realize data interaction, each physical equipment realistic model only carries out the mutual of data with data sharing module 200, and the physical descriptor of physical equipment realistic model transmitting-receiving is all from 200 issues of data sharing module or subscription.Particularly, each physical equipment realistic model is issued physical descriptors according to actual emulation demand to the first data sharing unit 210 or the second data sharing unit 220 of data sharing module 200.In embodiment mono-, emulation demand is semi-physical simulation, each physical equipment realistic model is published to the second data sharing unit 220 by physical descriptor, communication service module 300 is obtained physical descriptor corresponding to ICD formatted data needing with physical equipment from the second data sharing unit 220, then this physical descriptor is converted to ICD formatted data, sends to physical equipment.After data that physical equipment sends ICD form are to communication service module 300, communication service module 300 is converted to physical descriptor by the data of ICD form, and be published in the first data sharing unit 210, each physical equipment realistic model, according to the demand of oneself, from the first data sharing unit 210 subscription data.
And in embodiment bis-, although do not relate to the data interaction between physical equipment realistic model and communication service module 300, but between each physical equipment realistic model and data sharing module 200, also can utilize the mechanism based on data sharing agreement usage data publish/subscribe, in the mode of sharing, realize data interaction, each physical equipment realistic model and data sharing module 200 are carried out the mutual of data, and the physical descriptor of physical equipment realistic model transmitting-receiving is all from 200 issues of data sharing module or subscription.Particularly, in the present embodiment, emulation demand is digital emulation, and each physical equipment realistic model is all published to physical descriptor the first data sharing unit 210, and, from the first data sharing unit 210, in the mode of subscribing to, obtain the physical descriptor self needing.
In the disclosed analogue system of above-described embodiment, between each physical equipment realistic model, and directly do not contact between physical equipment realistic model and physical equipment, when needs communicate, the mode of being issued and being subscribed to by data, realizes the data interaction between physical equipment realistic model, thereby when simulated conditions changes, without the annexation between change physical simulation model, also without the structure of revising model.Therefore, this system can be suitable for various simulation requirements, has stronger versatility.
Embodiment tri-
The analogue system of the embodiment of the present invention three based on embodiment mono-and embodiment bis-, discloses a kind of emulation mode.
Refer to Fig. 3, corresponding to the disclosed analogue system of embodiment mono-, the present invention is a kind of flow process of emulation mode first openly, and what this flow process embodied is semi-physical simulation process, and this process specifically comprises:
Step S31: when communication service module detects the second data sharing unit and stores the data of the first form that physical equipment realistic model sends, determine the data of the second form of the physical equipment demand of access.
Step S32: according to the corresponding relation of predefined the second formatted data and the first formatted data, from the second data sharing unit, obtain the data of first form corresponding with the data of the second form of physical equipment demand, and by data foundation second formatted data of the first form obtaining and the corresponding relation of the first formatted data, be converted to the data of the second form.
Step S33: the data of the second form are sent to physical equipment.
Wherein, corresponding relation by the data of the first form obtaining according to the second formatted data and the first formatted data, the data that are converted to the second form are specially: the corresponding relation by the physical descriptor of obtaining according to ICD data block ID and physical descriptor ID, is packaged into ICD data block.
In said process, communication service module detects the data (being physical descriptor data) that whether receive the first form in the second data sharing unit in real time, if received, show that physical equipment realistic model need to carry out data interaction with physical equipment, therefore, communication service module is started working.The second formatted data in the present embodiment and the corresponding relation of the first formatted data are for predefined by configuration file.When physical descriptor data are converted to ICD data, in an ICD data block, may comprise a plurality of physical descriptors, for example, ID is 1,2 and 3 physical descriptor, the ICD data that corresponding ID is 1.Data communication module is realized Data Format Transform according to this corresponding relation.It is 1,2 and 3 physical descriptor that communication service module is obtained ID, is carried out after format conversion, obtains ID and be 1 ICD data, then these data is sent.
Step S34: when communication service module receives the data of the second form that physical equipment sends, the data of the second form receiving are converted to the data of the first form according to the corresponding relation of predefined the second formatted data and the first formatted data.
The data that the corresponding relation of predefined the second formatted data of foundation and the first formatted data is converted to the first form by the data of the second form receiving are specially: the corresponding relation according to predefined ICD data block ID and physical descriptor ID, is bundled into physical descriptor by the ICD data block solution receiving.
When communication service module receives the data of the second form that physical equipment sends, also just show to carry out the data interaction between physical equipment and physical equipment realistic model, carry out semi-physical simulation.According to above-mentioned corresponding relation, ICD data are converted to physical descriptor data.
Step S35: the data of the first form converting to are sent to the first data sharing unit, using as each physical equipment realistic model according to obtaining the foundation that demand is obtained from the first data sharing unit.
When communication service module is sent to the data of the first form after conversion behind the first data sharing unit, because whether each physical equipment realistic model all has in real-time detection the data that oneself need in the first data sharing unit, therefore, physical equipment realistic model can be according to subscribing mechanism, get the data that oneself need, complete the transmission of data from physical equipment to physical equipment realistic model.
In the disclosed emulation mode of the present embodiment, by the conversion of data layout being realized to the data interaction of physical equipment and physical equipment realistic model, thereby without system hardware is improved, improve simulation efficiency, reduced design alteration cost.
In said process, the Data Format Transform of data communication module based on beat and unpack algorithm to take the ICD data format definition file configuring before emulation be basis, data communication module reads in the corresponding relation description document of user configured physical descriptor and ICD data block, and automatically adjusts according to the renewal of corresponding relation description document the mode that unpacks algorithm process data of beating.
As shown in Figure 4, corresponding to the analogue system of embodiment bis-, the invention discloses the another kind of flow process of emulation mode, this flow process embodies the process of digital emulation, and this process comprises:
Step S41: when communication service module does not detect the data that the second data sharing unit stores the first form of physical equipment realistic model transmission, and communication service module is not while receiving the data of the second form that physical equipment sends, each physical equipment realistic model sends the data of the first data layout to the first data sharing unit of data sharing module.
Step S42: each physical equipment realistic model obtains the data of corresponding the first data layout according to obtaining demand from the first data sharing unit.
For the disclosed emulation mode of the embodiment of the present invention three, because it is corresponding with embodiment mono-and the disclosed analogue system of embodiment bis-, so that describes is fairly simple, relevant similarity refers to the explanation of analogue system part in embodiment mono-and embodiment bis-, no longer describes in detail herein.
The data exchange process of each intermodule in above-described embodiment two and the disclosed analogue system of embodiment tri-, can be with reference to shown in figure 5.
Wherein, the flow process that solid arrow represents is the flow direction of data in semi-physical simulation process, and dotted arrow represents the flow direction of data in digital simulation process.By this figure, can obviously find out, in digital simulation process, communication service module is not worked, and what participate in emulation only has physical equipment realistic model and the first data sharing unit.And when carrying out semi-physical simulation process, the unit in system all participates in, cooperation, has finally realized the data interaction between physical equipment realistic model and physical equipment mutually, has realized semi-physical simulation.
It should be noted that, each embodiment in this instructions all adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.
Finally, also it should be noted that, in this article, such as first, second, third and the fourth class relational terms be only used for an entity or operation to separate with another entity or operational zone, and not necessarily require or imply and between these entities or operation, have the relation of any this reality or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, article or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, article or equipment.The in the situation that of more restrictions not, the key element being limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.