Movatterモバイル変換


[0]ホーム

URL:


CN114924727B - Automatic generation system and method for software code frame - Google Patents

Automatic generation system and method for software code frame
Download PDF

Info

Publication number
CN114924727B
CN114924727BCN202210605416.0ACN202210605416ACN114924727BCN 114924727 BCN114924727 BCN 114924727BCN 202210605416 ACN202210605416 ACN 202210605416ACN 114924727 BCN114924727 BCN 114924727B
Authority
CN
China
Prior art keywords
module
information
loading
software
code
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
CN202210605416.0A
Other languages
Chinese (zh)
Other versions
CN114924727A (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.)
Deep Blue Automotive Technology Co ltd
Original Assignee
Deep Blue Automotive Technology Co ltd
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 Deep Blue Automotive Technology Co ltdfiledCriticalDeep Blue Automotive Technology Co ltd
Priority to CN202210605416.0ApriorityCriticalpatent/CN114924727B/en
Publication of CN114924727ApublicationCriticalpatent/CN114924727A/en
Application grantedgrantedCritical
Publication of CN114924727BpublicationCriticalpatent/CN114924727B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention relates to a system and a method for automatically generating a software code frame, wherein the system comprises the following steps: the code rule loading and analyzing module is used for loading, analyzing and identifying the designated code rule configuration file; the scheme time sequence loading and analyzing module is used for loading and information extraction operation of scheme time sequences which are output objects designed by the software architecture design and the detailed scheme design; the frame module rule loading and analyzing module is used for loading the code frame template and caching the code template information; the serialization rule module is used for realizing serialization and inverse serialization of transmission information when the external interfaces of the modules interact; the software frame information fusion module is used for integrating and classifying calculation results; and the software code frame output module is used for outputting the series files and completing the generation of the software code frame. The invention can improve the automatic generation efficiency of the software code frame, reduce the investment of developers and improve the quality of the software code frame.

Description

Automatic generation system and method for software code frame
Technical Field
The invention belongs to the technical field of computers, and particularly relates to an automatic generation technology of a software code frame.
Background
Along with the promotion of the software-defined automobile process, the rapid promotion of the software product increasingly reflects the core competitiveness of an automobile enterprise, but the rapid iteration of the software product brings higher requirements to the engineering development period, quality, management and the like of automobile electronic software, and based on the requirements, the automobile software field is also standardized and exported successively, such as Classic Autosar or Adaptive Autosar, and the aim is to improve the multiplexing rate and portability of the software, shorten the development period and ensure the development quality of the software, but in many scenes, developers are still required to carry out code design, for example: insufficient funds to purchase a company or item of commercial software; in cases where there are special restrictions, such as limited platform resources, unsupported development environments, unsupported personnel capabilities, immature or not yet popular relevant specification standards, etc. Therefore, under various scenes requiring code design, the scheme can be intuitively and effectively automatically converted into the code frame, the automatic generation level and quality of the software architecture are increased, and the method has positive significance for software engineering development.
Disclosure of Invention
The invention aims to provide an automatic generation system and method for a software code frame, which solve the technical problems that: the traditional generation of a software code framework is inefficient and of low quality, requiring significant effort from the developer.
In order to solve the technical problems, the invention adopts the following technical scheme: an automatic generation system of a software code frame, which automatically generates a module-level software code frame based on a time sequence chart, a code rule, engineering interaction instructions, a frame module and a serialization rule;
The system comprises:
the code rule loading and analyzing module is used for loading, analyzing and identifying the designated code rule configuration file;
The scheme time sequence loading and analyzing module is used for loading and information extraction operation of scheme time sequences which are output objects designed by the software architecture design and the detailed scheme design;
the frame module rule loading and analyzing module is used for loading the code frame template and caching the code template information;
The serialization rule module is used for realizing serialization and inverse serialization of transmission information when the external interfaces of the modules interact;
the data structure generation module is used for combining the scheme time sequence information, the module information and the frame template information to generate a data structure necessary for codes;
The state machine generation module is used for combining the scheme time sequence information, the module information and the frame template information to generate a module state machine;
the internal interface generation module is used for generating a series of internal interfaces of the module;
the external interface generation module is used for generating external serial interfaces of the module;
The software framework information fusion module is used for integrating the code rule loading and analyzing module, the scheme time sequence loading and analyzing module, the framework module rule loading and analyzing module, the serialization rule module, the data structure generating module, the state machine generating module, the internal interface generating module and the external interface generating module and classifying calculation results;
and the software code frame output module is used for outputting the series files to finish the generation of the software code frame so as to improve the quality and the generation efficiency of the software code frame.
Preferably, the method comprises the steps of,
In the code loading and analyzing module, the code rule configuration file comprises excel, xml, json formats, the configured rules comprise Misra c and Misra c++, the configured rules comprise prefix rules, and the prefix rules comprise the specification of a prefix, namely a module generation file name, an external interface, a macro, an internal interface and a static variable.
Preferably, the method comprises the steps of,
In the scheme time sequence loading and analyzing module, the language rule identified by the module comprises a time sequence diagram described by unified modeling language UML, and module objects, interaction relations, interface names and parameter elements in the time sequence diagram are checked and extracted.
Preferably, the method comprises the steps of,
In the framework module rule loading and analyzing module, the framework template comprises a software template level template on a software unit and a task module template of MCU RTOS level, and also comprises the logic from the process entrance to the hardware initialization, the kernel object creation, the abnormal signal processing registration, the thread creation and the thread inside under Linux.
Preferably, the method comprises the steps of,
In the serialization rules module, the presettable serialization rules include Json, protobuf.
Preferably, the method comprises the steps of,
In the data structure generation module, data structures necessary for enumeration, structure type, and macro code are generated.
Preferably, the method comprises the steps of,
The state machine generation module comprises a state of a software module, an external trigger event and a state event matrix formed by the state of the software module and the external trigger event.
Preferably, the method comprises the steps of,
In the internal interface generation module, an interface of a state machine is included;
and in the external interface generating module, calling an interface of the serial number rule module to generate a serialization file or a compiling file of the external interface and the corresponding interface incidental information.
Preferably, the method comprises the steps of,
In the software code framework output module, the series of files include a data structure file, a state event interface file, an external interface file, a serialization file or a compiling file and a custom interface file.
The invention also provides a method for automatically generating the software code frame, which comprises the following steps:
S01, loading and analyzing and identifying the designated code rule configuration file;
S02, loading and information extraction operation is carried out on an output object which is a scheme time sequence and is designed through a software architecture and a detailed scheme;
s03, loading a code frame template and caching code template information;
s04, serializing and de-serializing transmission information;
S05, combining scheme time sequence information, module information and frame template information to generate a data structure necessary for codes;
s06, combining the scheme time sequence information, the module information and the frame template information to generate a module state machine;
S07, generating a serial interface in the module;
S08, generating a module external serial interface;
s09, integrating the processing result signals of the S01 to the S08 and classifying the calculation result;
S10, outputting a series of files to finish the output of the software code frame so as to improve the quality and the generation efficiency of the software code frame.
By adopting the technical scheme, the invention has the following technical effects: the invention can improve the automatic generation efficiency of the software code frame, reduce the investment of developers and improve the quality of the software code frame. Under various scenes requiring code design, the scheme can be intuitively and effectively automatically converted into a software code frame, the automatic generation level and quality of the software architecture are increased, and the method has positive significance for software engineering development.
Drawings
FIG. 1 is a schematic diagram of the components of the software framework generation.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
As shown in FIG. 1, the invention provides an automatic generation system of a software code frame, which can automatically generate a template-level software code frame by inputting a time sequence chart designed by a scheme, optional code rules and engineering interaction instructions through a developer and preset frame templates and serialization rules.
The system comprises:
And the code rule loading and analyzing module is used for loading, analyzing and identifying the designated code rule configuration file. The code rule loading and parsing module loads and parses the code rule configuration file that is specified. Wherein the code rule profile includes, but is not limited to, excel, xml, json format; the rules configured include, but are not limited to, misra C and Misra C++, and particularly include prefix rules for the model blocks, such as the specification of the block's generated file name, external interface, macro, internal interface, static variables, etc.
The scheme time sequence loading and analyzing module is used for loading and information extraction operation of scheme time sequences which are output objects subjected to software architecture design and detailed scheme design. The scheme time sequence loading and analyzing module is responsible for loading and information extraction operation of scheme time sequences which are output objects designed by a software architecture and a detailed scheme. The language rules identified by the module include, but are not limited to, timing diagrams described by Unified Modeling Language (UML), and feature elements such as module objects, interaction relations, interface names and parameters in the timing diagrams are checked and extracted.
The frame module rule loading and analyzing module is used for loading the code frame template and caching the code template information. The framework module rule loading and analyzing module is responsible for loading code framework templates and caching code template information, and the framework templates comprise, but are not limited to, software module level templates on a software unit and task module templates of MCU RTOS level, and especially comprise the steps of starting from a process entry to hardware initialization, kernel object creation, abnormal signal processing registration, thread creation and internal logic of threads under Linux, and provide preset code framework fixing information, such as language environment information, OS and kernel object information, code flow information and the like, for subsequent code framework generation.
And the serialization rule module is used for realizing serialization and inverse serialization of transmission information when the external interfaces of the modules are interacted. The serialization rule module is responsible for serialization and deserialization of transmission information when the external interface of the module is interacted, so as to enhance adaptability and standardization processing of data transmission among the modules, and the presettable serialization rule comprises, but is not limited to Json, protobuf.
And the data structure generation module is used for combining the scheme time sequence information, the module information and the frame template information to generate a module state machine. The data structure generation module is responsible for combining scheme time sequence information, module information and frame template information to flexibly generate a data structure necessary for codes such as enumeration type, structure type, macros and the like.
And the state machine generation module is used for combining the scheme time sequence information, the module information and the frame template information to generate a module state machine. The state machine generating module is responsible for combining scheme time sequence information, module information and frame template information to generate a module state machine, and particularly comprises a state of a software module, an external trigger event and a state event matrix formed by the two, and a developer can realize state machine switching control in a generated state event matrix interface.
And the internal interface generation module is used for generating internal serial interfaces of the module, including interfaces of a state machine.
And the external interface generation module is used for generating an external serial interface of the module, particularly calling the interface of the serial number rule module, so that the serial file or the compiled file containing the corresponding interface incidental information is also included besides the generation of the external interface.
The software code information fusion module is used for integrating the code rule loading and analyzing module, the scheme time sequence loading and analyzing module, the frame module rule loading and analyzing module, the serialization rule module, the data structure generating module, the state machine generating module, the internal interface generating module and the external interface generating module and classifying the calculation results. The software code information fusion module is responsible for integrating all the module information and classifying the calculation result, so that the output of the software code frame is facilitated.
And the software code framework output module is used for outputting serial files, such as a data structure file, a state event interface file, an external interface file, a serial number output or compiling file, a custom interface file and the like.
The invention also provides a method for automatically generating the software code frame, which comprises the following steps:
S01, loading and analyzing the designated code rule configuration file for identification. Wherein the code rule profile includes, but is not limited to, excel, xml, json format; the rules configured include, but are not limited to, misra C and Misra C++, and particularly include prefix rules for the model blocks, such as the specification of the block's generated file name, external interface, macro, internal interface, static variables, etc.
S02, loading and information extraction operation is carried out on an output object which is a scheme time sequence and is subjected to software architecture design and detailed scheme design. The language rules identified by the module include, but are not limited to, timing diagrams described by Unified Modeling Language (UML), and feature elements such as module objects, interaction relations, interface names and parameters in the timing diagrams are checked and extracted.
S03, loading a code frame template and caching code template information. The framework templates include, but are not limited to, software module level templates of the intelligence quotient of the software unit and task module templates of the MCU RTOS level, and especially further include starting from a process entry to hardware initialization, kernel object creation, exception signal processing registration, thread creation and internal logic of threads under Linux, so as to provide preset code framework fixing information, such as language environment information, OS and kernel object information, code flow information and the like, for the subsequent code framework generation.
S04, serializing and de-serializing the transmission information. To enhance the adaptability and standardization process of inter-module data transmission, presettable serialization rules include, but are not limited to Json, protobuf.
S05, combining the scheme time sequence information, the module information and the frame template information to generate a data structure necessary for codes. The data structures necessary for code such as enumeration, structure type, macro, etc. are flexibly generated.
S06, combining the scheme time sequence information, the module information and the frame template information to generate a module state machine. In particular, the state event matrix comprises the state of the software module, the external trigger event and the state event matrix formed by the two, and a developer can realize state machine switching control in the generated state event matrix interface.
S07, generating a serial interface inside the module. Including the interface of the state machine.
S08, generating a module external serial interface. And particularly, calling the interface of the serial number rule module so that the serial file or the compiled file containing the corresponding interface incidental information is generated besides the external interface.
And S09, integrating the processing result signals of the S01 to the S08 and classifying the calculation results. And integrating all the information and classifying the calculation results, so that the output of the software code frame is facilitated.
S10, outputting a series of files to finish the output of the software code frame so as to improve the quality and the generation efficiency of the software code frame. Series files such as data structure files, state event interface files, external interface files, serial number output or compilation files, custom interface files, and the like.
The invention can improve the automatic generation efficiency of the software code frame, reduce the investment of developers and improve the quality of the software code frame. Under various scenes requiring code design, the scheme can be intuitively and effectively automatically converted into a software code frame, the automatic generation level and quality of the software architecture are increased, and the method has positive significance for software engineering development.

Claims (7)

CN202210605416.0A2022-05-312022-05-31Automatic generation system and method for software code frameActiveCN114924727B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210605416.0ACN114924727B (en)2022-05-312022-05-31Automatic generation system and method for software code frame

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210605416.0ACN114924727B (en)2022-05-312022-05-31Automatic generation system and method for software code frame

Publications (2)

Publication NumberPublication Date
CN114924727A CN114924727A (en)2022-08-19
CN114924727Btrue CN114924727B (en)2024-06-04

Family

ID=82811736

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210605416.0AActiveCN114924727B (en)2022-05-312022-05-31Automatic generation system and method for software code frame

Country Status (1)

CountryLink
CN (1)CN114924727B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2007156761A (en)*2005-12-022007-06-21Toshiba Corp Design information generation apparatus, program development system, design information generation method, program development method, and program
CN105260193A (en)*2015-11-032016-01-20国云科技股份有限公司Self healing frame and healing method of large software
CN106569838A (en)*2016-11-182017-04-19天津理工大学QP frame-based automatic code generator
CN106970819A (en)*2017-03-282017-07-21清华大学A kind of c program code specification check device based on the regular description languages of PRDL
CN113535151A (en)*2020-04-142021-10-22北京京东振世信息技术有限公司Code generation method and device
CN114118690A (en)*2021-10-212022-03-01上海机电工程研究所Model-based weapon system architecture construction and index verification method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20050149304A1 (en)*2001-06-272005-07-07Fluidigm CorporationObject oriented microfluidic design method and system
US20070288885A1 (en)*2006-05-172007-12-13The Mathworks, Inc.Action languages for unified modeling language model

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2007156761A (en)*2005-12-022007-06-21Toshiba Corp Design information generation apparatus, program development system, design information generation method, program development method, and program
CN105260193A (en)*2015-11-032016-01-20国云科技股份有限公司Self healing frame and healing method of large software
CN106569838A (en)*2016-11-182017-04-19天津理工大学QP frame-based automatic code generator
CN106970819A (en)*2017-03-282017-07-21清华大学A kind of c program code specification check device based on the regular description languages of PRDL
CN113535151A (en)*2020-04-142021-10-22北京京东振世信息技术有限公司Code generation method and device
CN114118690A (en)*2021-10-212022-03-01上海机电工程研究所Model-based weapon system architecture construction and index verification method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A tool to support Bluespec SystemVerilog coding based on UML diagrams;Sergio H. M. Durand等;《ECON 2012 - 38th Annual Conference on IEEE Industrial Electronics Society》;20121220;第4670-4675页*
基于时序图的FSP代数模型自动生成方法研究;王雪娇等;《福建电脑》;20160125;第32卷(第02期);第95-96、106页*
基于量子平台状态机的桥式起重机控制系统软件设计;王小勇等;《电气自动化》;20150330;第37卷(第02期);第41-43页*

Also Published As

Publication numberPublication date
CN114924727A (en)2022-08-19

Similar Documents

PublicationPublication DateTitle
CN111399853B (en)Templated deployment method for machine learning model and custom operator
CN110673853B (en)Compiling method, device and system
CN105022630B (en)A kind of assembly management system and assembly management method
US7146605B2 (en)Automatic abstraction of software source
US20080244541A1 (en)Code translator and method of automatically translating modeling language code to hardware language code
CN112882718A (en)Compiling processing method, device, equipment and storage medium
CN108197027B (en)Software performance optimization method, storable medium, computer program
CN113296786B (en)Data processing method, device, electronic equipment and storage medium
CN111813814A (en)Universal model management method and device supporting multiple machine learning frameworks
CN110333867B (en)Multiparty secure computing data processing method, device and system
CN113204593A (en)ETL job development system and computer equipment based on big data calculation engine
CN112988145B (en)Method for generating aeroengine software architecture and aeroengine control device
US10839124B1 (en)Interactive compilation of software to a hardware language to satisfy formal verification constraints
CN114924727B (en)Automatic generation system and method for software code frame
Zhao et al.Bridging the Gap: A Python-to-Structured Text Compiler with IEC 61131-3 Compliance
CN115952044A (en)Automatic testing method and device
CN116088864A (en)Assembling method, disassembling method, apparatus and storage medium
CN115373988A (en)Test case generation method, test method, electronic device, and storage medium
CN112241268A (en)Keil engineering compiling method, system and equipment
WO2008075087A1 (en)Code translator and method of automatically translating modelling language code to hardware language code
CN112395190A (en)Non-invasive coverage rate statistical method for various processor architectures
US20240168757A1 (en)Software code consolidation
KR101731629B1 (en)Method and device for automatic generating go code from circus
WO2008015110A2 (en)Methods, apparatus and computer programs for modelling computer programs
CN118409735B (en) YAT automation framework integrated extension method, device, terminal and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information

Country or region after:China

Address after:401133 room 208, 2 house, 39 Yonghe Road, Yu Zui Town, Jiangbei District, Chongqing

Applicant after:Deep Blue Automotive Technology Co.,Ltd.

Address before:401133 room 208, 2 house, 39 Yonghe Road, Yu Zui Town, Jiangbei District, Chongqing

Applicant before:CHONGQING CHANGAN NEW ENERGY AUTOMOBILE TECHNOLOGY Co.,Ltd.

Country or region before:China

CB02Change of applicant information
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp