Disclosure of Invention
The embodiment of the application provides a data dictionary processing method, a data dictionary processing device, a data dictionary processing medium and electronic equipment, and the generation efficiency of a data dictionary of AUTOSAR standard can be improved.
In a first aspect, an embodiment of the present application provides a data dictionary processing method, including:
acquiring target dictionary entries included in a to-be-processed data dictionary based on the identification of the to-be-processed data dictionary; the to-be-processed data dictionary does not conform to AUTOSAR standard;
packaging the target dictionary entries based on DDS specifications, generating message structure bodies corresponding to the target dictionary entries, and storing the message structure bodies in a preset target communication carrier; the target communication carrier is used for assisting data transmission of the message structure body; the message structure body comprises data structure information of the target dictionary entry;
and responding to the received format conversion instruction, acquiring the data structure information in the message structure body from the target communication carrier, and performing code conversion on the acquired data structure information to obtain a target data dictionary which accords with AUTOSAR standard.
The data dictionary processing method provided by the embodiment of the application includes the steps of firstly obtaining target dictionary entries included by a to-be-processed data dictionary based on identifications of the to-be-processed data dictionary, then packaging the target dictionary entries based on DDS specifications, generating message structure bodies corresponding to the target dictionary entries, storing the message structure bodies into a preset target communication carrier, responding to a received format conversion instruction, obtaining data structure information in the message structure bodies from the target communication carrier, and performing code conversion on the obtained data structure information to obtain the target data dictionary meeting AUTOSAR standards. According to the method, the target dictionary entries of the data dictionary of the non-AUTOSAR standard are read, packaged and code-converted, so that the corresponding data dictionary which accords with the AUTOSAR standard is directly generated only through the data dictionary of the non-AUTOSAR standard, the data dictionary of the AUTOSAR standard can be generated more conveniently, the time consumption for generating the data dictionary of the AUTOSAR standard is saved, and the generation efficiency of the data dictionary of the AUTOSAR standard is improved.
In an optional embodiment, the obtaining, based on the identifier of the to-be-processed data dictionary, a target dictionary entry included in the to-be-processed data dictionary includes:
responding to a dictionary link instruction, searching a data dictionary library based on the identifier of the data dictionary to be processed in the dictionary link instruction, and acquiring the data dictionary to be processed;
responding to a dictionary entry setting instruction, and acquiring dictionary entry configuration information of the to-be-processed data dictionary from the dictionary entry setting instruction;
and reading target dictionary entries included in the data dictionary to be processed through an input interface according to the acquired dictionary entry configuration information.
In this embodiment, the data dictionary to be processed is acquired by searching the data dictionary library, then the dictionary entry configuration information of the data dictionary to be processed is acquired, and the target dictionary entries included in the data dictionary to be processed are read through the input interface according to the dictionary entry configuration information, so that an acquisition mechanism of the target dictionary entries is provided, the target dictionary entries can be efficiently acquired, and the generation efficiency of the data dictionary of the AUTOSAR standard is further improved.
In an optional embodiment, the encapsulating the target dictionary entry based on the DDS specification to generate a message structure corresponding to the target dictionary entry includes:
and based on DDS specifications, packaging the target dictionary entries read through the input interface through a message packaging interface corresponding to the input interface, and generating a message structure body corresponding to the target dictionary entries read through the input interface.
In this embodiment, the target dictionary entry read through the input interface is encapsulated through a message encapsulation interface corresponding to the input interface based on the DDS specification. The method provides a data transmission mechanism of the target dictionary entry by setting the message encapsulation interface corresponding to the input interface, so that the target dictionary entry can be efficiently encapsulated and transmitted, and the generation efficiency of the data dictionary of the AUTOSAR standard is further improved.
In an optional embodiment, before the encapsulating the target dictionary entry based on the DDS specification and generating the message structure corresponding to the target dictionary entry, the method further includes:
generating topic identification information corresponding to the target dictionary entry;
after the message structure corresponding to the target dictionary entry is generated, before the message structure is stored in a preset target communication carrier, the method further includes:
associating the generated message structure body with the subject identification information;
before the obtaining the data structure information in the message structure body from the target communication carrier, the method further includes:
and after receiving the format conversion instruction, determining that the message structure body in the target communication carrier has the associated theme identification information.
In this embodiment, topic identification information corresponding to the target dictionary entry is further generated, the generated message structure is associated with the topic identification information, and after the format conversion instruction is received, it is determined that the message structure in the target communication carrier has the associated topic identification information. According to the method, before the message structure is subjected to code conversion, the compliance judgment of the DDS specification is carried out on the basis of the theme identification information, so that the generated target data dictionary can be ensured to be in accordance with the AUTOSAR standard, and the generation efficiency of the data dictionary of the AUTOSAR standard is further improved.
In an alternative embodiment, the generating topic identification information corresponding to the target dictionary entry includes:
taking fields extracted from part or all of the target dictionary entries as basic field information;
and combining the basic field information with preset additional field information to obtain the topic identification information corresponding to the target dictionary entry.
In the embodiment, fields extracted from part or all of the target dictionary entries are used as basic field information; and combining the basic field information with preset additional field information to obtain the topic identification information corresponding to the target dictionary entry. The method can efficiently generate the topic identification information according to the target dictionary entry, and further improves the generation efficiency of the AUTOSAR standard data dictionary.
In a second aspect, an embodiment of the present application further provides a data dictionary processing apparatus, including:
the information input unit is used for acquiring target dictionary entries included by the data dictionary to be processed based on the identification of the data dictionary to be processed; the to-be-processed data dictionary does not conform to AUTOSAR standard;
the information packaging unit is used for packaging the target dictionary entries based on DDS specifications, generating message structure bodies corresponding to the target dictionary entries, and storing the message structure bodies in a preset target communication carrier; the target communication carrier is used for assisting data transmission of the message structure body; the message structure body comprises data structure information of the target dictionary entry;
and the code generation unit is used for responding to the received format conversion instruction, acquiring the data structure information in the message structure body from the target communication carrier, and performing code conversion on the acquired data structure information to obtain a target data dictionary which accords with AUTOSAR standard.
In an optional embodiment, the information input unit is specifically configured to:
responding to a dictionary link instruction, searching a data dictionary library based on the identifier of the data dictionary to be processed in the dictionary link instruction, and acquiring the data dictionary to be processed;
responding to a dictionary entry setting instruction, and acquiring dictionary entry configuration information of the to-be-processed data dictionary from the dictionary entry setting instruction;
and reading target dictionary entries included in the data dictionary to be processed through an input interface according to the acquired dictionary entry configuration information.
In an optional embodiment, the information encapsulating unit is specifically configured to:
and based on DDS specifications, packaging the target dictionary entries read through the input interface through a message packaging interface corresponding to the input interface, and generating a message structure body corresponding to the target dictionary entries read through the input interface.
In an optional embodiment, the information encapsulating unit is further configured to:
generating topic identification information corresponding to the target dictionary entry before the target dictionary entry is packaged based on the DDS specification and a message structure body corresponding to the target dictionary entry is generated;
after the message structure body corresponding to the target dictionary entry is generated and before the message structure body is stored in a preset target communication carrier, associating the generated message structure body with the topic identification information;
the code generation unit is further configured to:
and acquiring the data structure information in the message structure body from the target communication carrier, and determining that the message structure body in the target communication carrier has the associated theme identification information after receiving the format conversion instruction.
In an optional embodiment, the information encapsulating unit is specifically configured to:
taking fields extracted from part or all of the target dictionary entries as basic field information;
and combining the basic field information with preset additional field information to obtain the topic identification information corresponding to the target dictionary entry.
In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the data dictionary processing method in the first aspect is implemented.
In a fourth aspect, the present application further provides an electronic device, including a memory and a processor, where the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, the data dictionary processing method of the first aspect is implemented.
In a fifth aspect, the present application further provides a computer program product, which includes computer instructions that, when executed by a computing device, can perform the method according to any one of the first aspect.
For technical effects brought by any one implementation manner of the second aspect to the fifth aspect, reference may be made to technical effects brought by a corresponding implementation manner of the first aspect, and details are not described here.
Detailed Description
To make the objects, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all 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 application.
It should be noted that references in the specification of the present application to the terms "comprises" and "comprising," and variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Some of the words that appear in the text are explained below:
(1) AUTOSAR (automatic Open System Architecture, Open systems Architecture for automobiles): the automotive open system is a cooperative development framework of an automobile electronic system, which is commonly participated by automobile manufacturers, part suppliers and various research and service organizations all over the world, and establishes an open automobile controller (ECU) standard software architecture. Typically, each OEM (Original Equipment Manufacturer) will produce more than one vehicle model, each OEM will select more than one supplier for different subsystems and components, and each supplier will supply more than one OEM. The most effective way to reduce the development cost is to make the product reusable as much as possible, and to share the development cost by quantity. OEMs desire to have the same set of systems and components available on different vehicle models; systems and components from different suppliers on the same vehicle may be compatible with each other; and the components and algorithms that the supplier wishes to develop may be supplied to different OEMs with simple software adjustments. On the other hand, the development schedules of the various suppliers are often not synchronized. It is desirable to test whether the component is properly mated with other systems on the vehicle during the development process by the supplier. There is therefore a need for a unified, standardized system description method. This is the primary goal of automotive systems, namely to improve management of complex automotive electronics and electrical architectures by improving the reusability and interchangeability of software modules between OEMs and vendors. Thus, AUTOSAR is mainly to implement: standardizing interfaces between the application software and the bottom layer software and between the application software; giving a controller software reference architecture; exchange formats in the distributed development process are specified.
(2) ARXML (Architecture eXtensible Markup Language) file: the ARXML file is used as a general configuration file or a database file under the AUTOSAR framework, and plays a key role in data transmission and storage. XML (eXtensible Markup Language) is a Markup Language similar to HTML, which is designed to transmit data rather than display data, and has self-descriptive property, and its tags are not predefined and need to be self-defined. On the basis of an XML file, the AUTOSAR specification defines the file format of the transmission information as ARXML based on the application scene of automobile electronics.
(3) A data dictionary: the data dictionary is used for defining and describing data items, data structures and the like of data, and aims to make detailed description on each element in the data flow chart, and the data dictionary is used as a simple modeling item. In short, a data dictionary is a collection of information describing data, a collection of definitions for all data elements used in a system.
In the field of automatic driving, the mainstream way of the Automotive Open System Architecture (AUTOSAR) software development process is to automatically generate an ARXML file required by Architecture software through the existing Simulink control model. The automotive industry is mature and many tested models can be reused on different platforms without any manual modification of the model, such as automotive architecture.
In order to provide the automatic driving software meeting the AUTOSAR standard, the Simulink algorithm model needs to be iterated and deployed for multiple times, and the AUTOSAR configuration file corresponding to the algorithm model also needs to be updated correspondingly. After the software interface is fixed, the data dictionary of the model is mostly modified when the algorithm software is iterated each time.
In the development of AUTOSAR automatic driving software in the related technology, a data dictionary of AUTOSAR standard cannot be generated independently, an automatic driving algorithm model, a model data dictionary, an algorithm dependency library and the like need to be loaded into Matlab software, model conversion is carried out through an AUTOSAR standard tool, then automatic code generation is carried out, and a generated ARXML file contains all description information of the automatic driving software, so that the process is complex, the consumed time is long, and the efficiency is low when the data dictionary of the AUTOSAR standard is generated.
In order to solve the above problem, an embodiment of the present application provides a data dictionary processing method, which includes obtaining a target dictionary entry included in a to-be-processed data dictionary based on an identifier of the to-be-processed data dictionary that does not meet an AUTOSAR standard, then packaging the target dictionary entry based on a DDS specification, generating a message structure corresponding to the target dictionary entry, and storing the message structure in a preset target communication carrier, where the message structure includes data structure information of the target dictionary entry, and then obtaining data structure information in the message structure from the target communication carrier in response to receiving a format conversion instruction, and performing code conversion on the obtained data structure information to obtain a target data dictionary that meets the AUTOSAR standard. According to the method, the data dictionary which meets the AUTOSAR standard is generated only through the data dictionary which does not meet the AUTOSAR standard, and an automatic driving model and an algorithm dependency library do not need to be loaded, so that the data dictionary which meets the AUTOSAR standard can be generated more conveniently, the labor cost for generating the data dictionary which meets the AUTOSAR standard can be saved, and the generation efficiency of the data dictionary which meets the AUTOSAR standard can be improved.
The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Fig. 1 shows a flowchart of data dictionary processing provided in an embodiment of the present application. As shown in fig. 1, the method may include the steps of:
step S101, based on the identification of the data dictionary to be processed, obtaining the target dictionary entry included in the data dictionary to be processed.
Wherein, the data dictionary to be processed does not conform to AUTOSAR standard.
The file conforming to the AUTOSAR standard needs to be an ARXML file. In the embodiment of the application, the to-be-processed data dictionary is a data dictionary in a Sldd format created by MATLAB, and does not conform to the AUTOSAR standard.
The target dictionary entry may be a partial or complete dictionary entry in the pending data dictionary.
Illustratively, the identifier of the to-be-processed data dictionary Deal _1 is DOC _ ModelINOUT, and the file format is Sldd format. The pending data dictionary Deal _1 is shown in table 1.
TABLE 1
| Data item | Data type | … |
| Gaspedal | single | … |
| Mastercylind | single | … |
| DrvSBR | boolean | … |
| PassSBR | boolean | … |
As can be seen from table 1, it is assumed that the pending data dictionary Deal _1 includes 4 target dictionary entries, and the data items of the 4 target dictionary entries are Gaspedal, Mastercylind, drvbsbr and PassSBR, respectively. The file format of the data dictionary Deal _1 to be processed is in a Sldd format, and does not accord with AUTOSAR standard. And acquiring target dictionary entries of Gaspedal, Mastercylind, DrvSBR and PassSBR which are data items included in the to-be-processed data dictionary Deal _1 based on the identification DOC _ ModelINOUT of the to-be-processed data dictionary Deal _ 1.
In some embodiments of the present application, the identifier based on the to-be-processed data dictionary is implemented by an AUTOSAR standard template in Matlab software, and the target dictionary entry included in the to-be-processed data dictionary is obtained.
Fig. 2 is a schematic flowchart of a method for processing a data dictionary to obtain a target dictionary entry according to an embodiment of the present application. As shown in fig. 2, obtaining the target dictionary entry included in the to-be-processed data dictionary based on the identifier of the to-be-processed data dictionary may be implemented by the following steps:
step S201, responding to the dictionary link instruction, searching a data dictionary library based on the identifier of the data dictionary to be processed in the dictionary link instruction, and acquiring the data dictionary to be processed.
In the embodiment of the application, a database dictionary may be provided. After constructing the to-be-processed data dictionary Deal _1, the user stores the to-be-processed data dictionary Deal _1 into the data dictionary library. In order to obtain a data dictionary corresponding to the to-be-processed data dictionary Deal _1 and conforming to the AUTOSAR standard, a user inputs an identifier DOC _ ModelINOUT of the to-be-processed data dictionary Deal _1 and then triggers a dictionary linkage instruction Command1 through a click operation.
After the dictionary link instruction Command1 is received, searching the data dictionary base based on the identification DOC _ ModelINOUT in the dictionary link instruction Command1, finding the data dictionary identified as DOC _ ModelINOUT, reading information and storing the information into a cache, and thus obtaining the to-be-processed data dictionary Deal _ 1.
In step S202, in response to the dictionary entry setting instruction, dictionary entry configuration information of the to-be-processed data dictionary is acquired from the dictionary entry setting instruction.
Illustratively, the user may trigger the dictionary entry setting Command2 by a click operation after inputting the data items Gaspedal, Mastercylind, drvbsbr, PassSBR of the target dictionary entry.
The dictionary entry configuration information includes, but is not limited to, some or all of the following items: the method comprises the steps of input interface identification, dictionary entry reading sequence of each input interface, and data items of dictionary entries needing to be read by each input interface.
Upon receiving the dictionary entry setting instruction Command2, dictionary entry configuration information Instr2 of the to-be-processed data dictionary Deal _1 is acquired from the dictionary entry setting instruction Command 2. For example, the dictionary entry configuration information Instr2 may be a target dictionary entry indicating "sequentially reading data items Gaspedal, Mastercylind, drvbsbr, and PassSBR, respectively, through the input interface inport 1".
Step S203, according to the acquired dictionary entry configuration information, reading target dictionary entries included in the data dictionary to be processed through the input interface.
In some embodiments of the present application, the input interface is an input port (in port) module in Matlab software. It will be appreciated that the input interface may also be a self-developed designed information reading module. The specific form of the input interface is not limited in this application.
Illustratively, according to the information "the data items sequentially read as target dictionary entries of Gaspedal, Mastercylind, drvbsbr and PassSBR through the input interface inport 1" included in the acquired dictionary entry configuration information Instr2, the data items read as target dictionary entries of Gaspedal, Mastercylind, drvbrb and PassSBR through the input interface inport1 included in the to-be-processed data dictionary Deal _1 are target dictionary entries of Gaspedal, Mastercylind, drvbsbr and PassSBR, respectively.
And S102, packaging the target dictionary entries based on the DDS specification, generating a message structure body corresponding to the target dictionary entries, and storing the message structure body in a preset target communication carrier.
The target communication carrier is used for assisting data transmission of the message structure; the message structure body includes data structure information of the target dictionary entry.
In an embodiment of the present application, the target communication bearer is a virtual bus.
The virtual bus refers to a bus in which a plurality of signals are combined into one bus and then the bus as a whole is accessed, or a specific signal is selected from the bus. In this embodiment, the target communication carrier is a virtual bus, and the preset virtual bus is used to assist data transmission to the message structure.
In specific implementation, after the target dictionary entries are packaged based on the DDS specification to generate a message structure corresponding to the target dictionary entries, the generated message structure is stored in a preset virtual bus according to the DDS specification. When a user inputs a format conversion instruction, the data structure information in the message structure body can be acquired from the virtual bus in response to the received format conversion instruction, so that the data transmission of the message structure body is assisted through the virtual bus.
Illustratively, based on the DDS specification, the data structure information is read from the target dictionary entries of the data items Gaspedal, Mastercylind, drvbsbr, and PassSBR, and encapsulated in the message of the DDS specification, so as to obtain message structure bodies Info _1, Info _2, Info _3, and Info _4 corresponding to the target dictionary entries of the data items Gaspedal, Mastercylind, drvbrb, and PassSBR, respectively, and store the message structure bodies Info _1, Info _2, Info _3, and Info _4 in the preset target communication carrier DOM _ 1. The message structure bodies Info _1, Info _2, Info _3 and Info _4 respectively comprise data structure information of target dictionary entries of which the data items are Gaspedal, Mastercylind, DrvSBR and PassSBR, wherein each message structure body comprises the data structure information of one target dictionary entry.
In some embodiments of the present application, a target dictionary entry is encapsulated based on a DDS specification, and a message structure corresponding to the target dictionary entry is generated, specifically, the method includes: and based on the DDS specification, packaging the target dictionary entries read through the input interface through a message packaging interface corresponding to the input interface to generate a message structure body corresponding to the target dictionary entries read through the input interface.
In specific implementation, the input interface and the message encapsulation interface can be preset to correspond to each other. The target dictionary entry can be read and packaged through an input interface and a message packaging interface corresponding to the input interface; the target dictionary entry may also be read and packaged through a plurality of input interfaces and a plurality of message packaging interfaces respectively corresponding to the input interfaces one to one.
In some embodiments of the present application, the message encapsulation interface is an AUTOSAR event message module in Matlab software.
The following description is made of reading and packaging of a target dictionary entry through one input interface and one message packaging interface corresponding to the one input interface.
Illustratively, assume that the input interface import 1 is set in advance to correspond to the message encapsulation interface event 1. After the input interface inport1 reads the target dictionary entries, the read target dictionary entries are sent to the corresponding message encapsulation interface event 1. Based on the DDS specification, target dictionary entries of Gaspedal, Mastercylind, DrvSBR and PassSBR data items are sequentially read by a message encapsulation interface event1, and are respectively encapsulated in the DDS specification message to obtain message structure bodies Info _1, Info _2, Info _3 and Info _4 corresponding to the target dictionary entries of Gaspedal, Mastercylind, DrvSBR and PassSBR data items.
The manner of reading and packaging the target dictionary entry is performed through the plurality of input interfaces and the plurality of message packaging interfaces respectively corresponding to the input interfaces one to one, which is similar to the aforementioned process.
It is assumed that input interfaces inport1 to inport4 are set in advance so as to correspond one-to-one to message encapsulation interfaces event1 to event4, respectively. After the input interfaces inport 1-inport 4 read the target dictionary entries, the read target dictionary entries are sent to the corresponding message encapsulation interfaces event 1-event 4 respectively. Based on DDS specifications, data structure information is read for target dictionary entries of Gaspedal, Mastercylind, DrvSBR and PassSBR data items through message encapsulation interfaces event1, event2, event3 and event 4; the message encapsulation interfaces event1, event2, event3 and event4 respectively encapsulate the read data structure information into the DDS specification message to obtain message structures Info _1, Info _2, Info _3 and Info _4 corresponding to target dictionary entries of which data items are Gaspedal, Mastercylind, drvbr and PassSBR, respectively. That is, the message encapsulation interface event1 obtains, through encapsulation, message structure Info _1 corresponding to target dictionary entries whose data items are Gaspedal, respectively; the message packaging interface event2 obtains a message structure Info _2 corresponding to a target dictionary entry with a Mastercylind data item through packaging; the message encapsulation interface event3 obtains a message structure body Info _3 corresponding to a target dictionary entry with a data item being DrvSBR through encapsulation; the message encapsulation interface event4 obtains the message structure Info _4 corresponding to the target dictionary entry whose data item is PassSBR by encapsulation.
Based on the DSS specification, when placing a message structure onto a virtual bus, it is usually necessary to provide a corresponding reading module for reading the message structure from the virtual bus. In some embodiments of the present application, a reading module is not provided, and at this time, in order to perform program compilation normally, a mode of connecting a virtual bus to a terminal (Terminator) module in Matlab software is adopted, so as to prevent a compilation error.
Step S103, responding to the received format conversion instruction, acquiring data structure information in the message structure body from the target communication carrier, and performing code conversion on the acquired data structure information to obtain a target data dictionary which accords with AUTOSAR standard.
In specific implementation, the obtained data structure information is subjected to code conversion to obtain a target data dictionary meeting the AUTOSAR standard, specifically, the obtained data structure information is subjected to code conversion to generate an ARXML file corresponding to the data structure information, and the target data dictionary meeting the AUTOSAR standard is obtained.
Illustratively, in response to a received format conversion instruction input by a user, data structure information in the message structures Info _1, Info _2, Info _3 and Info _4 is acquired from the destination communication carrier DOM _1, and the acquired data structure information is transcoded to generate an ARXML file corresponding to the data structure information in the message structures Info _1, Info _2, Info _3 and Info _4, so as to obtain a destination data dictionary Deal _1_ data type, where the destination data dictionary Deal _1_ data type conforms to the AUTOSAR standard.
In some embodiments of the present application, the data structure information in the message structure is obtained from the target communication bearer through an AUTOSAR standard template in Matlab software, and the obtained data structure information is transcoded to obtain a target data dictionary meeting the AUTOSAR standard.
The data dictionary processing method provided by the embodiment of the application includes the steps of firstly obtaining target dictionary entries included by a to-be-processed data dictionary based on identifiers of the to-be-processed data dictionary which does not conform to the AUTOSAR standard, then packaging the target dictionary entries based on DDS (direct digital synthesis) standards, generating message structure bodies corresponding to the target dictionary entries, and storing the message structure bodies into a preset target communication carrier, wherein the message structure bodies include data structure information of the target dictionary entries, responding to a received format conversion instruction, obtaining data structure information in the message structure bodies from the target communication carrier, and performing code conversion on the obtained data structure information to obtain the target data dictionary which conforms to the TOSAR standard. According to the method, the data dictionary which meets the AUTOSAR standard is generated only through the data dictionary which does not meet the AUTOSAR standard, and an automatic driving model and an algorithm dependency library do not need to be loaded, so that the data dictionary which meets the AUTOSAR standard can be generated more conveniently, the time consumption for generating the data dictionary which meets the AUTOSAR standard is saved, and the generation efficiency of the data dictionary which meets the AUTOSAR standard is improved.
Although the embodiments of the present application provide the operational steps of the methods as shown in the above embodiments or figures, more or less operational steps may be included in the above methods based on conventional or non-inventive efforts. In steps where no necessary causal relationship exists logically, the order of execution of the steps is not limited to that provided by the embodiments of the present application. The above methods may be performed in the order of the embodiments or in parallel in the method shown in the drawings when the method is executed in an actual process or apparatus.
In some embodiments of the present application, the method further comprises the step of generating topic identification information. The theme identification information is used for associating the generated message structure body with the theme identification information after the message structure body is generated, and then storing the message structure body into a preset target communication carrier, so that the theme identification information associated with the message structure body in the target communication carrier is determined after the format conversion instruction is received. Before transcoding is carried out on the message structure, compliance judgment of DDS specification is carried out on the basis of the theme identification information, so that the generated target data dictionary can be ensured to meet the AUTOSAR standard, and the generation efficiency of the data dictionary of the AUTOSAR standard is further improved.
Fig. 3 is a schematic flow chart of another data dictionary processing method according to an embodiment of the present application. As shown in fig. 3, the following steps may be included:
step S301, based on the identifier of the data dictionary to be processed, obtaining the target dictionary entry included in the data dictionary to be processed.
The data dictionary to be processed does not accord with AUTOSAR standard;
in step S302, topic identification information corresponding to the target dictionary entry is generated.
In the embodiment of the application, the topic identification information corresponding to the target dictionary entry is generated, and the specific implementation process may be as follows: taking fields extracted from part or all of the target dictionary entries as basic field information; and combining the basic field information with preset additional field information to obtain the subject identification information corresponding to the target dictionary entry.
In specific implementation, the basic field information is combined with the preset additional field information, including but not limited to the following ways: and the preset additional field information is used as a suffix of the basic field information, and the preset additional field information is used as a prefix of the basic field information.
Extracting fields from some or all of the target dictionary entries, including but not limited to: extracting a data item of a first target dictionary entry, extracting a data item of a last target dictionary entry, and extracting the initial of the data item of each target dictionary entry.
Exemplarily, it is assumed that additional field information "_ TOPIC" is preset. The to-be-processed data dictionary Deal _1 comprises 4 target dictionary entries, and the data items of the 4 target dictionary entries are Gaspedal, Mastercylind, DrvSBR and PassSBR respectively. The initial letter of each data item extracted from the target dictionary entry is used as basic field information, for example, the extracted field may be "GMDP"; the basic field information "GMDP" is combined with the preset additional field information "_ TOPIC" by using the preset additional field information as a suffix of the basic field information, to obtain the subject identification information "GMDP _ TOPIC" corresponding to the target dictionary entry.
Step S303, packaging the target dictionary entries based on the DDS specification, and generating a message structure body corresponding to the target dictionary entries.
Wherein the message structure includes data structure information of the target dictionary entry.
And step S304, associating the generated message structure body with the subject identification information.
Illustratively, the message structures Info _1, Info _2, Info _3, Info _4 are associated with the TOPIC identification information "GMDP _ TOPIC", respectively.
Step S305, storing the message structure into a preset target communication carrier.
Wherein the target communication carrier is used for assisting data transmission of the message structure body.
Step S306, after receiving the format conversion instruction, determining that the message structure body in the target communication carrier has the associated theme identification information.
Illustratively, after a format conversion instruction is received, it is first determined that the message structures Info _1, Info _2, Info _3, and Info _4 in the target communication carrier have associated topic identification information. If the message structure bodies Info _1, Info _2, Info _3 and Info _4 in the target communication carrier are determined not to have the associated theme identification information, the transmission of the message structure bodies in the target communication carrier is judged not to conform to the DDS protocol, and in order to ensure that the generated target data dictionaries all conform to the AUTOSAR standard, a user is prompted that the DDS specification is not in compliance and the subsequent steps are stopped.
Specifically, the user is prompted that the DDS specification is not compliant, and a method of triggering an alarm bell, jumping out of prompt information, or the like may be adopted.
Step S307, in response to the received format conversion instruction, acquiring data structure information in the message structure from the target communication bearer, and performing code conversion on the acquired data structure information to obtain a target data dictionary meeting the AUTOSAR standard.
Illustratively, after receiving a format conversion instruction, if it is determined that the message structures Info _1, Info _2, Info _3, and Info _4 in the target communication bearer have associated topic identification information, the data structure information in the message structures Info _1, Info _2, Info _3, and Info _4 is obtained from the target communication bearer DOM _1 in response to the received format conversion instruction, and the obtained data structure information is transcoded to obtain a target data dictionary conforming to the AUTOSAR standard.
According to the method of the embodiment, before transcoding is performed on the message structure, compliance judgment of the DDS specification is performed based on the subject identification information, so that the generated target data dictionary can be ensured to meet the AUTOSAR standard, and the generation efficiency of the data dictionary of the AUTOSAR standard is further improved.
Based on the same inventive concept, the embodiment of the present application further provides a data dictionary processing apparatus, and as the apparatus is a corresponding apparatus to the data dictionary processing method in the embodiment of the present application, and the principle of the apparatus for solving the problem is similar to that of the method, the implementation of the apparatus may refer to the implementation process of the above method embodiment, and repeated details are not repeated.
Fig. 4 shows a schematic structural diagram of a data dictionary processing apparatus according to an embodiment of the present application. As shown in fig. 4, the data dictionary processing apparatus includes: aninformation input unit 401, aninformation packaging unit 402, and acode generation unit 403; wherein,
aninformation input unit 401, configured to obtain, based on the identifier of the to-be-processed data dictionary, a target dictionary entry included in the to-be-processed data dictionary; the data dictionary to be processed does not conform to AUTOSAR standard;
aninformation packaging unit 402, configured to package the target dictionary entry based on the DDS specification, generate a message structure corresponding to the target dictionary entry, and store the message structure in a preset target communication carrier; the target communication carrier is used for assisting data transmission of the message structure body; the message structure body comprises data structure information of the target dictionary entry;
thecode generating unit 403 is configured to, in response to the received format conversion instruction, obtain data structure information in the message structure from the target communication bearer, and perform code conversion on the obtained data structure information to obtain a target data dictionary meeting the AUTOSAR standard.
In an alternative embodiment, theinformation input unit 401 is specifically configured to:
responding to the dictionary link instruction, searching a data dictionary library based on the identifier of the to-be-processed data dictionary in the dictionary link instruction, and acquiring the to-be-processed data dictionary;
responding to the dictionary entry setting instruction, and acquiring dictionary entry configuration information of the to-be-processed data dictionary from the dictionary entry setting instruction;
and reading target dictionary entries included in the data dictionary to be processed through the input interface according to the acquired dictionary entry configuration information.
In an alternative embodiment, theinformation encapsulating unit 402 is specifically configured to:
and based on the DDS specification, packaging the target dictionary entries read through the input interface through a message packaging interface corresponding to the input interface to generate a message structure body corresponding to the target dictionary entries read through the input interface.
In an alternative embodiment, theinformation encapsulating unit 402 is further configured to:
packaging the target dictionary entries based on the DDS specification, and generating topic identification information corresponding to the target dictionary entries before generating the message structure corresponding to the target dictionary entries;
after generating a message structure body corresponding to the target dictionary entry, before storing the message structure body in a preset target communication carrier, associating the generated message structure body with the topic identification information;
thecode generation unit 403 is further configured to:
and acquiring data structure information in the message structure body from the target communication carrier, and determining that the message structure body in the target communication carrier has associated theme identification information after receiving a format conversion instruction.
In an alternative embodiment, theinformation encapsulating unit 402 is specifically configured to:
taking fields extracted from part or all of the target dictionary entries as basic field information;
and combining the basic field information with preset additional field information to obtain the topic identification information corresponding to the target dictionary entry.
The electronic equipment is based on the same inventive concept as the method embodiment, and the embodiment of the application also provides the electronic equipment. The electronic device may be for data dictionary processing. In one embodiment, the electronic device may be a server, a terminal device, or other electronic device. In this embodiment, the electronic device may be configured as shown in fig. 5, and include amemory 501, acommunication module 503, and one ormore processors 502.
Amemory 501 for storing computer programs executed by theprocessor 502. Thememory 501 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, a program required for running an instant messaging function, and the like; the storage data area can store various instant messaging information, operation instruction sets and the like.
Thememory 501 may be a volatile memory (volatile memory), such as a random-access memory (RAM); thememory 501 may also be a non-volatile memory (non-volatile memory) such as, but not limited to, a read-only memory (rom), a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD), or any other medium which can be used to carry or store desired program code in the form of instructions or data structures and which can be accessed by a computer. Thememory 501 may be a combination of the above memories.
Theprocessor 502 may include one or more Central Processing Units (CPUs), or be a digital processing unit, etc. Theprocessor 502 is configured to implement the data dictionary processing method when calling the computer program stored in thememory 501.
Thecommunication module 503 is used for communicating with the terminal device and other servers.
The embodiment of the present application does not limit the specific connection medium among thememory 501, thecommunication module 503 and theprocessor 502. In fig. 5, thememory 501 and theprocessor 502 are connected by a bus 504, the bus 504 is represented by a thick line in fig. 5, and the connection manner between other components is merely illustrative and not limited. The bus 504 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The embodiment of the application also provides a computer storage medium, wherein computer executable instructions are stored in the computer storage medium and used for realizing the data dictionary processing method in any embodiment of the application.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data dictionary processing method in the above-described embodiment. The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.