CN111310416A - Method and system for analyzing and converting standard data source files - Google Patents
Method and system for analyzing and converting standard data source files Download PDFInfo
- Publication number
- CN111310416A CN111310416A CN201811505595.0A CN201811505595A CN111310416A CN 111310416 A CN111310416 A CN 111310416A CN 201811505595 A CN201811505595 A CN 201811505595A CN 111310416 A CN111310416 A CN 111310416A
- Authority
- CN
- China
- Prior art keywords
- source file
- data source
- standard
- data item
- data
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 90
- 238000013507 mapping Methods 0.000 claims abstract description 27
- 238000004458 analytical method Methods 0.000 claims description 18
- 230000008859 change Effects 0.000 claims description 16
- 238000006243 chemical reaction Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 5
- 230000000875 corresponding effect Effects 0.000 description 35
- 230000005540 biological transmission Effects 0.000 description 16
- 230000008569 process Effects 0.000 description 12
- 230000006870 function Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 230000001960 triggered effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 238000010835 comparative analysis Methods 0.000 description 2
- 230000002596 correlated effect Effects 0.000 description 2
- 238000013479 data entry Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Methods and systems for analyzing or converting standard data source files are presented. The scheme of the invention searches key data items in the data item model and corresponding data item attributes thereof in a standard data source file and a non-standard data source file in a traversing way to generate attribute information by establishing a multi-level data item model, and compares the standard data source file or establishes mapping between the standard and non-standard data source files based on the attribute information.
Description
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and system for analyzing and transforming standard data source files.
Background
In the AUTomotive electronics industry, standard data source files of an AUTomotive Open system architecture (AUTomotive Open system architecture, abbreviated as AUTOSAR) are widely used for storing communication data information between Electronic Control units (Electronic Control units, abbreviated as ECUs) of vehicles.
However, the data source file of the AUTOSAR standard has a complex file structure, and a slight change of the content may cause a large change of the data source file, and it is difficult to locate the changed position and content. When a third-party configuration tool is used by a vehicle manufacturer or a part supplier to configure data source files of the AUTOSAR standard, the configuration efficiency is low and errors are easy to occur due to the complex operation and the excessive configuration item content. Additionally, the entire vehicle manufacturer or parts supplier may provide non-standard data source files that do not comply with the AUTOSAR standard.
Thus, there is a need to analyze different standard data source files and to convert between standard data source files and non-standard data source files.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
The method, the system and the storage medium for analyzing or converting the standard data source file provided by the embodiment of the invention aim to solve the problems mentioned above, when the standard data source file (in particular the AUTOSAR standard data source file) is subjected to comparative analysis, the difference between different versions of the standard data source file can be rapidly compared, the interconversion between the standard data source file and the non-standard data source file is supported, and the efficiency and the accuracy of vehicle function configuration based on the standard data source file are improved.
According to an aspect of the present invention, there is provided a method for analyzing a standard data source file, including: establishing a multi-level data item model comprising key data items belonging to different levels, the key data items being stored in first and second standard data source files; acquiring first attribute information and second attribute information corresponding to the key data items in the first standard data source file and the second standard data source file respectively based on the key data items; and comparing the first attribute information with the second attribute information to obtain a variation between the first standard data source file and the second standard data source file.
According to another aspect of the present invention, there is provided a method for converting a standard data source file and a non-standard data source file, comprising: establishing a multi-level data item model comprising key data items belonging to different levels, the key data items being stored in the standard data source files and the non-standard data source files; acquiring attribute information corresponding to the key data item in the non-standard data source file based on the key data item; generating a mapping relationship between the multi-level data item model and the non-standard data source file based on the attribute information; and converting the non-standard data source file into a standard data source file or converting the standard data source file into a non-standard data source file based on the mapping relation.
According to yet another aspect of the present invention, there is provided a system for analyzing a standard data source file, comprising: a modeling unit arranged to build a multi-level data item model comprising key data items belonging to different levels, the key data items being stored in first and second standard data source files; an acquisition unit configured to acquire first attribute information and second attribute information corresponding to the key data items in the first standard data source file and the second standard data source file, respectively, based on the key data items; and a comparison unit configured to compare the first attribute information with the second attribute information to acquire a variation between the first standard data source file and the second standard data source file.
According to yet another aspect of the present invention, there is provided a system for converting standard and non-standard data source files, comprising: a modeling unit arranged to build a multi-level data item model comprising key data items belonging to different levels, the key data items being stored in the standard data source file and the non-standard data source file; an acquisition unit configured to acquire attribute information corresponding to the key data item in the non-standard data source file based on the key data item; a mapping unit arranged to generate a mapping relationship between the multi-level data item model and the non-standard data source file based on the attribute information; and a conversion unit configured to convert the non-standard data source file into a standard data source file or convert the standard data source file into a non-standard data source file based on the mapping relationship.
According to yet another aspect of the present invention, a computer-readable storage medium is also proposed, on which a computer program is stored, the computer program comprising executable instructions which, when executed by a processor, implement the method as described above.
According to still another aspect of the present invention, there is also provided an electronic apparatus, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is arranged to execute the executable instructions to implement the method as described above.
By using the method, the system and the storage medium provided by the embodiment of the invention, a user can accurately distinguish data change positions and contents by quickly and accurately comparing differences among standard data source files of different versions, so that important information is prevented from being lost; when the nonstandard data source file and the standard data source file need to be mutually converted, the efficiency and the accuracy of the process of configuring and generating the standard data source file by adopting the relatively simple nonstandard data source file are improved, the configuration is easier, the cost is reduced, and the accuracy of the standard data source file is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The above and other features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
FIG. 1 illustrates the structure of key data items of an AUTOSAR standard data source file according to an embodiment of the present invention;
FIG. 2 illustrates a flow diagram of a method for analyzing AUTOSAR standard data source files, according to an embodiment of the invention;
FIG. 3 illustrates an exemplary structure of attribute information generated from an AUTOSAR standard data source file, according to an embodiment of the present invention;
FIG. 4 shows exemplary results of a change between standard data source files according to an embodiment of the invention;
FIG. 5 illustrates a flow diagram of a method for converting AUTOSAR standard data-source files and non-AUTOSAR standard data-source files, in accordance with an embodiment of the present invention;
FIG. 6 depicts another exemplary structure of attribute information generated from an AUTOSAR standard data source file, according to an embodiment of the present invention;
FIG. 7 illustrates a block diagram of a system for analyzing AUTOSAR standard data source files, according to an embodiment of the invention; and
fig. 8 shows a block diagram of a system for converting AUTOSAR standard and non-AUTOSAR standard data-source files, according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. The exemplary embodiments, however, may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. In the drawings, the size of some of the elements may be exaggerated or distorted for clarity. The same reference numerals in the drawings denote the same or similar structures, and thus a detailed description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, etc. In other instances, well-known structures, methods, or operations are not shown or described in detail to avoid obscuring aspects of the invention.
Hereinafter, the method and system of the present invention will be described by taking the AUTOSAR standard data source file in the automotive electronics field as an example, but those skilled in the art will understand that the method and system of the present invention will not be limited to the application in the analysis and conversion of the AUTOSAR standard data source file.
AUTOSAR is built jointly by automobile manufacturers, component suppliers, and electronics, semiconductor, software systems companies, and is dedicated to an open, standardized software architecture developed for automobiles. AUTOSAR, as a standardized base software running in the ECU, covers various levels of functions of the vehicle management system, including execution, management, system customization, etc., and may improve system reliability and stability. The AUTOSAR is a hardware-independent software architecture that can specify software architecture stacking procedures and integrate with the ECU, as well as specify various vehicle api specifications for reuse across different vehicle platforms. The whole automobile manufacturer or the part supplier modifies and upgrades the functions of the vehicle ECU by configuring and updating the AUTOSAR standard data source file, thereby improving and improving the functions, reliability and stability of the vehicle system.
The structure of the AUTOSAR standard data source file is first introduced.
The AUTOSAR standard data source file is written in the format of Extensible Markup Language (XML), and commonly, arxml is an extension name. The AUTOSAR standard data source file has a file format similar to an XML language file format, and is composed of a plurality of data items (attributes) with different hierarchies and attributes (Property) corresponding to the data items, wherein the attributes are configuration information of the corresponding data items, and are generally parameter values such as numerical values or option values such as character strings. And the ECU completes the functions of configuring and controlling various parts of the vehicle through the attribute information. Because other similar XML-format data source files generally do not exist in the field of automotive electronics, the meanings of data items and corresponding attribute information in the AUTOSAR standard data source file and the common XML-format data source file are different, and a data analysis and conversion method of the XML-format data source file generally cannot be used.
According to an embodiment of the present invention, the data items in the AUTOSAR standard data source file may be set as critical data items and non-critical data items, respectively. The key data items indicate data items having an influence on the function of the vehicle in the standard data source file, and the non-key data items are data items having a smaller influence on the function of the vehicle or data items containing explanatory and descriptive information on the key data items. During parsing of standard data source files, a user may not process non-critical data items to simplify the parsing process.
The key data items are configured and selected by analysis rules set by the vehicle manufacturer, parts supplier, or developer of automotive standard data source files. Key data items may also be modified and adjusted during configuration of the AUTOSAR standard data source file. It should be understood that the analysis rules of different vehicle manufacturers, component suppliers, or developers of AUTOSAR standard data source files are not necessarily the same, and thus the same data item in the AUTOSAR standard data source file may vary between critical and non-critical data items under different analysis rules.
The structure of key data items of an AUTOSAR standard data source file according to an embodiment of the present invention is shown in fig. 1. The AUTOSAR standard data source file 100 macroscopically mainly includes the following key data items: a message/Data Frame (Frame) Data item 101, a Protocol Data Unit (PDU) Data item 102, and a signal Data item 103. The AUTOSAR standard data source file may also include other key data items, such as a Transmission Mode (Transmission Mode) data item, and the like. According to other embodiments, it is also possible to select different combinations of the above-mentioned key data items, and to select these key data items differently than the one exemplified. The selection of key data items depends on the analysis rules of the vehicle manufacturer, the parts supplier, or the developer of the AUTOSAR standard data source file.
Each AUTOSAR standard data source file 100 includes at least one Frame data item 101. The Frame of the message/data serves as a basic information unit for data interaction between the ECUs and the vehicle components defined by the AUTOSAR standard data source file 100, and the Frame data item 101 has the highest level in the standard data source file 100.
The Frame data item 101 includes a PDU data item 102, i.e., there is a one-to-one (1-1) correspondence between the two. Under different communication protocol message/data Frame, the PDU has different meanings. For example, the PDU under the CAN bus is a format of a protocol data unit PDU adopted by a message/data Frame format used in the CAN bus. PDU data item 102 is the key data item for the next level of the Frame data item 101.
The PDU data item 102 comprises at least one signal data item 103, i.e. a one-to-many (1-N, where N is a natural number) relationship between the two. The signal data item 103 indicates the signal employed in the PDU data item 102 and its configuration parameters. The signal data item 103 is a key data item of the next hierarchy of the PDU data item 102. The signal data item 103 may comprise at least one signal group 1031 and/or signal 1032.
The signal group 1031 is composed of at least one strongly correlated signal, indicating that the signals together perform the same or related function during the configuration process. The less correlated signals are then arranged separately in the form of signal 1032. Depending on the correlation between the signals, the signal data item 103 may include both the signal group 1031 and the signal 1032, may include only the signal group 1031, or may include only the signal 1032. When there is a signal group 1031, the signals in the signal group 1031 may be considered as key data items of the next hierarchy of signal data items 103.
The transmission mode data items include Event (Event) data items and Period (Period) data items. The signal of the periodic type transmission mode is transmitted in a period (for example, the period is 100ms, the allowed offset value (offset) of the period is 10ms), and the transmission property (Transfer property) thereof is generally waiting (Pending), and the like. The signal of the event type transmission mode is obtained by setting a trigger source of an event (for example, cyclic detection is performed in a period of 10ms, and further, the number of cycles is 5) and triggering transmission when a trigger condition of the trigger source is satisfied, and a transmission attribute thereof is generally Triggered (Triggered) or not Triggered, and the like.
FIG. 2 shows a flow diagram of a method for analyzing AUTOSAR standard data source files, the method comprising the steps of:
s100: establishing a multi-level data item model;
s200: acquiring first attribute information and second attribute information corresponding to the key data items in a first standard data source file and a second standard data source file respectively based on the key data items;
s300: comparing the first and second attribute information to obtain a variation between the first and second standard data source files; and
s400: and (6) ending.
Before analyzing the AUTOSAR standard data source file, a previous version of the AUTOSAR standard data source file (hereinafter referred to as a first standard data source file) and a current version of the AUTOSAR standard data source file (hereinafter referred to as a second standard data source file) have been acquired. The analysis method is used for accurately comparing and analyzing the difference between the AUTOSAR standard data source files of different versions, and is convenient for a user to check the version change and check whether the information of the data source files is correct.
In step S100, a multi-level data item model of the structure of key data items of the AUTOSAR standard data source file such as that shown in fig. 1 according to the embodiment of the present invention is built based on the analysis rule. Key data items belonging to different hierarchical levels are selected in the first and second standard data source files. As with the structure of the key data items shown in fig. 1, the model generated in step S100 includes four levels. The Frame data item 101 is at a first level, the PDU data item 102 is at a second level, the signal data item 103 (including the signal group 1031 and the signal 1032) is at a third level, and the signal group 1031 includes a signal at a fourth level. The first-level Frame data item 101 includes, as key data items of the uppermost level, data item attributes and key data item PDU data item 102 of the next level, but there is no key data item of the previous level. The signal of the fourth hierarchy, which is the lowest hierarchy, includes data item attributes without a key data item of the next hierarchy, but has a set of key data item signals 1031 of the previous hierarchy. And for the key data items of other hierarchies, the data item attribute and the key data item of the next hierarchy are included, and the key data item of the previous hierarchy is also provided.
In step S200, first attribute information and second attribute information corresponding to key data items are acquired in a first standard data source file and a second standard data source file, respectively, based on the key data items. According to one embodiment, step S200 comprises the following sub-steps:
in sub-step S210, data items matching the key data items are searched in the first and second standard data source files, respectively. The analysis method firstly searches the matched data item according to the name of the key data item of the highest level, namely the name 'Frame' of the Frame data item. According to another embodiment, the Frame data item corresponding to the Frame data item may be searched in the standard data source file according to the data item ID corresponding to the Frame data item. If no data item matching the Frame data item is found (no in substep S220), it is determined that the key data item in the model does not exist in the standard data source file, at this time, an error occurs in the process, and the method directly jumps to step S400 to end the analysis process and perform corresponding error processing.
If the determination of substep S220 is YES, it indicates that a Frame data item exists in the standard data source file. The method continues with step S230, for each Frame data item, extracting information (e.g. in the form of a list) of all Frame data items from the first and second standard data source files, respectively, obtaining a data item attribute contained in the data item matching the current Frame data item and storing the data item attribute in the first and second attribute information. For example, for the Frame Data item, in the sub-step S230, according to the name "Frame" of the Frame Data item, the Data item attributes of the Frame Data item, such as the Data item ID, the Addressing mode Addressing, the Data item Length (Data Length defined by the Frame message, abbreviated as DL) Length, and the like, are searched. Then, values of these data item attributes, such as the value "0 x 100" of the data item ID, the value "Yes" of the fast CAN (automobile high-speed CAN bus communication protocol, CAN _ FD for short, corresponding to the ordinary speed CAN bus communication protocol), and the like, are acquired, and these data item attributes are recorded in the first and second attribute information. The first and second attribute information correspond to data item attribute information stored in the first and second standard data source files, respectively, relating to the key data item.
Then, the method performs substep S240 of determining whether or not the data item attributes included in the data items matching all the key data items have been acquired and storing the data item attributes in the first and second attribute information. If the determination is yes, then the corresponding data item attributes for all key data items have been searched and completed in a traversal, and the method jumps to step S300, by comparing the first and second attribute information to obtain a change between the first and second standard data source files. If the determination is "no," which indicates that there are other critical data items that have not been found, the method continues with substep S250.
The sub-step S250 continues to determine whether the current key data item includes a key data item of a next hierarchy belonging to the hierarchy to which the current key data item belongs. If the judgment result is yes, all key data items of the next level of the level to which the current key data item belongs need to be searched continuously. For example, the Frame data item is found to include the PDU data item of the second hierarchy, and the search and extraction of the information or the information list of all the PDU data items included in the current Frame data item are continued. At this point, the method performs sub-step S260, taking the next level key data item as the current key data item and returning to sub-step S210, and searching for the data item matching the current key data item, i.e. each PDU data item, in the first and second standard data source files, respectively. For example, PDU data items that match all PDU data items contained in the Frame data item are searched in a standard data source file based on the name "PDU" of the PDU data item and information or an information list of the matching PDU data items is acquired, data item attributes such as Minimum delay time (Minimum delay time), byte order (Byteorder, which is generally classified into two types, motorola and intel in the field of automotive electronics) and the like contained in the matching PDU data items are acquired, and values of the data item attributes such as the value of the Minimum delay time "0.1 s" are stored in the first and second attribute information.
The above process of searching for the key data item of the next hierarchy may be repeatedly performed, and when searching for the signal data item of the next hierarchy of the PDU data item, the information or information list of all the signal data items included in the current PDU data item is searched and extracted, and for each signal data item, the substep S230 is performed. For Signal data items in Signal Group form, the information or information list of all Signal items of the next hierarchy contained in the Signal data items is searched again, and substep S230 is performed on each Signal item.
If the result of the sub-step S250 is "no", it indicates that the current key data item is the key data item of the lowest hierarchy, and the method continues to perform the sub-step S270, and determines whether the current key data item has a key data item belonging to an upper hierarchy. If the result of substep S270 is yes, indicating that the current key data item is not the key data item of the highest hierarchical level, the method continues to substep S280 of treating the key data item of a hierarchical level immediately above the hierarchical level to which the current key data item belongs as the new current key data item. For example, the key data item Signal _1 does not include any key data item of the next hierarchy, and only the data item attributes of Signal _1 item such as byte order, Transfer Property (Transfer Property), and the like can be acquired at this time, and the values of these data item attributes such as the value of byte order "Motorola" and the value of Transfer Property "triggered" are recorded in the first and second attribute information. As for the Signal _3 of the Signal data items included in the PDU data item, which belongs to the key data item of the lowest hierarchy level, only its data item attribute can be acquired, and the value of its data item attribute (such as the value "Pending" of the transmission attribute) is recorded in the first and second attribute information.
If the result of substep S270 is "no", indicating that the current key data item is already the key data item of the highest hierarchical level, the method returns to substep S240 to determine whether the data item attributes included in the data items matching all the key data items have been acquired and to store the data item attributes in the first and second attribute information. For example, the PDU data item includes a Signal Group Signal _1 and a Signal _3, and the Signal Group Signal _1 includes two signals Signal _1 and Signal _2, then after the query of the PDU data item, the method may sequentially query the key data item Signal _1 and the Signal _3 at the same level, and then query the next level Signal _1 and Signal _2 of the Signal Group _1, thereby completing the query of all the lower level key data items under the PDU data item and the acquisition of the corresponding data item attributes. The method may then return to the level at which the PDU data item resides, and continue to look for other PDU data items at the same level as the PDU data item and their lower level critical data items. Finally, the method returns to the highest level Frame data item and inquires other Frame data items in the same level with the Frame data item and key data items in the lower level.
After substep S280, the method continues to substep S290 to determine whether data item attributes contained in the data item matching the current key data item have been obtained and to store the data item attributes in the first and second attribute information. If the determination is yes, indicating that the current key data item has already been searched, the method returns to substep S240. If the determination result is "no", which indicates that the current key data item also includes other key data items belonging to the same hierarchy that have not been found, the method returns to sub-step S210 to continue to find data items matching the key data item in the first and second standard data source files, respectively.
When the determination result of the sub-step S240 is yes, it indicates that all the key data items in the generated multi-level data item model are searched and the data item attributes corresponding thereto are stored in the first and second attribute information, and the step S200 is completed. According to an embodiment of the present invention, the traversal search result of step S200, i.e., the first and second attribute information, may be output in an exemplary structure as shown in fig. 3 or stored in a document.
It should be noted that the traversal lookup of the key data items described above is exemplary, and that other ways of finding key data items may be used.
For example, according to an embodiment of the present invention, for a key data item in the multi-level data item model corresponding to the exemplary structure of the attribute information shown in fig. 3, information or an information list of all Frame data items may be searched and extracted from the standard data source file, and for each Frame data item, a data item attribute included in a data item matching the current Frame data item may be obtained in the first and second standard data source files respectively, and the data item attribute may be stored in the first and second attribute information. When searching for the PDU data item of the next hierarchy of the Frame data item, the information or the information list of all PDU data items is searched and extracted for all Frame data items, and the acquiring and storing function of the data item attribute shown in sub step S230 is repeatedly performed for each PDU data item. This way, all key data items at the same level are looked up simultaneously, rather than just looking up the key data items at the next level that belong to the same key data item at the previous level. Similarly, when searching for a signal data item of the next hierarchy of PDU data items, information or information list of all signal data items is searched and extracted, and for each signal data item, the substep S230 is performed. For Signal data items in Signal Group form, the information or information list of all Signal items of the next hierarchy level is searched again and substep S230 is performed on each Signal item. The above process is carried out until all the key data items reaching the lowest hierarchy level are searched and the corresponding data item attributes are stored in the attribute information. For example, in the exemplary structure shown in fig. 3, all Frame data entries are searched first, and then all PDU data entries of the next layer are searched. According to one embodiment, the PDU data item further includes a Transmission Mode data item Transmission Mode, and then after the PDU data item, the Transmission Mode data item, the Signal data item Signal Group _1 and Signal _3 of the next level are searched, and their data item attributes are extracted and stored in the attribute information, respectively, instead of first searching the Transmission Mode data item and the event data item and the period data item of the next level included therein and then returning to the Signal data item to search Signal Group _1 and Signal _ 3.
According to another embodiment, a mode of sequentially searching the key data items of the next level from the highest level to the key data items of the lowest level and then recursively returning to the searching of the key data items of the previous level can be adopted. For example, in the example structure shown in fig. 3, the Frame data item is searched for the event data item via the PDU data item and the transmission mode data item in sequence, and then returned to the transmission mode data item for the period data item. And then returning to the Signal Group _1 item to search the Signal _1 item, and so on.
Those skilled in the art will appreciate that step S200 of the key data item analysis method of the present invention may also be performed using other traversal lookup approaches.
After step S200, the method continues to step S300, comparing the first and second attribute information to obtain a change between the first and second standard data source files, facilitating a user to view a change point between the two versions of the standard data source file. The comparison result may be presented, for example, in a table form as shown in fig. 4, in which one of the data item attributes of the PDU data item is highlighted, that is, the minimum delay time (minimum delay time) is changed from 0.1s to 0.2 s. It should be understood that the change between standard data source files can also be output by other means than comparison results of data change and changes thereof, such as curves, statistics, graphs and the like according to actual conditions and requirements.
In a comparative analysis between two standard data source files, if a key data item exists in one source file but does not exist in the other source file, it can also indicate that the key data item is deleted or added in a new version of the standard data source file.
Further, the user may be prompted according to the function (e.g., through definition or description information) corresponding to the changed key data item to influence the change may have, so that the user may adopt a coping scheme.
A method for converting AUTOSAR standard and non-AUTOSAR standard data source files according to an embodiment of the present invention will be described in detail below with reference to fig. 5. The steps of the conversion method described in fig. 5, which are similar to the analysis method in fig. 2, will not be described again. In the example, the non-AUTOSAR standard data source file is an EXCEL format data source file, but the non-standard data source file of the present invention is not limited to the EXCEL format, and other formats capable of reading and querying data may be used as the non-standard data source file, including but not limited to WORD format, generic XML format, text format, etc.
The conversion method according to an embodiment of the present invention includes the steps of:
s500: establishing a multi-level data item model;
s600: acquiring attribute information corresponding to the key data items in the non-standard data source file based on the key data items;
s700: generating a mapping relation between a multi-level data item model and a non-standard data source file based on the attribute information; and
s800: converting the non-standard data source file into a standard data source file or converting the standard data source file into the non-standard data source file based on the mapping relation;
s900: and (6) ending.
In step S500, a multi-level data item model of the structure of key data items of a standard data source file such as that shown in FIG. 3 is built based on analysis rules. The multi-level data item model in fig. 3 can also be represented by the structure shown in fig. 6, where the FRAME data item is the first level, the PDU data item is the second level, the Transmission Mode data item and the Signal data item (including Signal Group and Signal alone) are the third level, and the Event data item, the Period data item and the Signal included in the Signal Group are the fourth level. Key data items belonging to different hierarchical levels are selected in standard data source files. The model generated in step S500 includes four levels of Frame data item 101, PDU data item 102, signal data item 103 (including signal group 1031 and signal 1032) and a signal included in signal group 1031. The properties of each hierarchical data item are as described above.
In step S600, attribute information corresponding to the key data item is acquired in the non-standard data source file based on the key data item. According to one embodiment, step S600 includes several sub-steps as follows:
in sub-step S610, data items that match the key data items are found in the non-standard data source file. Similar to the analysis method, the conversion method first finds a matching data item according to the name of the key data item at the highest hierarchical level, i.e., the name "Frame" of the Frame data item or the corresponding data item ID. If no data item matching the Frame data item is found (no in substep S620), it is determined that the key data item in the model does not exist in the non-standard data source file, and at this time, the method is in error, and directly jumps to step S900 to end the conversion process and perform corresponding error processing.
If the determination of substep S620 is YES, it indicates that a Frame data item exists in the non-standard data source file. The method continues with step S630, for each Frame data item, extracting information (e.g., in the form of a list) of all the Frame data items from the non-standard data source file, obtaining the data item attributes included in the data item matching the current Frame data item, and storing the data item attributes in the attribute information.
The method then performs substep S640 of determining whether the data item attributes included in the data items matching all the key data items have been obtained and storing the data item attributes in the attribute information. If the determination result is "yes," then the corresponding data item attributes for all key data items have been searched and completed in a traversal, and the process jumps to step S700, where a mapping between the multi-level data item model and a non-standard data source file is generated based on the attribute information, which mapping will be described below. If the determination is "no," which indicates that there are other critical data items that have not been found, the method continues with substep S650.
The sub-step S650 continues to determine whether the current key data item includes a key data item of a next hierarchy belonging to the hierarchy to which the current key data item belongs. If the judgment result is yes, all key data items of the next level of the level to which the current key data item belongs need to be searched continuously. For example, the Frame data item is found to include the PDU data item of the second hierarchy, and the search and extraction of the information or the information list of all the PDU data items included in the current Frame data item are continued. At this time, the method performs sub-step S660, taking the next level key data item as the current key data item and returning to sub-step S610, and searching the non-standard data source file for the data item matching the current key data item, i.e. each PDU data item.
The above process of searching for the key data item of the next hierarchy may be repeatedly performed, and when searching for the signal data item of the next hierarchy of the PDU data item, the information or information list of all the signal data items included in the current PDU data item is searched and extracted, and for each signal data item, the substep S630 is performed. For Signal data items in Signal Group form, the information or information list of all Signal items of the next hierarchy contained in the Signal data items is searched again, and substep S630 is performed on each Signal item.
If the result of the sub-step S650 is "no", it indicates that the current key data item is the key data item of the lowest hierarchy, and the method continues to perform the sub-step S670 of determining whether the current key data item has a key data item of an upper hierarchy. If the result of substep S670 is yes, indicating that the current key data item is not the key data item of the highest hierarchical level, the method continues to substep S680, taking the key data item of a hierarchical level immediately above the hierarchical level to which the current key data item belongs as the new current key data item.
If the result of sub-step S670 is "no", indicating that the current key data item is already the key data item of the highest hierarchical level, the method returns to sub-step S640 to determine whether the data item attributes included in the data items matching all the key data items have been acquired and to store the data item attributes in the attribute information. Finally, the method returns to the highest level Frame data item and inquires other Frame data items in the same level with the Frame data item and key data items in the lower level.
After substep S680, the method continues to substep S690 to determine whether data item attributes contained in the data item matching the current key data item have been obtained and stored in the attribute information. If the determination is yes, indicating that the current key data item has already been located, the method returns to substep S640. If the determination result is "no", which indicates that the current key data item also includes other key data items belonging to the same hierarchy that have not been found, the method returns to sub-step S610 to continue to find a data item matching the key data item in the non-standard data source file.
When the determination result of the sub-step S640 is yes, it indicates that all the key data items in the generated multi-level data item model are searched and the data item attributes corresponding thereto are stored in the attribute information, and step S600 is completed. According to an embodiment of the present invention, the traversal search result of step S600, i.e., the attribute information, may be output in the exemplary structure as shown in fig. 3, or stored in a document such as WORD format.
A similar traversal lookup of key data items as in the analysis method may be employed in the conversion method.
After step S600, the method continues to step S700, where a mapping between the multi-level data item model and the non-standard data source file is generated based on the attribute information. The mapping relationship may be a list of data pairs between key data items in the model and EXCEL format data source files, or a vector table or matrix from the model to non-standard data source files. And generating mapping between the nonstandard data source file and the standard data source file by corresponding data items in the EXCEL-format nonstandard data source file to the data structures of the key data items and the data item attributes of the data item model corresponding to the AUTOSAR standard. The mapping relationship may be stored in a hash map (Hashmap) that is also used to characterize the mapping relationship, for example, or may be stored or recorded in other forms.
When all the key data items are mapped, the non-standard data source file may be converted into the AUTOSAR standard data source file in step S800, for example, by storing the mapping relationship into the model. In other embodiments of the present invention, the AUTOSAR standard data source file may be converted into the non-standard data source file based on the mapping relationship, or the conversion between the non-standard data source file and the standard data source file may be accomplished based on the mapping relationship in other manners.
There is also provided, in accordance with an embodiment of the present invention, a system 700 for analyzing AUTOSAR standard data source files, as shown in fig. 7. The system 700 includes a modeling unit 710, an acquisition unit 720, and a comparison unit 730.
The modeling unit 710 is configured to perform step S100 of the analysis method shown in fig. 3, and build a multi-hierarchy data item model, where the multi-hierarchy data item model includes key data items belonging to different hierarchies, and the key data items are stored in the first standard data source file and the second standard data source file.
The obtaining unit 720 is configured to perform, as in step S200 in fig. 3, obtaining first attribute information and second attribute information corresponding to key data items in the first standard data source file and the second standard data source file, respectively, based on the key data items.
Further, the retrieving unit 720 further comprises sub-units for performing sub-steps S210 to S290 of step S200 in fig. 3, respectively, to find and retrieve data item attributes corresponding to the key data items in the first standard data source file and the second standard data source file, respectively. Each subunit is configured to search, in the first standard data source file and the second standard data source file, for a data item that matches the key data item, and obtain, in the first standard data source file and the second standard data source file, a data item attribute included in the data item that matches the key data item, and store the data item attribute in the first attribute information and the second attribute information. When the key data item includes a key data item belonging to a hierarchy next to the hierarchy to which the key data item belongs, the subunit finds and acquires a data item attribute corresponding to the key data item belonging to the next hierarchy in the first standard data source file and the second standard data source file, respectively. The retrieval unit 720 may search and retrieve data item attributes corresponding to the key data items traversably in the first standard data source file and the second standard data source file.
The comparing unit 730 is configured to execute, as in step S300 in fig. 3, comparing the first attribute information with the second attribute information to obtain a variation between the first standard data source file and the second standard data source file.
Additionally, the system 700 can further include a hinting unit 740 (shown in dashed lines in FIG. 7) for hinting an effect of a change based on the change between the first standard data source file and the second standard data source file.
Figure 8 illustrates a system 800 for converting AUTOSAR standard and non-AUTOSAR standard data-source files, according to an embodiment of the invention. The system 800 includes a modeling unit 810, an acquisition unit 820, a mapping unit 830, and a transformation unit 840.
The modeling unit 810 is configured to perform step S500 of the conversion method as shown in fig. 5, and build a multi-hierarchy data item model, the multi-hierarchy data item model including key data items belonging to different hierarchies, the key data items being stored in the standard data source file and the non-standard data source file.
The obtaining unit 820 is configured to perform, as in step S600 in fig. 5, obtaining attribute information corresponding to the key data item in the non-standard data source file based on the key data item.
Further, the retrieving unit 820 further comprises sub-units for performing sub-steps S610 to S690 of step S600 in fig. 5, respectively, to find the data item attributes corresponding to the key data items in the non-standard data source file, respectively. Each subunit is used for searching the data items matched with the key data items in the non-standard data source file, acquiring the data item attributes contained in the data items matched with the key data items in the non-standard data source file, and storing the data item attributes into the attribute information. When the key data item includes a key data item belonging to a level next to the level to which the key data item belongs, a data item attribute corresponding to the key data item belonging to the next level is found and acquired in the non-standard data source file. The retrieval unit 820 may search and retrieve data item attributes corresponding to all key data items traversably in a non-standard data source file.
The mapping unit 830 is configured to execute step S700 in fig. 6, and generate a mapping relationship between the multi-level data item model and the non-standard data source file based on the attribute information.
The conversion unit 840 is configured to convert the non-standard data source file into the standard data source file or convert the standard data source file into the non-standard data source file based on the mapping relationship.
The analysis and conversion method and system according to the embodiment of the invention can be particularly applied to AUTOSAR standard data source files.
It should be noted that although several modules or units of the system for analyzing and converting standard data source files are mentioned in the above detailed description, such partitioning is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units. The components shown as modules or units may or may not be physical units, i.e. may be located in one place or may also be distributed over a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
In an exemplary embodiment of the invention, there is also provided a computer readable storage medium, on which a computer program is stored, the program comprising executable instructions which, when executed by, for example, a processor, may implement the steps of the method for analyzing or converting standard data source files described in any of the above embodiments. In some possible embodiments, aspects of the present invention may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present invention described in the method for analyzing or converting standard data source files of the present specification, when the program product is run on the terminal device.
In an exemplary embodiment of the invention, there is also provided an electronic device that may include a processor and a memory for storing executable instructions of the processor. Wherein the processor is configured to perform the steps of the method for analyzing or converting standard data source files in any of the above embodiments via execution of the executable instructions.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
By using the method, the system and the storage medium, a user can accurately distinguish data change positions and contents by quickly and accurately comparing differences among different versions of standard data source files, the user can conveniently check version changes, and check whether the data source files are correct to avoid important information loss; when the nonstandard data source file and the standard data source file need to be mutually converted, the efficiency and the accuracy of the process of configuring and generating the standard data source file by adopting the relatively simple nonstandard data source file are improved, the configuration is easier, the cost is reduced, and the accuracy of the standard data source file is improved.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
Claims (19)
1. A method for analyzing standard data source files, comprising:
establishing a multi-level data item model comprising key data items belonging to different levels, the key data items being stored in first and second standard data source files;
acquiring first attribute information and second attribute information corresponding to the key data items in the first standard data source file and the second standard data source file respectively based on the key data items; and
comparing the first attribute information with the second attribute information to obtain a variation between the first standard data source file and the second standard data source file.
2. The method of claim 1, wherein building a multi-level data item model comprises:
selecting the key data item from data items stored in the first standard data source file and the second standard data source file based on an analysis rule;
wherein each of the key data items includes only a data item attribute or includes a data item attribute and at least one key data item belonging to a hierarchy next to a hierarchy to which the key data item belongs.
3. The method of claim 2, wherein obtaining first attribute information and second attribute information corresponding to the key data item in the first standard data source file and the second standard data source file, respectively, based on the key data item comprises:
searching and acquiring data item attributes corresponding to the key data items in the first standard data source file and the second standard data source file respectively, wherein:
searching data items matched with the key data items in the first standard data source file and the second standard data source file respectively; and
acquiring data item attributes contained in data items matching the key data items in the first standard data source file and the second standard data source file respectively and storing the data item attributes into the first attribute information and the second attribute information.
4. The method of claim 3, wherein when the key data item includes a key data item belonging to a level next to a level to which the key data item belongs, data item attributes corresponding to the key data item belonging to the next level are found and retrieved in the first and second standard data source files, respectively.
5. The method of claim 4, wherein obtaining first attribute information and second attribute information corresponding to the key data item in the first standard data source file and the second standard data source file, respectively, based on the key data item further comprises:
and searching and acquiring data item attributes corresponding to all the key data items in the first standard data source file and the second standard data source file in a traversal mode.
6. The method of any of claims 1 to 5, further comprising:
based on a change between the first standard data source file and the second standard data source file, prompting for an impact of the change.
7. The method of any one of claims 1-6, the first and second standard data-source files being AUTOSAR data-source files.
8. The method of claim 7, wherein the key data items include at least a data frame item belonging to a first hierarchical level, a protocol data unit item belonging to a second hierarchical level, and a signal item belonging to a third hierarchical level, each of the data frame items including a data frame attribute and one of the protocol data unit items, each of the protocol data unit items including a protocol data unit attribute and at least one signal item, each signal item including at least one signal group and/or at least one signal, each of the signal groups including a signal group attribute and at least one of the signals, each of the signals including a signal attribute.
9. A method for converting standard and non-standard data source files, comprising:
establishing a multi-level data item model comprising key data items belonging to different levels, the key data items being stored in the standard data source files and the non-standard data source files;
acquiring attribute information corresponding to the key data item in the non-standard data source file based on the key data item;
generating a mapping relationship between the multi-level data item model and the non-standard data source file based on the attribute information; and
and converting the non-standard data source file into a standard data source file or converting the standard data source file into a non-standard data source file based on the mapping relation.
10. The method of claim 9, wherein building a multi-level data item model comprises:
selecting the key data item from data items stored in the standard data source file based on an analysis rule;
wherein each of the key data items includes only a data item attribute or includes a data item attribute and at least one key data item belonging to a hierarchy next to a hierarchy to which the key data item belongs.
11. The method of claim 9, wherein obtaining attribute information corresponding to the key data item in the non-standard data source file based on the key data item comprises:
searching for data item attributes corresponding to the key data items in the non-standard data source file, wherein:
searching for a data item matching the key data item in the non-standard data source file; and
and acquiring data item attributes contained in the data items matched with the key data items in the non-standard data source file and storing the data item attributes into the attribute information.
12. The method of claim 11, wherein when the key data item comprises a key data item belonging to a next level of a hierarchy to which the key data item belongs, finding and retrieving a data item attribute corresponding to the key data item belonging to the next hierarchy in the non-standard data source file.
13. The method of claim 12, wherein obtaining attribute information corresponding to the key data item in the non-standard data source file based on the key data item further comprises:
and searching and acquiring data item attributes corresponding to all the key data items in the non-standard data source file in a traversal mode.
14. The method of any one of claims 9 to 13, the standard data source file being an AUTOSAR data source file.
15. The method of claim 14, wherein the key data items include at least a data frame item belonging to a first hierarchical level, a protocol data unit item belonging to a second hierarchical level, and a signal item belonging to a third hierarchical level, each of the data frame items including a data frame attribute and one of the protocol data unit items, each of the protocol data unit items including a protocol data unit attribute and at least one signal item, each signal item including at least one signal group and/or at least one signal, each of the signal groups including a signal group attribute and at least one of the signals, each of the signals including a signal attribute.
16. A system for analyzing standard data source files, comprising:
a modeling unit arranged to build a multi-level data item model comprising key data items belonging to different levels, the key data items being stored in first and second standard data source files;
an acquisition unit configured to acquire first attribute information and second attribute information corresponding to the key data items in the first standard data source file and the second standard data source file, respectively, based on the key data items; and
a comparison unit configured to compare the first attribute information with the second attribute information to acquire a variation between the first standard data source file and the second standard data source file.
17. A system for converting standard and non-standard data source files, comprising:
a modeling unit arranged to build a multi-level data item model comprising key data items belonging to different levels, the key data items being stored in the standard data source file and the non-standard data source file;
an acquisition unit configured to acquire attribute information corresponding to the key data item in the non-standard data source file based on the key data item;
a mapping unit arranged to generate a mapping relationship between the multi-level data item model and the non-standard data source file based on the attribute information; and
a conversion unit configured to convert the non-standard data source file into a standard data source file or convert the standard data source file into a non-standard data source file based on the mapping relationship.
18. A computer-readable storage medium, on which a computer program is stored, the computer program comprising executable instructions that, when executed by a processor, carry out the method of any one of claims 1 to 15.
19. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is arranged to execute the executable instructions to implement the method of any one of claims 1 to 15.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811505595.0A CN111310416A (en) | 2018-12-10 | 2018-12-10 | Method and system for analyzing and converting standard data source files |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811505595.0A CN111310416A (en) | 2018-12-10 | 2018-12-10 | Method and system for analyzing and converting standard data source files |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111310416A true CN111310416A (en) | 2020-06-19 |
Family
ID=71156114
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811505595.0A Pending CN111310416A (en) | 2018-12-10 | 2018-12-10 | Method and system for analyzing and converting standard data source files |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111310416A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102231107A (en) * | 2011-06-09 | 2011-11-02 | 浙江大学 | Method for automatically generating communication data format of electric control unit based on AUTOSAR (Automotive Open System Architecture) |
US20130124703A1 (en) * | 2011-11-11 | 2013-05-16 | Electronics And Telecommunications Research Institute | Method and apparatus for setting up gateway for autosar-based vehicle network |
CN105512097A (en) * | 2015-11-26 | 2016-04-20 | 普华基础软件股份有限公司 | File analyzing method |
CN108009264A (en) * | 2017-12-14 | 2018-05-08 | 北京航天测控技术有限公司 | A kind of comparative approach of versions of data for Excel format files |
-
2018
- 2018-12-10 CN CN201811505595.0A patent/CN111310416A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102231107A (en) * | 2011-06-09 | 2011-11-02 | 浙江大学 | Method for automatically generating communication data format of electric control unit based on AUTOSAR (Automotive Open System Architecture) |
US20130124703A1 (en) * | 2011-11-11 | 2013-05-16 | Electronics And Telecommunications Research Institute | Method and apparatus for setting up gateway for autosar-based vehicle network |
CN105512097A (en) * | 2015-11-26 | 2016-04-20 | 普华基础软件股份有限公司 | File analyzing method |
CN108009264A (en) * | 2017-12-14 | 2018-05-08 | 北京航天测控技术有限公司 | A kind of comparative approach of versions of data for Excel format files |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11269694B2 (en) | Automated API code generation | |
US6105061A (en) | Hierarchically distributed network management system using open system interconnection (OSI) protocols | |
CN108549538B (en) | Code detection method and device, storage medium and test terminal | |
CN106407111B (en) | Terminal test device, terminal test equipment and variable maintaining method | |
CN108491715B (en) | Terminal fingerprint database generation method and device and server | |
CN110263222B (en) | Data acquisition method, device, equipment and medium | |
CN110007906B (en) | Script file processing method and device and server | |
CN111679852B (en) | Detection method and device for conflict dependency library | |
CN113961768B (en) | Sensitive word detection method and device, computer equipment and storage medium | |
US20240256613A1 (en) | Data processing method and apparatus, readable storage medium, and electronic device | |
CN114238381A (en) | Data quality checking method, device and computer readable storage medium | |
CN106570095B (en) | XML data operation method and equipment | |
CN109992581B (en) | HashMap-based data acquisition method and device, computer equipment and storage medium | |
CN114329090A (en) | Path reference searching method and device, electronic equipment and storage medium | |
CN111310416A (en) | Method and system for analyzing and converting standard data source files | |
CN112613072A (en) | Information management method, management system and management cloud platform based on file big data | |
CN110263223B (en) | Data type conversion method, device, equipment and medium | |
JPH04233065A (en) | Method and apparatus for interpreting and organizing timing specification data | |
CN112445816B (en) | Vehicle diagnosis data reference method, device, terminal equipment and storage medium | |
CN111711605B (en) | Data protocol active analysis method for Internet of things platform | |
CN114547083A (en) | Data processing method and device and electronic equipment | |
CN110515905B (en) | Method, device and server for configuring route | |
CN109388400B (en) | Automatic page generation method and device | |
US20240330286A1 (en) | Apparatus, method and storage medium for database query | |
CN112445491B (en) | File sequence processing method, device, terminal equipment and storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200619 |