CN109214043B - Artificial intelligence writing method for digital aircraft dynamics environment information transmission source code - Google Patents

Artificial intelligence writing method for digital aircraft dynamics environment information transmission source code Download PDF

Info

Publication number
CN109214043B
CN109214043B CN201810806222.0A CN201810806222A CN109214043B CN 109214043 B CN109214043 B CN 109214043B CN 201810806222 A CN201810806222 A CN 201810806222A CN 109214043 B CN109214043 B CN 109214043B
Authority
CN
China
Prior art keywords
source code
file
information transmission
transmission source
dynamic environment
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.)
Active
Application number
CN201810806222.0A
Other languages
Chinese (zh)
Other versions
CN109214043A (en
Inventor
董云峰
李锦辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN201810806222.0A priority Critical patent/CN109214043B/en
Publication of CN109214043A publication Critical patent/CN109214043A/en
Application granted granted Critical
Publication of CN109214043B publication Critical patent/CN109214043B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents

Abstract

The invention discloses an artificial intelligence writing method for a source code of a dynamic environment information transmission of a digital aircraft, which comprises the following steps: decomposing a dynamic environment information transmission source code, a sensor detection information transmission source code and an actuator action information transmission source code, storing the decomposed codes as a code fragment template into a code library, and establishing a template path; acquiring a digital aircraft stream design XML file and a package design database; writing a dynamic environment information transmission source code file, a sensor detection information transmission source code file and an execution mechanism action information transmission source code file; writing an auxiliary source code file; and combining the dynamic environment information transmission source code file, the sensor detection information transmission source code file, the actuator action information transmission source code file and the auxiliary source code file. The invention writes the source code by using the artificial intelligence programmer technology, thereby reducing the workload of people in the writing process of the source code.

Description

Artificial intelligence writing method for digital aircraft dynamics environment information transmission source code
Technical Field
The invention relates to the technical field of writing source codes of digital aircrafts by artificial intelligence programmers, in particular to an artificial intelligence writing method for source codes of dynamic environment information transmission of a digital aircraft.
Background
Aircraft include, but are not limited to, airplanes, missiles, satellites, space shuttles. The digital aircraft is a dynamic simulation system which is completely consistent with the functions, compositions, structures, modes, programs and operations of a real aircraft and operates in a software simulation space environment.
The proportion of simulation verification by using the digital world in the current engineering design, research and development and test processes is greatly improved, the test cost of the aircraft is high, and the effect of the digital aircraft is more obvious. The code development amount of the digital aircraft is large, the repeated workload of people is reduced by the intelligent writing technology of the source code, and the key technology is an artificial intelligence programmer. The artificial intelligence programmer decomposes the decision making process of the human writing program and combines various artificial intelligence methods according to the characteristics of each part. The writing object of the artificial intelligence program source is a digital aircraft source code, the digital aircraft source code can be divided into a static part and a dynamic part, wherein the static source code part can be decomposed into information packet transmission, remote measurement, remote control and the like.
The information packet transmission is an important part of the digital aircraft source code with strong universality and wide application range, the digital aircraft single machine component and the dynamic environment information transmission are a key ring, and the digital aircraft digital packet transmission has the problems of variable formats, variable channels, variable protocols and the like, so that the difficulty in writing the information packet transmission source code is caused.
Therefore, how to provide a simpler writing method for a packet transmission source code is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, the invention provides an artificial intelligence writing method for a source code of a digital aircraft dynamic environment information transmission, which writes the source code by using an artificial intelligence programmer technology, reduces the workload of people in the source code writing process, reduces the subjective factors of people in the source code of the digital aircraft, and is convenient for management and communication.
In order to achieve the purpose, the invention adopts the following technical scheme:
a digital aircraft dynamics environment information transmission source code artificial intelligence writing method comprises the following steps:
decomposing a dynamic environment information transmission source code, a sensor detection information transmission source code and an actuator action information transmission source code in advance according to a dependent component type, storing the decomposed codes as a code fragment template into a code library, and establishing a corresponding template path according to the component type;
acquiring a digital aircraft stream design XML file and a package design database;
reading the template and writing the template according to the XML file and the information carried in the package design database and the template path to obtain a dynamic environment information transmission source code file, a sensor detection information transmission source code file and an execution mechanism action information transmission source code file;
writing an auxiliary source code file according to the XML file and the information carried in the package design database;
and combining the dynamic environment information transmission source code file, the sensor detection information transmission source code file, the actuator action information transmission source code file and the auxiliary source code file according to the information carried in the packet design database to obtain the dynamic environment information transmission source code of the digital aircraft.
Preferably, the information stored in the XML file includes but is not limited to: entity type, subsystems comprised by the aircraft, component types comprised under each subsystem, component model numbers comprised by each component type, number of components per component signal, installation information for each component, and granularity of each aircraft source code generated.
Preferably, the table group included in the package design database includes but is not limited to: an entity definition table, a single machine group configuration table, a bus configuration table and a federal configuration table;
the information stored in the entity definition table comprises the code number, the name and the entity type of the digital aircraft, wherein the entity type comprises a satellite, a missile, an airplane, a naval vessel and a ground station;
storing component information contained in an entity in a single unit configuration table, wherein the component information comprises but is not limited to a gyroscope, a thruster, a momentum wheel contained in a satellite, a steering engine contained in a missile, an engine and an aircraft dynamic environment virtual component contained in a missile;
real buses among the aircraft components, wireless links among the aircraft, and virtual buses among the aircraft single machine components and the dynamic environment are defined in the bus configuration table;
the information saved in the federal configuration chart includes the name of the federal, the name of the project folder of the production process, and the components included in the federal.
Preferably, the auxiliary source code includes a dynamic environment virtual channel initialization header file and a sensor actuator channel initialization header file.
Preferably, the dynamic environment information transmission source code file, the sensor detection information transmission source code file, the actuator action information transmission source code file and the auxiliary source code file are combined according to components contained in a federal configuration table; the auxiliary source code comprises a dynamic environment virtual channel initialization head file and a sensor execution mechanism channel initialization head file.
Specifically, if the federal configuration table contains a dynamic environment virtual component, a dynamic and environment information transmission source code file and a dynamic environment virtual channel initialization header file are combined into a project directory; if the federal configuration table contains sensor parts, combining a sensor detection information transmission source code file and a sensor actuator virtual channel initialization head file into an engineering directory; and if the federal configuration table contains an executing mechanism part, combining an executing mechanism action information transmission source code file and a sensor executing mechanism virtual channel initialization head file into an engineering directory.
Preferably, the writing process of the dynamic environment virtual channel initialization file comprises the following steps:
creating a virtual channel initialization header file according to the entity type of the digital aircraft, and defining the dynamic environment virtual channel as a one-dimensional array;
and querying the entity number in the entity definition according to the dimension of the array to obtain the dynamic environment virtual channel macro definition of the entity, wherein the dynamic environment virtual channel macro definition is used as the value of the array in the dimension.
Preferably, the writing process of the sensor actuator channel initialization header file includes:
creating a sensor actuator channel initialization header file according to the federal configuration table, and traversing an entity definition table; and obtaining a dynamic environment virtual bus connected with virtual components corresponding to the aircraft entity and bus numbers of the sensor virtual component, the execution mechanism virtual component and the dynamic environment virtual component on the bus according to the entity definition table, the single unit definition table and the bus definition table to finish the channel initialization code of the entity. And writing all entity codes in the entity definition table in sequence to obtain the channel initialization header file of the sensor actuating mechanism.
According to the technical scheme, compared with the prior art, the invention discloses and provides the artificial intelligence writing method for the source code of the digital aircraft dynamics environment information transmission, the artificial intelligence programmer technology is used for writing the source code, the workload of people in the source code writing process is reduced, the subjective factors of people in the source code of the digital aircraft are reduced, and the management and the communication are convenient.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of an artificial intelligence writing method for a source code of a digital aircraft dynamics environment information transmission provided by the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to the attached figure 1, the embodiment of the invention discloses an artificial intelligence writing method for a source code of a digital aircraft dynamics environment information transmission, which comprises the following steps:
s1, decomposing a dynamic environment information transmission source code, a sensor detection information transmission source code and an actuator action information transmission source code in advance according to a dependent component type, storing the decomposed codes as a code fragment template into a code library, and establishing a corresponding template path according to the component type;
s2, acquiring a digital aircraft stream design XML file and a package design database;
s3, reading the template according to the information carried in the XML file and the package design database and the template path and writing the template to obtain a dynamic environment information transmission source code file, a sensor detection information transmission source code file and an execution mechanism action information transmission source code file;
s4, writing an auxiliary source code file according to the XML file and the information carried in the package design database;
and S5, combining the dynamic environment information transmission source code file, the sensor detection information transmission source code file, the actuator action information transmission source code file and the auxiliary source code file according to the information carried in the packet design database to obtain the dynamic environment information transmission source code of the digital aircraft.
In order to further optimize the above technical solution, the information stored in the XML file includes but is not limited to: entity type, subsystems included in the aircraft, component types included under each subsystem, component models included in each component type, component number of each component signal, installation information of each component, and granularity of each generated aircraft source code.
In order to further optimize the above technical solution, the table group included in the package design database includes but is not limited to: an entity definition table, a single machine group configuration table, a bus configuration table and a federal configuration table;
the information stored in the entity definition table comprises the code number, the name and the entity type of the digital aircraft, wherein the entity type comprises a satellite, a missile, an airplane, a naval vessel and a ground station;
storing component information contained in an entity in a single unit configuration table, wherein the component information comprises but is not limited to a gyroscope, a thruster, a momentum wheel contained in a satellite, a steering engine contained in a missile, an engine and an aircraft dynamic environment virtual component contained in a missile;
real buses among the aircraft components, wireless links among the aircraft, and virtual buses among the aircraft single machine components and the dynamic environment are defined in the bus configuration table;
the information stored in the federal configuration chart includes the name of the federal, the name of the project folder of the production process, and the components included in the federal.
In order to further optimize the technical scheme, the auxiliary source code comprises a dynamic environment virtual channel initialization header file and a sensor actuator channel initialization header file.
In order to further optimize the technical scheme, a dynamic environment information transmission source code file, a sensor detection information transmission source code file, an execution mechanism action information transmission source code file and an auxiliary source code file are combined according to components contained in a federal configuration table; the auxiliary source code comprises a dynamic environment virtual channel initialization header file and a sensor execution mechanism channel initialization header file.
Specifically, if the federal configuration table contains a dynamic environment virtual component, a dynamic and environment information transmission source code file and a dynamic environment virtual channel initialization header file are combined into a project directory; if the federal configuration table contains sensor parts, combining a sensor detection information transmission source code file and a sensor actuator virtual channel initialization head file into an engineering directory; and if the federal configuration table contains an executing mechanism part, combining an executing mechanism action information transmission source code file and a sensor executing mechanism virtual channel initialization head file into an engineering directory.
In order to further optimize the technical scheme, the writing process of the dynamic environment virtual channel initialization file comprises the following steps:
creating a virtual channel initialization header file according to the entity type of the digital aircraft, and defining the dynamic environment virtual channel as a one-dimensional array;
and querying the entity number in the entity definition according to the dimension of the array to obtain the dynamic environment virtual channel macro definition of the entity as the value of the array on the dimension.
In order to further optimize the above technical solution, the writing process of the sensor actuator channel initialization header file includes:
and establishing a sensor actuator channel initialization header file according to the federal configuration table, traversing the entity definition table, and obtaining a dynamic environment virtual bus connected with virtual parts corresponding to the aircraft entity and bus numbers of the sensor virtual part, the actuator virtual part and the dynamic environment virtual part on the bus according to the entity definition table, the single unit definition table and the bus definition table to complete the channel initialization code of the entity. And writing all entity codes in the entity definition table in sequence to obtain the channel initialization header file of the sensor actuating mechanism.
The artificial intelligence writing method for the source code of the dynamic environment information transmission of the digital aircraft is specifically described below.
Firstly, an information transmission source code segment library is established in advance according to system dimension decomposition
The decomposition from the file hierarchy includes the following: the dynamic environment information transmission source code, the sensor detection information transmission source code and the actuator function information transmission source code.
(1) Dynamic environment information transmission source code
The source codes which are divided into different entities according to entity types comprise satellites, missiles, airplanes, naval vessels and the like, and entity folders are established in a code library. The secondary function level decomposition comprises a sensor detection information transmission channel initialization function, a sensor detection information packet sending function, an actuator action information packet receiving and unpacking function and an actuator action effect initialization function. The sensor detection information package sending function and the execution mechanism function information package receiving and unpacking function are split and respectively placed into subfolders of an Output (Output) entity folder and an Input (Input) entity folder, and comprise unpacking or package code segments and local variable definition code segments, wherein the naming mode of the unpacking or package code segments is 'entity type CANIO _ identifier.c', and the local variable definition code segments are named 'VariableDefinition.c'. The execution mechanism effect initialization function is directly stored in an entity folder as a code fragment template, and the code fragment is named in an entity type CANIO _ Reset. In addition, the header file reference, the macro definition, the variable definition and the function declaration are stored in an entity folder as a code fragment, and the code fragment is named in an entity type CANIO _ head.c. The information display code segment is also stored as a code segment under the entity folder, and the code segment is named in a 'entity type CANIO _ printf.c'.
(2) Sensor detection information transmission source code
The subsystem is divided into a dynamics and control subsystem, a power subsystem, a thermal control subsystem and a measurement and control subsystem according to the fact that a sensor detection information receiving source code is established, and a sensor subsystem component folder is established in a code library. The slave function layer decomposition comprises a sensor detection packet receiving and unpacking function, a sensor detection principle simulation function, a sensor detection information sending function and a sensor action packet sending and unpacking function. The Sensor detection package receiving and unpacking function and the Sensor action package sending function are split and respectively placed into subfolders of Input (Input) and Output (Output) Sensor subsystem component folders, wherein the subfolders comprise an unpacking code segment and a package code segment, and the naming mode of the code segment is 'Sensor subsystem CANIO _ identifier _ component model.c'. In addition, the header file reference, the macro definition and the variable definition are stored as a code segment under the Sensor subsystem component folder, and the naming mode of the code segment is 'Sensor subsystem CANIO _ head.c'. The variable definitions in the input and output functions are also stored as a code segment in the Sensor subsystem component folder, and the code segments are named as "Sensor subsystem CANIO _ idefine.c" and "Sensor subsystem CANIO _ idefine.c", respectively.
(3) Actuator function information transmission source code
The subsystems are divided into a dynamics and control subsystem, a power subsystem, a thermal control subsystem and a measurement and control subsystem according to the function information sending source codes of the execution mechanism, and an execution mechanism subsystem component folder is established in a code library. The slave function layer decomposition comprises an execution mechanism packet receiving and unpacking function, an execution mechanism principle simulation function and an execution mechanism packet sending function. The method comprises the steps of splitting an executing mechanism package receiving and unpacking function and an executing mechanism package sending function, and respectively placing the split functions into subfolders of Input (Input) and Output (Output) executing mechanism subsystem component folders, wherein the subfolders comprise an unpacking code segment and a package code segment, and the naming mode of the code segment is' Actuator subsystem CANIO _ identifier _ component model. In addition, the header file reference, the macro definition and the variable definition are stored as a code segment in the execution mechanism subsystem component folder, and the code segment is named in a mode of 'Actuator subsystem CANIO _ head.c'. The variable definitions in the input and output functions are also stored as a code fragment in the execution mechanism subsystem component folder, respectively, and the code fragment names are "Sensor subsystem CANIO _ idefine.c" and "Actuator subsystem CANIO _ idefine.c", respectively. The execution mechanism effect initialization code is directly stored as a code fragment template under the execution mechanism subsystem component folder, and the code fragment is named in the mode of 'actor subsystem CANIO _ reset.c'.
The specific contents of the digital satellite stream design XML file and the package design database are obtained as follows.
Database connection and database reading are firstly carried out to obtain the number of entities, the flow corresponding to each entity designs XML, and the entities are traversed in a recycling mode to read respective XML information and store the XML information into hash tables corresponding to the entities.
The information stored in the digital satellite stream design XML file includes entity types, subsystems included in the aircraft, component types included in each subsystem, component models included in each type, the number of components in each type, installation information of each component, granularity of generated source codes of each aircraft, and the like.
The related table set in the digital satellite packet design database mainly comprises entity definition, single set configuration, bus configuration and federal configuration.
The information stored in the entity definition in the database includes the code number, name and entity type of the digital aircraft, where the entity type includes satellite, missile, airplane, naval vessel, ground station, etc.
And the stand-alone group is configured to store part information contained in the entity, such as a gyroscope, a thruster and a momentum wheel contained in a satellite, a steering engine and an engine contained in a missile, and an aircraft dynamic environment virtual part.
The bus configuration defines a real bus between the aircraft components, a wireless link between the aircraft, and a virtual bus between the aircraft individual components and the dynamic environment.
The information stored in the federal configuration chart includes the name of the federal (and the name of the project folder for the generation process), components included in the federal, and the like.
Next, the process of reading the template and performing writing operation on the template according to the XML file and the information carried in the package design database and the template path is described in detail.
(1) Dynamics and environment information transmission C file writing
The main process of code writing is as follows.
Firstly, an input path of a code segment and a path of a written C file are determined according to an entity type.
And secondly, writing a header file reference, a macro definition, a variable definition and a function declaration code according to a template 'entity type CANIO _ head.c'.
Then, a writing sensor detects information package sending functions, the names of the output functions are determined according to entity types, local variable definition codes in the output functions are written according to code segment templates 'VariableDefinition.c' local variable definition code segments, subfolders of the output code segments are traversed, package codes are written according to the templates, a plurality of package sending sentences are written according to aircraft entities contained in the federation, and sending channels in the sending sentences are written according to the entity names.
And writing an action effect initialization function of the execution mechanism, determining the name of the function according to the entity type, and completing writing according to the template.
And finally, completing writing of an executive mechanism function information receiving and unpacking function, determining the name of an output function according to the entity type, writing a local variable definition code in an input function according to a code fragment template 'VariableDefinition.c', traversing an input code fragment subfolder, writing an unpacking code according to the template, and writing an information display code in the input function according to the code fragment template 'entity type CANIO _ Printf.c'.
(2) Writing of C file by sensor detection information transmission
The main process of code writing is as follows.
Firstly, determining an input path of a code segment and a path of a written C file according to an entity type.
And secondly, reading the template 'Sensor subsystem CANIO _ head.c' line by line, replacing the special marker contained in the template with an entity name, and writing out a header file reference, a macro definition and a variable definition code.
Then writing a sensor detection function statement, traversing all components in the entity, finding out the components in which the sensor is, inquiring the corresponding stream design XML according to the entity name to obtain the components which are not generated by the granularity exclusion of the source code of the aircraft, inquiring a bus definition table to count the components which are contained in the current federation and connected on the virtual channel of the dynamic environment, finding out a code fragment of the function statement according to the component type, replacing the special marker symbol "$$$$$$$$$$$$$$$" contained in the code fragment with the entity name, replacing the contained special marker symbol "@ @ @ with the component model, and completing the writing of the sensor detection function statement.
Writing a sensor package function statement, traversing all parts in the entity, finding out the parts which are sensors, and writing the sensor package function statement according to the name of the entity and the name of the single unit in the form of' signed char cls + the name of the entity + the name of the single unit + SendData (void); ".
Then writing a virtual channel initialization function, and writing according to the entity name in the form of OpenCANDevice (entity name + sensorChannelNo); ".
Then, a writing Sensor detects a packing and unpacking function, the function name is 'sensorsCollectTrCTData', a local variable definition code in an output function is written out according to a sub-system read code segment template 'Sensor sub-system CANIO _ IDefine.c' to which a component belongs, a subfolder of the output code segment is traversed, a component model and identifier information are extracted from the file name of the code segment, the unpacking code is a branch selection statement, a branch is written out according to the identifier, whether the component model is contained in a federal configuration table or not is inquired according to the entity name, whether the code segment is written or not is determined, and the writing of the unpacking segment is completed. Reading a code segment of a sensor detection principle simulation function call statement, replacing usDeviceNo as the serial number of the single machine in the single machine set, replacing usNo as the serial number of the single machine in the single machine set, replacing '@ @ @ as the name of the single machine set, and replacing' $$$$$$$ as the name of an entity. According to the package sending function of the writing sensor of the entity name and the stand-alone group name, the form is ' ucSendDataFlag | = cls ' + the entity name + the stand-alone group name + ' SendData (); ".
And finally, writing a package sending function of the Sensor action package, wherein the function name is SensorsSendRTCData, and a local variable definition code in an output function is written according to a code fragment template read by a subsystem to which the component belongs, namely a Sensor subsystem CANIO _ ODefine.c. Traversing the sub folder of the output code segment, extracting the component model and the identifier information from the file name of the code segment, inquiring whether the component model is contained in a federal configuration table or not according to the entity name, and determining whether the code segment is written or not. Reading a function call statement code segment simulated by a sensor action principle, replacing usDeviceNo as the serial number of the single machine in the single machine set, replacing usNo as the serial number of the single machine in the single machine set, replacing '@ @ @ as the name of the single machine set, and replacing' $$$$$$$ as the name of an entity. And writing a transmitter of each subsystem to a package sending function calling code of the dynamic environment according to the entity name.
(3) Actuator action information transfer C document writing
The main process of code writing is as follows.
Firstly, determining an input path of a code segment and a path of a written C file according to an entity type.
And secondly, reading the template 'actor subsystem CANIO _ head.c' line by line, replacing the special marker contained in the template with an entity name, and writing out a header file reference, a macro definition and a variable definition code.
Writing a function statement for packing and unpacking an executing mechanism, traversing all components in the entity, finding out the component in the executing mechanism, inquiring corresponding stream design XML according to the name of the entity to obtain the components which are not generated by the granularity exclusion of an aircraft source code, inquiring a bus definition table to count the components which are contained in the current federation and connected on a dynamic environment virtual channel, finding out a code fragment of the function statement according to the type of the component, replacing a special marker "$$$$$$$$$$$$$$$$" contained in the code fragment with the name of the entity, replacing a special marker "@ @ @ contained in the code fragment with the model of the component, and completing the writing of the function statement for packing and unpacking the executing mechanism.
Writing an executing mechanism package function statement, traversing all components in the entity, finding out the components which are the executing mechanism, and writing the executing mechanism package function statement according to the entity name and the single unit name in the form of' unknown char cls + entity name + single unit name + SendData (void); ".
Then writing a virtual channel initialization function, and writing according to the entity name in the form of OpenCANDevice (entity name + ActuatorChannelNo); ".
And then writing an executing mechanism to receive and unpack a function, wherein the function name is 'ActuatorsCollectTrcData', reading a local variable definition code in an output function according to a subsystem to which a component belongs, writing a local variable definition code in the output function according to a subsystem template 'Actuator subsystem CANIO _ IDefine.c', traversing an output code segment subfolder, extracting a component model and identifier information from the file name of the code segment, writing a branch according to the identifier, inquiring whether a federal configuration table contains the component model according to the entity name, determining whether to write the code segment, and finishing the writing of the unpack segment. Reading a code fragment of a simulation function call statement of an executing mechanism principle, replacing the serial number of the single machine in the single machine set with the usDeviceNo, replacing the serial number of the single machine in the single machine set with the usNo, replacing the name of the single machine set with the "@ @ @ @ @ @ @" and replacing the name of the entity with the "$ $ $ $ $ $ $". Writing a packaging function of the executing mechanism according to the entity name and the single unit name, wherein the form is ' ucSendDataFlag | = cls ' + the entity name + the single unit name + ' SendData (); ".
And finally, writing the packet sending function of the execution mechanism group, wherein the function name is ActuatorsSendRTCData, and local variable definition codes in the output function are written according to a code fragment template read by a subsystem to which the component belongs, namely 'Actuator subsystem CANIO _ ODefine.c'. The "actor subsystem CANIO _ reset.c" code fragment is read and the Actuator effect initialization code is written. Traversing the sub folder of the output code segment, extracting the component model and the identifier information from the file name of the code segment, inquiring whether the component model is contained in a federal configuration table or not according to the entity name, and determining whether the code segment is written or not. Reading an executing mechanism action principle simulation function calling statement code segment, replacing the serial number of the single machine in the single machine set with the usDeviceNo, replacing the serial number of the single machine in the single machine set with the usNo, replacing the name of the single machine set with the "@ @ @ @ @ @" and replacing the name of the entity with the "$ $ $ $ $ $ $". And writing an execution mechanism of each subsystem to a contracting function calling code of the dynamic environment according to the entity name.
The following describes the steps of completing the writing of other auxiliary codes according to the XML file and the information carried in the package design database.
The other auxiliary source codes mainly comprise a dynamic environment virtual channel initialization header file and a sensor execution mechanism channel initialization header file.
(1) Dynamic environment virtual channel initialization header file
Creating a virtual channel initialization header file according to the entity type of the aircraft, defining the dynamic environment virtual channel as a one-dimensional array, wherein the dimension of the array is the total number of the aircraft, and the array is in the form of 'const signaled long ltctctoDeviceCANChannelNoform entity type [ dim entity type ]'. And querying the entity number in the entity definition according to the dimension of the array to obtain the dynamic environment virtual channel macro definition of the entity, wherein the dynamic environment virtual channel macro definition is used as the value of the array in the dimension.
(2) Sensor actuator channel initialization header file
And creating a sensor actuator channel initialization header file, and traversing the entity definition table to sequentially write the sensor actuator channel initialization codes of all aircrafts in sequence. And inquiring to obtain a dynamic environment virtual bus connected with the virtual parts corresponding to the aircraft entity and CANID of the sensor virtual part, the execution mechanism virtual part and the dynamic environment virtual part on the bus according to the entity definition table, the single unit definition table and the bus definition table. And obtaining a channel initialization header file of the sensor executing mechanism, wherein the channel initialization header file comprises two codes of a channel number definition of the sensor executing mechanism and a CAN (controller area network) equipment number definition of the sensor executing mechanism.
Combining the written source codes according to the information carried in the package design database
The combination of codes is performed according to the components contained in the federal. If the federation contains a dynamic environment virtual component, combining a dynamic and environment information transmission C file and a dynamic environment virtual channel initialization head file into a project directory; if the federation contains sensor parts, combining a sensor detection information transmission C file and a sensor execution mechanism virtual channel initialization head file into an engineering directory; and if the federal contains an executing mechanism part, combining an executing mechanism action information transmission C file and a sensor executing mechanism virtual channel initialization head file into a project directory.
(1) Dynamic and environmental information transmission source code
The method has the main functions that dynamic environment parameter information (such as the position, the speed, the sun vector, the earth vector and the like of an aircraft) is packaged and sent to a corresponding sensor part of the aircraft through a dynamic environment virtual bus; and receiving from the dynamic environment virtual bus the effect of the component on the environment (such as force, temperature, power, etc.), and selecting the unpacked branch code to execute based on the identifier.
The method comprises a dynamics and environment information transmission C file and a dynamics environment virtual channel initialization header file. And the dynamics and environment information transmission C file forms a complete dynamics and environment information transmission source code by referring to the header file.
(2) Sensor detection information transmission source code
The method mainly comprises the steps of receiving a dynamic environment parameter information package from a dynamic environment virtual bus, calling a corresponding sensor part detection function through an identifier in the package (for example, determining the package with a sun vector in the received information according to the identifier 0, and then calling the detection function of the sun sensor), then calling a package sending function of the sensor, and transmitting the measurement information of the sensor.
The sensor detection information transmission method comprises a sensor detection information transmission C file and a sensor execution mechanism virtual channel initialization head file. The sensor detection information transmission C file forms a complete sensor detection information transmission source code by referring to the header file.
(3) Actuator function information transfer source code writing
The method has the main functions of calling the function of the component on the environment, packaging the obtained parameters and sending the parameters to the dynamic environment virtual component through the dynamic environment virtual bus.
The method comprises an actuator action information transmission C file and a sensor actuator virtual channel initialization header file. The execution mechanism function information transmission C file forms a complete execution mechanism function information transmission source code by referring to the header file.
In the writing process, the intelligent writing method comprises the following steps: a source code writing limited selection decision method and a source code writing standard execution method. The writing of the content of the condition, the loop, the variable, the statement and the like is determined by using a limited selection decision method, for example, the decision of a channel initialization definition mode in other auxiliary source code writing. And completing the canonical source code writing by using the source code writing canonical execution method, such as writing in statements of function definition, variable naming, variable assignment, branch selection and the like.
The source code writing limited selection decision method comprises the following steps:
step one, acquiring an execution object and a decision tree according to a decision target;
the decision target comprises a universality selection decision and an application layer selection decision;
wherein the commonality selection decision comprises: selecting a simulation platform and a project, selecting a variable type, selecting a variable definition position and mode, selecting an array and a list, and selecting a circulation mode;
the application layer selection decision is to decide a simulation execution object on the basis of the specified aircraft structure and parameters.
Step two, screening the execution objects according to the input objects and the decision tree to obtain a feasible execution object set;
constructing a limited selection evaluation system comprising simulation granularity and a simulation platform;
the set of feasible execution objects is obtained according to a limited choice evaluation system, specifically comprising,
making a decision on simulation granularity according to the simulation time of the platform and the condition of occupied resources;
judging whether a real component is required to be accessed according to the simulation time of the platform and the situation of occupied resources, and making a decision on the simulation platform;
and selecting execution objects meeting the requirements of the simulation granularity and the simulation platform to form an executable execution object set.
Step three, finding characteristic parameters and corresponding calculation methods of the description execution objects under the decision target according to the decision target, and calculating the characteristic parameters of each execution object aiming at the feasible execution object set in the step two;
the characteristic parameters in the third step comprise simulation precision, simulation time and resource occupation;
the measurement standard of the simulation precision comprises simulation granularity, simulation error and calculation result precision; wherein the simulation granularity comprises a spacecraft integrity level, a subsystem level, a component level, and a component assembly level; the simulation error comprises a principle model and an error model aiming at each simulation granularity; the calculation result precision refers to the minimum resolution of the result parameters;
simulation time refers to the time actually spent in completing the calculation of a single simulation cycle;
the measurement standard of the resource occupation comprises simulation platform resources, storage resources and calculation resources; the simulation platform resources refer to the number of occupied simulation computers or simulation board cards; the storage resources refer to a fixed memory space occupied by the global variables, a heap space and a stack space occupied by the temporary variables; the computing resource refers to the complexity of the algorithm, i.e., the space occupied by the algorithm.
Step four, scoring the characteristic parameters of the execution object under the decision target; the scoring method is a normalization method, and the characteristic parameters are mapped to an interval [0,1 ].
Step five, calculating a comprehensive score to obtain an optimal execution object; and multiplying the normalized score corresponding to each characteristic parameter by the weight by adopting a weighted average mode to finally obtain a weighted score, and finding out the execution object with the highest score by comparing the scores of the execution objects to obtain the optimal execution object.
And sixthly, writing a source code according to the selected optimal execution object.
The method for executing the writing specification of the source code, namely the method for executing the decision of the writing specification of the source code specifically comprises the following steps:
the method comprises the following steps that firstly, multi-dimensional decomposition is carried out on a source code of the digital aircraft by using a multi-dimensional decomposition method to obtain a minimum decomposition result;
the decomposition method mainly comprises code hierarchy, aircraft type, system dimension, simulation granularity and cross combination among multiple decomposition methods;
clustering the minimum decomposition result, and establishing a digital aircraft source code writing decision tree;
this step can be subdivided into the following two sub-steps:
(1) And clustering the minimum decomposition result, and giving clustering bases including universality and a working logic mode of the clustered applicable objects and applicable conditions of the branches.
Clustering is carried out according to a working logic mode, a source code of a posture and orbit control subsystem in a satellite mainly comprises a posture determining module, a posture control module and a mode monitoring and switching module, a missile guidance control system comprises a flight event monitoring and switching module, a guidance module and a control module, the working logic modes of two aircrafts are basically consistent, so that the implementation modes are clustered into one class, the source code motion control part of the aircrafts is divided into three parts according to a clustered result, the first part is an aircraft state determining module, the second part is a state monitoring and specific condition meeting switching logic module in the flight process, and the third part is an aircraft motion control module.
(2) Establishing a complete decision tree of source codes of the digital aircraft written by programmers: after clustering the source code decomposition results, establishing a decision tree
Step three, establishing an artificial intelligence programmer for executing standard writing operation according to the branch condition of the decision tree; and selecting a source code writing execution method according to the application range, the change frequency and the change mode factors, and establishing an intelligent programmer.
And fourthly, reading the configuration information of the scene to be generated by the artificial intelligence programmer to generate the digital aircraft simulation source program.
This step can be subdivided into the following two small steps:
(1) Intelligent programmer reads that the required generated scene contains aircraft configuration information
The resulting artificial intelligence programmer is used to read the profile input information required to write a digital flight. The configuration file is decomposed according to file types and comprises a database, a formatted file (xml file), a file library and the like. The profiles are broken down according to applicability, including general for all aircraft, general for each type of aircraft, specific for each model, etc.
(2) And judging layer by layer according to the branch applicable conditions of the decision tree, acquiring a source code writing operation execution method, executing the writing operation and automatically generating the source code.
And in the artificial intelligent programmer, judging and screening the meeting conditions of branches of each level of the decision tree according to the branch statements of the decision tree, and searching the minimum branch of each step in the writing process.
According to the writing method of each branch, the writing of the source code of the complete digital aircraft system is completed through the modes of writing of a source code generating program, reading and writing of a database, direct copying of a file and replacement and copying of the file.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (6)

1. A digital aircraft dynamics environment information transmission source code artificial intelligence writing method is characterized by comprising the following steps:
decomposing a dynamic environment information transmission source code, a sensor detection information transmission source code and an actuator action information transmission source code according to a dependent component type in advance, storing the decomposed codes as a code fragment template into a code library, and establishing a corresponding template path according to the component type;
acquiring a digital aircraft stream design XML file and a package design database;
reading the template and writing the template according to the XML file and the information carried in the package design database and the template path to obtain a dynamic environment information transmission source code file, a sensor detection information transmission source code file and an execution mechanism action information transmission source code file;
writing an auxiliary source code file according to the XML file and the information carried in the package design database;
combining the dynamic environment information transmission source code file, the sensor detection information transmission source code file, the actuator action information transmission source code file and the auxiliary source code file according to the information carried in the packet design database to obtain a dynamic environment information transmission source code of the digital aircraft;
the set of tables contained in the package design database includes, but is not limited to: an entity definition table, a single machine group configuration table, a bus configuration table and a federal configuration table;
the information stored in the entity definition table comprises the code number, the name and the entity type of the digital aircraft, wherein the entity type comprises a satellite, a missile, an airplane, a naval vessel and a ground station;
storing component information contained in an entity in a single unit configuration table, wherein the component information comprises but is not limited to a gyroscope, a thruster and a momentum wheel contained in a satellite, a steering engine, an engine and an aircraft dynamic environment virtual component contained in a missile;
real buses among the aircraft components, wireless links among the aircraft, and virtual buses among the aircraft single machine components and the dynamic environment are defined in the bus configuration table;
the information stored in the federal configuration chart includes the name of the federal, the name of the project folder of the production process, and the components included in the federal.
2. The digital aircraft dynamics environment information transmission source code artificial intelligence writing method according to claim 1, wherein the information stored in the XML file includes but is not limited to: entity type, subsystems included in the aircraft, part type included under each subsystem, part model included per part type, part number per part signal, installation information per part, and granularity of each aircraft source code generated.
3. The method for artificially intelligently writing the source code of the information transmission of the dynamic environment of the digital aircraft according to claim 1, wherein the auxiliary source code comprises a dynamic environment virtual channel initialization header file and a sensor actuator channel initialization header file.
4. The method according to claim 3, wherein the dynamic environment information transmission source code file, the sensor detection information transmission source code file, the actuator action information transmission source code file and the auxiliary source code file are combined according to components included in a federal configuration table; the auxiliary source code comprises a dynamic environment virtual channel initialization head file and a sensor execution mechanism channel initialization head file;
specifically, if the federal configuration table contains a dynamic environment virtual component, a dynamic and environment information transmission source code file and a dynamic environment virtual channel initialization header file are combined into a project directory; if the federal configuration table contains sensor parts, combining a sensor detection information transmission source code file and a sensor actuating mechanism virtual channel initialization head file into an engineering directory; and if the federal configuration table contains an executing mechanism part, combining an executing mechanism action information transmission source code file and a sensor executing mechanism virtual channel initialization head file into an engineering directory.
5. The method for writing the artificial intelligence of the source code for transmitting the information of the dynamic environment of the digital aircraft according to claim 3, wherein the writing process of the initialization file of the virtual channel of the dynamic environment comprises:
creating a virtual channel initialization header file according to the entity type of the digital aircraft, and defining the dynamic environment virtual channel as a one-dimensional array;
and querying the entity number in the entity definition according to the dimension of the array to obtain the dynamic environment virtual channel macro definition of the entity, wherein the dynamic environment virtual channel macro definition is used as the value of the array in the dimension.
6. The method according to claim 3, wherein the writing process of the sensor actuator channel initialization header file comprises:
creating a sensor actuator channel initialization header file according to the federal configuration table, and traversing an entity definition table; obtaining a dynamic environment virtual bus connected with virtual components corresponding to an aircraft entity and bus numbers of a sensor virtual component, an execution mechanism virtual component and the dynamic environment virtual component on the bus according to an entity definition table, a single unit definition table and a bus definition table, and finishing a channel initialization code of the entity; and writing all entity codes in the entity definition table in sequence to obtain the sensor actuator channel initialization header file.
CN201810806222.0A 2018-07-20 2018-07-20 Artificial intelligence writing method for digital aircraft dynamics environment information transmission source code Active CN109214043B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810806222.0A CN109214043B (en) 2018-07-20 2018-07-20 Artificial intelligence writing method for digital aircraft dynamics environment information transmission source code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810806222.0A CN109214043B (en) 2018-07-20 2018-07-20 Artificial intelligence writing method for digital aircraft dynamics environment information transmission source code

Publications (2)

Publication Number Publication Date
CN109214043A CN109214043A (en) 2019-01-15
CN109214043B true CN109214043B (en) 2023-04-07

Family

ID=64990637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810806222.0A Active CN109214043B (en) 2018-07-20 2018-07-20 Artificial intelligence writing method for digital aircraft dynamics environment information transmission source code

Country Status (1)

Country Link
CN (1) CN109214043B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069876B (en) * 2019-04-29 2020-05-08 北京世冠金洋科技发展有限公司 Experiment management method and device
CN113296789A (en) * 2021-06-16 2021-08-24 北京有竹居网络技术有限公司 Code generation method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408120A (en) * 2014-11-26 2015-03-11 北京国双科技有限公司 Source code processing method and device
CN108287958A (en) * 2018-01-15 2018-07-17 北京航空航天大学 Artificial intelligence program person writes the limited decision Method of digital aircraft source code
CN108287959A (en) * 2018-01-15 2018-07-17 北京航空航天大学 Artificial intelligence program person writes digital aircraft source code specifications decision and executes method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2921170B1 (en) * 2007-09-14 2018-01-12 Airbus Operations METHOD FOR AUTOMATICALLY GENERATING PROGRAMS FOR TESTING AN OPERATING SOFTWARE OF AN ON-BOARD AIRCRAFT SYSTEM, AND DEVICE FOR IMPLEMENTING THE SAME

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408120A (en) * 2014-11-26 2015-03-11 北京国双科技有限公司 Source code processing method and device
CN108287958A (en) * 2018-01-15 2018-07-17 北京航空航天大学 Artificial intelligence program person writes the limited decision Method of digital aircraft source code
CN108287959A (en) * 2018-01-15 2018-07-17 北京航空航天大学 Artificial intelligence program person writes digital aircraft source code specifications decision and executes method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
卫星故障诊断系统智能研制技术研究;李洪珏等;《上海航天》;20170625(第03期);全文 *
数字卫星源代码生成技术;董云峰 等;《2015年小卫星技术交流会论文集》;20160621;全文 *
航天器控制系统方案设计平台;林瀚峥等;《计算机仿真》;20160215(第02期);全文 *

Also Published As

Publication number Publication date
CN109214043A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
CN108287959B (en) Method for executing source code of digital aircraft written by artificial intelligence programmer
CN109491266B (en) Carrier rocket flight simulation method based on multi-body virtual prototype
CN104662514A (en) Modernization of legacy software systems based on modeled dependencies
CN109062565B (en) Artificial intelligence writing method for telemetry source code of digital satellite AOS protocol
CN113435033B (en) Multi-resolution-based complex system operation flow simulation method and system
CN109214043B (en) Artificial intelligence writing method for digital aircraft dynamics environment information transmission source code
CN104331530A (en) An electronic warfare visual simulation platform based on XML description and working method thereof
CN111830861B (en) Deduction method and system for spacecraft task planning
CN113221362A (en) Satellite launching field performance test subject purpose selection method and device and electronic equipment
CN115659516A (en) MBSE-based integrated aircraft design method and system
CN109189376B (en) Artificial intelligence writing method for digital aircraft cluster source code
CN109117125B (en) Artificial intelligence writing method for source codes of digital aircraft in multiple platforms and multiple operation modes
CN111581839B (en) Method and device for processing nesting relationship of model and electronic equipment
RU2656981C1 (en) Method of automated configuration of simulation models of unmanned aerial vehicles and device for implementation thereof
CN110705091B (en) Lightweight virtual test target range object model component construction method
CN103150386A (en) Meta-model construction method of C4ISR (Command, Control, Communication, Computer, Intelligence, Surveillance and Reconnaissance) system
CN110018457B (en) Method for designing satellite-borne SAR echo data frame header identifier detection functional module
CN109213473B (en) Artificial intelligence generation method for daily operation process of satellite
CN112558498B (en) Data pool-based inter-MBSE aircraft system joint design and verification method
Zhang et al. An Improved SoSE Model–The “V+” Model
CN112989610A (en) Model-driven simulation verification method
Ni et al. An integrated architecture design method for multi-platform avionics system
KR20160077902A (en) The method for generating interface of simulation and the realtime simulation apparatus
CN113050451B (en) Modeling method and device of flight control system
CN116737311B (en) Communication-creation ecological service cloud platform interaction method

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