Inter-module real-time synchronization method based on internal memory data framework
Technical field
The present invention relates to model-driven Integrated Development Environment technology, especially a kind of efficiently dynamic consistent method of model information between implementation tool.
Technical background
Along with the development of auto industry, Auto Electronic Controlled System is just experiencing growth at a high speed in the complexity of functional area.Although many software provisionings commercial city has proposed the solution of oneself, how to allow the better collaborative work of each instrument, thereby realize real technological breakthrough, still be the important topic that an academia and industry member require study.
AUTOSAR (AUTomotive Open System ARchitecture) is the automotive electronics software architecture of an opening, unites release by famous motor corporations such as BMW, continents.From technical standpoint, the AUTOSAR tissue is devoted to promote the cooperation of developer on standard, and then improves performance and the security of electric-control system, finally controls thus the growing complexity of automatically controlled software.
The AUTOSAR standard code at software development phase, is carried out the component software design for virtual functions bus (VFB), thereby needn't be concerned about the hardware characteristics of bottom.During last deployment software assembly, realize the virtual functions bus by runtime environment (RTE) and basic software assembly.Component software (component) is the unit of package application program, comprises various port and interface (port interface) for communication.In AUTOSAR, assembly that can nested other component software is called combine component (composition), and not subdivisible assembly is called atom component (atomic component).
SmartSAR IDE is embedded system engineering center of Zhejiang University for the vehicle electric field of the AUTOSAR standard research and development Integrated Development Environment based on model-driven.According to AUTOSAR methodology, SmartSAR IDE is divided into three instruments: be used for carrying out the SmartSAR Designer of System Component Design, carry out the SmartSAR ConfigurationGenerator of system configuration and carry out the automatically SmartSAR Generator. of generation of document, code
The nest relation of AUTOSAR assembly is very complicated, and when the developer component design tool, how making various model maintenances unanimously is a very scabrous problem.Moreover, in the performance history of reality, need repeatedly iteration to use component design instrument and system configuration utility.The existing mode that communicates by the XML file needs continuous manually-operated, has hindered the lifting of development efficiency.
Summary of the invention
For component design instrument and the system configuration utility that overcomes prior art can not be consistent, the shortcoming that development efficiency is low, the invention provides a kind of component design instrument and system configuration utility of making and be consistent the inter-module real-time synchronization method based on internal memory data framework that development efficiency is high.
Inter-module real-time synchronization method based on internal memory data framework may further comprise the steps:
1), reads the software assembly model that meets the AUTOSAR standard, generate the directed acyclic graph that characterizes all component model and paradigmatic relation thereof, the node of directed acyclic graph is corresponding one by one with the component model type, and the directed edge of directed acyclic graph represents the paradigmatic relation between component model;
2) hash table that, foundation is corresponding with described directed acyclic graph, the energy fast finding arrives arbitrary component model, the key word (key) of each bar record of hash table is the full name of corresponding assembly, and value (value) is address and whole direct precursor thereof of corresponding assembly;
3), the rule of component model is revised in definition, alteration ruler is corresponding one by one with the modification type, revise type and comprise the deletion component model, the a certain example of deletion component model, a certain port in the deletion component model, the plug-in package model inserts new example in existing component model, in existing component model, insert new port, revise component model; Described example and port all belong to component model information, are stored in the node of directed acyclic graph;
4), obtain model modification information, model modification information comprise modification target element full name and revise type, model modification information is deposited in the operation queue;
5), whether the decision operation formation is empty: if operation queue is not sky, the configuration information in the read operation formation is identified and is revised type, it is corresponding with alteration ruler, revises directed acyclic graph and hash table according to alteration ruler; If operation queue is empty, then wait for, until there is New model modification information to deposit in the operation queue.
Further, step 3) in, the definition alteration ruler may further comprise the steps:
(3.1) deletion component model type (type) may further comprise the steps: the node corresponding with current component model in the search directed acyclic graph, delete this node and directed edge thereof; Search for the record corresponding with current component model in the hash table, obtain all direct precursor of current component model, revise the pointer of these direct precursor;
(3.2) a certain example (prototype) of deletion component model type (type) may further comprise the steps: the node corresponding with current component model in the search directed acyclic graph, judge whether unique example of current component model of example to be deleted, if not unique example is then deleted this example; If unique example is then deleted this node and directed edge thereof; Search for the record corresponding with current component model in the hash table, obtain all direct precursor of current component model, revise the pointer of these direct precursor;
(3.3) a certain port (port-interface) in the deletion component model type (type) may further comprise the steps: the node corresponding with current component model in the search directed acyclic graph, delete this port;
(3.4) plug-in package types of models (type) may further comprise the steps: make up the node of a directed acyclic graph, current component model information is deposited in this node, this node is inserted in the described directed acyclic graph; A newly-built hash table record, with the full name of current component model as key word (key), with the address of current component model and all direct precursor thereof as value (value);
(3.5) may further comprise the steps to the middle new example (prototype) that inserts of existing component model type (type): the node corresponding with current component model in the search directed acyclic graph, new example is inserted this node, add the paradigmatic relation of component model and this new example;
(3.6) may further comprise the steps to the middle new port (port-interface) that inserts of existing component model type (type): the node corresponding with current component model in the search directed acyclic graph enters this node with new port;
(3.7) revise component model type (type), the node corresponding with current component model in the search directed acyclic graph revised nodal information; Search for the record corresponding with current component model in the hash table, obtain all direct precursor of current component model, revise the pointer of these direct precursor.
Technical conceive of the present invention is: the present invention by in internal memory, set up and keep one with the AUTOSAR standard in the data structure of one to one directed acyclic graph and hash table of component model, and the alteration ruler of a series of modification models of predefine, when model information changes, with this model modification information and alteration ruler coupling, then revise directed acyclic graph and hash table information according to alteration ruler, thereby guarantee the synchronous of system configuration utility and component design instrument.
The present invention has following advantage:
1. based on the data structure among the present invention and model modification rule, solved efficiently the problem of component design instrument and system configuration utility information inconsistency.
2. solved simultaneously the component model consensus of AUTOSAR component design instrument.
Description of drawings
Fig. 1 is real-time synchronization general frame figure of the present invention
Fig. 2 is the schematic diagram of directed acyclic graph of the present invention and hash table combination
Fig. 3 is hash table structural drawing of the present invention
Fig. 4 is operational processes process flow diagram of the present invention
Fig. 5 is the processing flow chart of deletion component model of the present invention
Embodiment
With reference to accompanying drawing, further specify the present invention:
Inter-module real-time synchronization method based on internal memory data framework may further comprise the steps:
1), reads the software assembly model that meets the AUTOSAR standard, generate the directed acyclic graph that characterizes all component model and paradigmatic relation thereof, the node of directed acyclic graph is corresponding one by one with the component model type, and the directed edge of directed acyclic graph represents the paradigmatic relation between component model;
2) hash table that, foundation is corresponding with described directed acyclic graph, the energy fast finding arrives arbitrary component model, the key word (key) of each bar record of hash table is the full name of corresponding assembly, and value (value) is address and whole direct precursor thereof of corresponding assembly;
3), the rule of component model is revised in definition, alteration ruler is corresponding one by one with the modification type, revise type and comprise the deletion component model, the a certain example of deletion component model, a certain port in the deletion component model, the plug-in package model inserts new example in existing component model, in existing component model, insert new port, revise component model; Described example and port all belong to component model information, are stored in the node of directed acyclic graph;
4), obtain model modification information, model modification information comprise modification target element full name and revise type, model modification information is deposited in the operation queue;
5), whether the decision operation formation is empty: if operation queue is not sky, the configuration information in the read operation formation is identified and is revised type, it is corresponding with alteration ruler, revises directed acyclic graph and hash table according to alteration ruler; If operation queue is empty, then wait for, until there is New model modification information to deposit in the operation queue.
Further, step 3) in, the definition alteration ruler may further comprise the steps:
(3.1) deletion component model type (type) may further comprise the steps: the node corresponding with current component model in the search directed acyclic graph, delete this node and directed edge thereof; Search for the record corresponding with current component model in the hash table, obtain all direct precursor of current component model, revise the pointer of these direct precursor;
(3.2) a certain example (prototype) of deletion component model type (type) may further comprise the steps: the node corresponding with current component model in the search directed acyclic graph, judge whether unique example of current component model of example to be deleted, if not unique example is then deleted this example; If unique example is then deleted this node and directed edge thereof; Search for the record corresponding with current component model in the hash table, obtain all direct precursor of current component model, revise the pointer of these direct precursor;
(3.3) a certain port (port-interface) in the deletion component model type (type) may further comprise the steps: the node corresponding with current component model in the search directed acyclic graph, delete this port;
(3.4) plug-in package types of models (type) may further comprise the steps: make up the node of a directed acyclic graph, current component model information is deposited in this node, this node is inserted in the described directed acyclic graph; A newly-built hash table record, with the full name of current component model as key word (key), with the address of current component model and all direct precursor thereof as value (value);
(3.5) may further comprise the steps to the middle new example (prototype) that inserts of existing component model type (type): the node corresponding with current component model in the search directed acyclic graph, new example is inserted this node, add the paradigmatic relation of component model and this new example;
(3.6) may further comprise the steps to the middle new port (port-interface) that inserts of existing component model type (type): the node corresponding with current component model in the search directed acyclic graph enters this node with new port;
(3.7) revise component model type (type), the node corresponding with current component model in the search directed acyclic graph revised nodal information; Search for the record corresponding with current component model in the hash table, obtain all direct precursor of current component model, revise the pointer of these direct precursor.
Technical conceive of the present invention is: the present invention by in internal memory, set up and keep one with the AUTOSAR standard in the data structure of one to one directed acyclic graph and hash table of component model, and the alteration ruler of a series of modification models of predefine, when model information changes, with this model modification information and alteration ruler coupling, then revise directed acyclic graph and hash table information according to alteration ruler, thereby guarantee the synchronous of system configuration utility and component design instrument.
The described content of this instructions embodiment only is enumerating the way of realization of inventive concept; protection scope of the present invention should not be regarded as only limiting to the concrete form that embodiment states, protection scope of the present invention also reaches in those skilled in the art conceives the equivalent technologies means that can expect according to the present invention.