CN110390082B - Communication matrix comparison method and system - Google Patents

Communication matrix comparison method and system Download PDF

Info

Publication number
CN110390082B
CN110390082B CN201810347892.0A CN201810347892A CN110390082B CN 110390082 B CN110390082 B CN 110390082B CN 201810347892 A CN201810347892 A CN 201810347892A CN 110390082 B CN110390082 B CN 110390082B
Authority
CN
China
Prior art keywords
signal
message
name
address
attributes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810347892.0A
Other languages
Chinese (zh)
Other versions
CN110390082A (en
Inventor
曾备
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gac Aion New Energy Vehicle Co ltd
Original Assignee
GAC Aion New Energy Automobile Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GAC Aion New Energy Automobile Co Ltd filed Critical GAC Aion New Energy Automobile Co Ltd
Priority to CN201810347892.0A priority Critical patent/CN110390082B/en
Publication of CN110390082A publication Critical patent/CN110390082A/en
Application granted granted Critical
Publication of CN110390082B publication Critical patent/CN110390082B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/194Calculation of difference between files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides a communication matrix comparison method and a system, wherein the method comprises the steps of respectively reading a first DBC file and a second DBC file, wherein the first DBC file comprises a plurality of first CAN messages, and the second DBC file comprises a plurality of second CAN messages; extracting first key information containing a first CAN message address from each first CAN message, extracting second key information containing a second CAN message address from each second CAN message, comparing the plurality of first CAN message addresses with the plurality of second CAN message addresses, and respectively labeling the first CAN message and the second CAN message when the first CAN message address is different from the second CAN message address. According to the invention, the DBC files of the communication matrix are compared, the differences of different DBC files are distinguished, and the differences are displayed, so that the version management and the difference analysis of the automobile communication matrix are rapidly realized, and the problems of low efficiency and high error rate of manually comparing the DBC files in the prior art are solved.

Description

Communication matrix comparison method and system
Technical Field
The invention relates to the technical field of software, in particular to a communication matrix comparison method and system.
Background
The Control Area Network (CAN) is one of the most widely used buses in the world, and the CAN bus protocol has become the standard bus for automotive computer control systems and embedded industrial control Area networks in north america and western europe. In a hybrid electric vehicle, main part controllers of the vehicle, especially a vehicle controller, mainly perform control signal interaction through a CAN bus.
In the process of developing the software of the vehicle controller, the definition (namely, a communication matrix) of the interaction signals of each controller is a precondition for realizing the software development. Meanwhile, with the progress of the development of the whole vehicle, the functions of the parts and the associated signals are changed frequently, and the version of the communication matrix is iterated; on the other hand, different development projects often involve the continuation of signal definition, and a mixed version of the communication matrix appears, so that version management and difference analysis of the communication matrix become prominent problems in the whole vehicle (software) development process, and the manual implementation speed is slow, the efficiency is low, and the error rate is high.
Existing state-of-the-art software only supports communication matrix Database (DBC) DBC file opening and editing and does not support comparison between DBC files.
Disclosure of Invention
In order to solve the above technical problems, the present invention provides a communication matrix comparison method and system.
The invention provides a communication matrix comparison method, which comprises the following steps:
respectively reading a first DBC file and a second DBC file, wherein the first DBC file comprises a plurality of first CAN messages, and the second DBC file comprises a plurality of second CAN messages;
extracting first key information from each first CAN message, wherein the first key information comprises a first CAN message address, a first CAN message name corresponding to the first CAN message address, a first CAN message sending period and a first CAN message sending type;
extracting second key information from each second CAN message, wherein the second key information comprises a second CAN message address, a second CAN message name corresponding to the second CAN message address, a second CAN message sending period and a second CAN message sending type;
comparing the plurality of second CAN message addresses with the plurality of first CAN message addresses, and marking a second CAN message corresponding to the second CAN message address and a first CAN message corresponding to the first CAN message address respectively when the second CAN message address is different from the first CAN message address;
and when the second CAN message address is the same as the first CAN message address, correspondingly comparing the second CAN message name, the second CAN message sending period and the second CAN message sending type corresponding to the second CAN message address with the first CAN message name, the first CAN message sending period and the first CAN message sending type corresponding to the first CAN message address respectively, and marking when the second CAN message address is different from the first CAN message address.
Further, the first key information further includes a first CAN signal in the first CAN message, the first CAN signal includes a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal; the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
comparing the plurality of second CAN signal names with the plurality of first CAN signal names, and marking a second CAN signal corresponding to the second CAN signal name and a first CAN signal name corresponding to the first CAN signal name respectively when the second CAN signal name is different from the first CAN signal name;
and when the second CAN signal name is the same as the first CAN signal name, correspondingly comparing a second CAN signal start bit, a second CAN signal length and other attributes of the second CAN signal corresponding to the second CAN signal name with a first CAN signal start bit, a first CAN signal length and other attributes of the first CAN signal corresponding to the first CAN signal name respectively, and labeling when the second CAN signal name is different from the first CAN signal name.
Further, the first key information further includes a first CAN signal in the first CAN message, the first CAN signal includes a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal; the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
and comparing a second CAN message address, a second CAN signal start bit and a second CAN signal length corresponding to a second CAN signal with a first CAN message address, a first CAN signal start bit and a first CAN signal length corresponding to a first CAN signal respectively, and comparing a second CAN signal name and other attributes of the second CAN signal corresponding to the second CAN signal with a first CAN signal name and other attributes of the first CAN signal corresponding to the first CAN signal respectively and marking when the two are not the same.
Further, the method further comprises:
importing the second key information into an EXCEL file, calling a com interface of the component object model to label on the EXCEL file imported with the second key information, wherein the labeling specifically comprises the following steps:
when the first CAN message address is different from the second CAN message address, marking a second CAN message corresponding to the second CAN message address as a CAN message of which the second DBC file is added relative to the first DBC file;
and when the first CAN message address is the same as the second CAN message address, correspondingly comparing a second CAN message name, a second CAN message sending period and a second CAN message sending type corresponding to the second CAN message address with a first CAN message name, a first CAN message sending period and a first CAN message sending type corresponding to the first CAN message address respectively, and marking the difference as the modification difference of a second DBC file relative to the first DBC file CAN message when the difference is different.
Further, the method further comprises:
importing the second key information into an EXCEL file, calling a component object model com interface to perform the labeling on the EXCEL file imported with the second key information, wherein the labeling specifically comprises:
when the second CAN signal name is different from the first CAN signal name, marking a second CAN signal corresponding to the second CAN signal name as a CAN signal added by the second DBC file relative to the first DBC file;
and when the second CAN signal name is the same as the first CAN signal name, correspondingly comparing a second CAN signal start bit, a second CAN signal length and other attributes of a second CAN signal corresponding to the second CAN signal name with a first CAN signal start bit, a first CAN signal length and other attributes of a first CAN signal corresponding to the first CAN signal name respectively, and marking the difference of the second DBC file with respect to the modification of the first DBC file CAN signal when the difference is different.
Further, the method further comprises:
importing the second key information into an EXCEL file, calling a com interface of the component object model to perform the labeling on the EXCEL file imported with the second key information, wherein the labeling specifically comprises the following steps:
and only when the two CAN signals are the same, correspondingly comparing the name of the second CAN signal corresponding to the second CAN signal and other attributes of the second CAN signal with the name of the first CAN signal corresponding to the first CAN signal and other attributes of the first CAN signal respectively, and marking the difference as the modification difference of the second DBC file relative to the CAN signal of the first DBC file when the name of the second CAN signal and other attributes of the second CAN signal are not the same.
The invention provides a communication matrix comparison system, which comprises:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for respectively reading a first DBC file and a second DBC file, the first DBC file comprises a plurality of first CAN messages, and the second DBC file comprises a plurality of second CAN messages;
extracting first key information from each first CAN message, wherein the first key information comprises a first CAN message address, a first CAN message name corresponding to the first CAN message address, a first CAN message sending period and a first CAN message sending type;
and extracting second key information from each second CAN message, wherein the second key information comprises a second CAN message address, a second CAN message name corresponding to the second CAN message address, a second CAN message sending period and a second CAN message sending type.
The comparison unit is used for comparing the plurality of second CAN message addresses with the plurality of first CAN message addresses, and respectively marking a second CAN message corresponding to the second CAN message address and a first CAN message corresponding to the first CAN message address when the second CAN message address is different from the first CAN message address;
and when the second CAN message address is the same as the first CAN message address, correspondingly comparing the second CAN message name, the second CAN message sending period and the second CAN message sending type corresponding to the second CAN message address with the first CAN message name, the first CAN message sending period and the first CAN message sending type corresponding to the first CAN message address respectively, and marking when the second CAN message address is different from the first CAN message address.
Further, the first key information further includes a first CAN signal in the first CAN message, the first CAN signal includes a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal;
the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
the comparison unit is also used for comparing a plurality of second CAN signal names with a plurality of first CAN signal names, and labeling a second CAN signal corresponding to the second CAN signal name and a first CAN signal name corresponding to the first CAN signal name respectively when the second CAN signal name is different from the first CAN signal name;
and when the second CAN signal name is the same as the first CAN signal name, correspondingly comparing a second CAN signal start bit, a second CAN signal length and other attributes of the second CAN signal corresponding to the second CAN signal name with a first CAN signal start bit, a first CAN signal length and other attributes of the first CAN signal corresponding to the first CAN signal name respectively, and labeling when the second CAN signal name is not the same as the first CAN signal name.
Further, the first key information further includes a first CAN signal in the first CAN message, the first CAN signal includes a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal; the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
the comparison unit is also used for correspondingly comparing a second CAN message address, a second CAN signal start bit and a second CAN signal length corresponding to the second CAN signal with a first CAN message address, a first CAN signal start bit and a first CAN signal length corresponding to the first CAN signal respectively, and correspondingly comparing a second CAN signal name and other attributes of the second CAN signal with a first CAN signal name and other attributes of the first CAN signal corresponding to the first CAN signal respectively only when the second CAN message address, the second CAN signal start bit and the second CAN signal length are the same as the first CAN signal address, the first CAN signal start bit and the first CAN signal length respectively, and labeling at different times.
Further, the system also comprises a display unit, wherein the display unit is used for importing the second key information into the EXCEL file; and calling a com interface of the component object model to label the difference information on the EXCEL file for importing the second key information.
The implementation of the invention has the following beneficial effects:
according to the invention, the characteristics of the DBC files are classified, the key information of the DBC files is extracted according to a certain rule and sequence, and the key information of different DBC files is compared, so that the difference among the DBC files is found and displayed, the problems of low efficiency and high error rate of manually comparing the DBC files in the prior art are solved, the communication matrix DBC files are quickly compared, the difference among different DBC files is distinguished, and the version management and difference analysis of the automobile communication matrix are quickly realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a block diagram of CAN messages and CAN signals provided by the present invention.
Fig. 2 is a flowchart of a communication matrix comparison method provided by the present invention.
Fig. 3 is a flowchart of a communication matrix comparison method provided by the present invention.
Fig. 4 is a flowchart of a communication matrix comparison method provided by the present invention.
Fig. 5 is a flowchart of a communication matrix comparison method provided by the present invention.
Fig. 6 is a flowchart of a communication matrix comparison method provided by the present invention.
Fig. 7 is a structural diagram of a communication matrix comparison system provided by the present invention.
Detailed Description
The core content of the patent is to find out the difference between the communication matrixes through comparison of different DBC files, and to quickly and accurately position the difference between different communication matrixes for engineers, and the specific implementation mode of the system is further explained in the following by combining with the attached drawings and the embodiment.
The following describes an embodiment of a communication matrix comparison method and system provided by the present invention in detail.
As shown in fig. 1, the present invention provides a structural relationship between a CAN message and a CAN signal, which specifically includes:
a CAN message comprises at least one CAN signal or a plurality of CAN signals, wherein at least one CAN signal is represented by a solid line, other CAN signals are represented by a dotted line, the dotted line represents the possible existence or nonexistence, and the CAN message parameters comprise a CAN message name, a CAN message address, a CAN message sending period and a CAN message sending type; the CAN signal parameters comprise CAN signal names, CAN signal start bits, CAN signal lengths, CAN signal maximum values, CAN signal minimum values, CAN signal initial values, CAN signal accuracies, CAN signal offsets and the like, and the CAN signal maximum values, the CAN signal minimum values, the CAN signal initial values, the CAN signal accuracies, the CAN signal offsets and the like are collectively referred to as CAN signals and other attributes for simplification.
As shown in fig. 2, the present invention provides a communication matrix comparison method, which includes the following steps:
step S201, respectively reading the first DBC file and the second DBC file.
It should be noted that, in this embodiment, the first and second files do not represent a sequence, and are only used for distinguishing different DBC files, CAN messages, CAN signals, and the like.
The first DBC file contains a plurality of first CAN messages and the second DBC file contains a plurality of second CAN messages.
In this embodiment, the script edited by MATLAB software can be used for implementation.
In step S202, first key information is extracted from each of the first CAN messages, and second key information is extracted from each of the second CAN messages.
Wherein, the structure of the DBC file is as follows:
DBC_file=
version number
nodes node
messages
Of course, the examples given here are only for illustration of DBC files, and do not represent a complete DBC file, and for messages = { message }, the messages are defined as follows:
message = BO_ message_id message_name ':' message_size transmitter {signal}
the message includes a CAN message number, a CAN message name, a CAN message size, a sender and a CAN signal, and certainly, according to different developers and different requirements, parameters defined in the message are differentiated, and the CAN message CAN also include information such as a CAN message address, a CAN message sending period and a CAN message sending type.
signal = 'SG_' signal_name multiplexer_indicator ':' start_bit '|'
signal_size '@' byte_order value_type '(' factor ',' offset ')'
'[' minimum '|' maximum ']' unit receiver {',' receiver}
The definition of the CAN signal here is that the CAN signal includes a CAN signal name, a multiplexer indicator bit, a CAN signal start bit, a CAN signal length, a CAN signal endian, a factor, an offset, a minimum value, a maximum value and a receiver, and we refer to the CAN signal name, the CAN signal start bit and the CAN signal length as other attributes of the CAN signal here, and may include other parameters of the CAN signal.
Because the formats of the CAN message and the CAN signal are fixed after the CAN message and the CAN signal are well defined, the CAN message name, the CAN message address, the CAN signal name, the CAN signal start bit and other considered key information CAN be extracted through the regular expression.
The first key information and the second key information are preset, the first key information CAN comprise a first CAN message address, a first CAN message name corresponding to the first CAN message address, a first CAN message sending period and a first CAN message sending type, the second key information CAN comprise a second CAN message address, a second CAN message name corresponding to the second CAN message address, a second CAN message sending period and a second CAN message sending type, the first key information and the second key information are compared to obtain difference information, and the difference information comprises CAN message increase difference and CAN message decrease difference and CAN also be CAN message modification difference; CAN signal increase differences, CAN signal decrease differences and CAN signal modification differences are also possible.
Step S203, comparing the plurality of second CAN message addresses with the plurality of first CAN message addresses, and marking a second CAN message corresponding to the second CAN message address and a first CAN message corresponding to the first CAN message address respectively when the second CAN message addresses are different from the first CAN message addresses.
It should be noted that, when the second CAN message address is different from the first CAN message address, only marking "the second DBC file deletes the first CAN message with respect to the first DBC file" at the first CAN message corresponding to the first CAN message address of the first DBC file, or marking in a color block or other well-defined mark manner, so as to prompt the second DBC file to delete the first CAN message with respect to the first DBC file; and marking a second CAN message corresponding to a second CAN message address of the second DBC file, wherein the second CAN message is a new second CAN message of the second DBC file relative to the first DBC file, or marking a special mark for indicating that the second CAN message is a new message.
And step S204, when the second CAN message address is the same as the first CAN message address, correspondingly comparing the second CAN message name, the second CAN message sending period and the second CAN message sending type corresponding to the second CAN message address with the first CAN message name, the first CAN message sending period and the first CAN message sending type corresponding to the first CAN message address respectively, and marking when the second CAN message address is not the same as the first CAN message address.
It should be noted that, when the second CAN message address is the same as the first CAN message address, the second CAN message name, the second CAN message sending period, the second CAN message sending type, the first CAN message name, the first CAN message sending period, and the first CAN message sending type are respectively compared, and when the second CAN message name is different from the first CAN message name, marking "the second CAN message name is modified with respect to the first CAN message name" at the second CAN message name, "and processing the difference between the first CAN message sending period and the second CAN message sending period, and the difference between the first CAN message sending type and the second CAN message sending type in the same way.
As shown in fig. 3, in order to optimize the comparison efficiency and obtain the comparison result more quickly, the specific steps of extracting the first key information from the first DBC file and the second key information from the second DBC file, and comparing the first key information with the second key information to obtain the difference information include:
step S301, extracting a first CAN message address from the first CAN message, and extracting a second CAN message address from the second CAN message.
Step S302, comparing the second CAN message address with the first CAN message address, and obtaining the CAN message increase difference, the CAN message decrease difference and the same CAN message address of the second CAN message compared with the first CAN message.
It should be noted that the CAN message address is not changed, and only the CAN message addresses are used for comparison, so that it CAN be determined whether the second CAN message is increased or decreased compared with the first CAN message, if the second CAN message is increased, the CAN message is increased in difference, and if the second CAN message is decreased, the CAN message is decreased in difference.
The comparison in tabular form is as follows:
first CAN message address Second CAN message address Comparison of
abc CAN message reduction variance
efg efg CAN message address is the same
hig hig CAN message address identity
okp CAN message add-on difference
As shown in fig. 4, the communication matrix comparison method provided by the present invention includes the steps of:
the method for extracting the first key information from the first CAN information further comprises a first CAN signal in the first CAN information, wherein the first CAN signal comprises a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length and other attributes of the first CAN signal.
The second key information extracted from the second CAN information also comprises a second CAN signal in the second CAN information, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal.
Step S401, comparing the plurality of second CAN signal names with the plurality of first CAN signal names, and labeling the second CAN signal corresponding to the second CAN signal name and the first CAN signal corresponding to the first CAN signal name, respectively, when the second CAN signal name is different from the first CAN signal name.
It should be noted that, the first CAN signal name and the second CAN signal name are both labeled "the second CAN signal name is modified with respect to the first CAN signal name".
Step S402, when the second CAN signal name is the same as the first CAN signal name, correspondingly comparing the second CAN signal start bit, the second CAN signal length and other attributes of the second CAN signal corresponding to the second CAN signal name with the first CAN signal start bit, the first CAN signal length and other attributes of the first CAN signal corresponding to the first CAN signal name, and labeling when the second CAN signal name is not the same as the first CAN signal name.
It should be noted that when the second CAN signal name is the same as the first CAN signal name, the second CAN signal start bit, the second CAN signal length, other attributes of the second CAN signal, the first CAN signal start bit, the first CAN signal length, and other attributes of the first CAN signal are respectively compared, and when the second CAN signal start bit is different from the first CAN signal start bit, the first CAN signal start bit is labeled with "the second CAN signal start bit is modified relative to the first CAN signal start bit", the second CAN signal start bit is labeled with "the second CAN signal start bit is modified relative to the first CAN signal start bit", and the same method is used for processing the difference between the first CAN signal length and the second CAN signal length, and the difference between the other attributes of the first CAN signal and the other attributes of the second CAN signal.
It should be noted that, here, the first CAN signal name is compared with the second CAN signal name.
On the basis of the condition that the CAN signal name is not changed, the second CAN message name, the second CAN message sending period or the second CAN message sending type is found to be modified on the basis of the first CAN signal start bit, the first CAN message sending period or the first CAN message sending type, and the CAN message modification difference is considered to be the CAN message modification difference, namely the second CAN message has the CAN message modification difference on the basis of the first CAN message and is marked when the second CAN message is different from the first CAN message.
As shown in fig. 5, the communication matrix comparison method provided by the present invention includes the steps of:
the CAN message comprises at least one CAN signal, so that the first key information further comprises a first CAN signal in the first CAN message, the first CAN signal comprises a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length and other attributes of the first CAN signal, and the other attributes of the first CAN signal mean that the first CAN signal parameter does not comprise the first CAN signal name, the first CAN signal start bit and the first CAN signal length, and the first CAN signal parameter, the first CAN signal start bit and the first CAN signal parameter are all called as the other attributes of the first CAN signal.
The method for extracting the first key information from the first CAN information further comprises a first CAN signal in the first CAN information, wherein the first CAN signal comprises a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length and other attributes of the first CAN signal.
The second key information extracted from the second CAN information also comprises a second CAN signal in the second CAN information, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal.
Step S501, a second CAN message address, a second CAN signal start bit and a second CAN signal length corresponding to a second CAN signal are respectively and correspondingly compared with a first CAN message address, a first CAN signal start bit and a first CAN signal length corresponding to a first CAN signal.
And step S502, only when the first CAN signal name and the other attributes of the first CAN signal are the same, respectively comparing the first CAN signal name and the other attributes of the first CAN signal with the second CAN signal name and the other attributes of the second CAN signal corresponding to the second CAN signal, and labeling when the first CAN signal name and the second CAN signal are different.
It should be noted that, when the first CAN signal name is different from the second CAN signal name, the first CAN signal name and the second CAN signal name are labeled with "the second CAN signal name is modified with respect to the first CAN signal name".
As shown in fig. 6, the steps of the communication matrix comparison method provided by the present invention include:
step S601, importing the second key information into an EXCEL file.
It was stated earlier that the second key information is extracted from the second DBC file, and the second key information is imported into the EXCEL file.
And step S602, calling a component object model com interface to label the top of the EXCEL file imported with the second key information.
The key information is imported into EXCEL, and the purpose of labeling in the EXCEL is to display the contrast difference like a catalog.
Calling a com interface of the component object model to label the EXCEL file imported with the second key information, wherein the labeling specifically comprises the following steps:
when the first CAN message address is different from the second CAN message address, marking the second CAN corresponding to the second CAN message address as a CAN message of which the second DBC file is increased relative to the first DBC file;
and when the first CAN message address is the same as the second CAN message address, correspondingly comparing the second CAN message name, the second CAN message sending period and the second CAN message sending type corresponding to the second CAN message address with the first CAN message name, the first CAN message sending period and the first CAN message sending type corresponding to the first CAN message address, and marking the modification difference of the second DBC file relative to the first DBC file CAN message when the modification difference is not the same.
The step of marking the calling component object model com interface on the EXCEL file imported with the second key information is also specifically as follows:
importing the second key information into an EXCEL file, calling a component object model com interface to perform the labeling on the EXCEL file imported with the second key information, wherein the labeling specifically comprises:
when the second CAN signal name is different from the first CAN signal name, marking a second CAN signal corresponding to the second CAN signal name as a CAN signal added by the second DBC file relative to the first DBC file;
and when the second CAN signal name is the same as the first CAN signal name, correspondingly comparing a second CAN signal start bit, a second CAN signal length and other attributes of the second CAN signal corresponding to the second CAN signal name with a first CAN signal start bit, a first CAN signal length and other attributes of the first CAN signal corresponding to the first CAN signal name respectively, and marking the second CAN signal start bit, the second CAN signal length and other attributes of the second CAN signal as the modification difference of the second DBC file relative to the CAN signal of the first DBC file when the second CAN signal name is not the same as the first CAN signal name.
The step of marking the calling component object model com interface on the EXCEL file imported with the second key information is also specifically as follows:
and only when the two CAN signals are the same, respectively comparing the name of the second CAN signal corresponding to the second CAN signal and other attributes of the second CAN signal with the name of the first CAN signal corresponding to the first CAN signal and other attributes of the first CAN signal, and marking the difference of the modification of the second DBC file relative to the CAN signal of the first DBC file when the name of the second CAN signal and other attributes of the second CAN signal are different from the name of the first CAN signal and other attributes of the first CAN signal.
Here, we label only the added part and the modified part on the EXCEL file, and do not label the deleted part, whether it is for CAN messages or CAN signals.
As shown in fig. 7, the communication matrix comparison system provided by the present invention includes:
an obtaining unit 71, configured to read a first DBC file and a second DBC file, respectively, where the first DBC file includes a plurality of first CAN messages, and the second DBC file includes a plurality of second CAN messages;
extracting first key information from each first CAN message, wherein the first key information comprises a first CAN message address, a first CAN message name corresponding to the first CAN message address, a first CAN message sending period and a first CAN message sending type;
and extracting second key information from each second CAN message, wherein the second key information comprises a second CAN message address, a second CAN message name corresponding to the second CAN message address, a second CAN message sending period and a second CAN message sending type.
A comparing unit 72, configured to compare the plurality of second CAN message addresses with the plurality of first CAN message addresses, and label a second CAN message corresponding to the second CAN message address and a first CAN message corresponding to the first CAN message address respectively when the second CAN message address is different from the first CAN message address;
and when the second CAN message address is the same as the first CAN message address, correspondingly comparing a second CAN message name, a second CAN message sending period and a second CAN message sending type corresponding to the second CAN message address with a first CAN message name, a first CAN message sending period and a first CAN message sending type corresponding to the first CAN message address respectively, and marking when the second CAN message address is different from the first CAN message address.
Further, the first key information further includes a first CAN signal in the first CAN message, the first CAN signal includes a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal;
the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
the comparison unit is also used for comparing a plurality of second CAN signal names with a plurality of first CAN signal names, and labeling a second CAN signal corresponding to the second CAN signal name and a first CAN signal name corresponding to the first CAN signal name respectively when the second CAN signal name is different from the first CAN signal name;
and when the second CAN signal name is the same as the first CAN signal name, correspondingly comparing a second CAN signal start bit, a second CAN signal length and other attributes of the second CAN signal corresponding to the second CAN signal name with a first CAN signal start bit, a first CAN signal length and other attributes of the first CAN signal corresponding to the first CAN signal name respectively, and labeling when the second CAN signal name is not the same as the first CAN signal name.
Further, the first key information further includes a first CAN signal in the first CAN message, the first CAN signal includes a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal; the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
the comparison unit is also used for comparing a second CAN message address, a second CAN signal start bit and a second CAN signal length corresponding to the second CAN signal with a first CAN message address, a first CAN signal start bit and a first CAN signal length corresponding to the first CAN signal respectively, and comparing a second CAN signal name and other attributes of the second CAN signal corresponding to the second CAN signal with a first CAN signal name and other attributes of the first CAN signal corresponding to the first CAN signal respectively only when the first CAN message address, the second CAN signal start bit and the second CAN signal length are the same as the first CAN signal address, the first CAN signal start bit and the first CAN signal length respectively, and labeling is not performed simultaneously.
Further, the system further includes a display unit 73, where the display unit 73 is further specifically configured to import the second key information into an EXCEL file; and calling a com interface of the component object model to label the top of the EXCEL file for importing the second key information.
The implementation of the invention has the following beneficial effects:
according to the invention, the characteristics of the DBC files are classified, the key information of the DBC files is extracted according to a certain rule and sequence, and the key information of different DBC files is compared, so that the difference among the DBC files is found and displayed, the problems of low efficiency and high error rate of manually comparing the DBC files in the prior art are solved, the communication matrix DBC files are quickly compared, the difference among different DBC files is distinguished, and the version management and difference analysis of the automobile communication matrix are quickly realized.
One of ordinary skill will appreciate that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The foregoing is a further detailed description of the invention in connection with specific preferred embodiments and it is not intended to limit the invention to the specific embodiments described. For those skilled in the art to which the invention pertains, numerous simple deductions or substitutions may be made without departing from the spirit of the invention, which shall be deemed to belong to the scope of the invention.

Claims (10)

1. A communication matrix comparison method, the method comprising:
respectively reading a first DBC file and a second DBC file, wherein the first DBC file comprises a plurality of first CAN messages, and the second DBC file comprises a plurality of second CAN messages;
extracting first key information from each first CAN message, wherein the first key information comprises a first CAN message address, a first CAN message name corresponding to the first CAN message address, a first CAN message sending period and a first CAN message sending type;
extracting second key information from each second CAN message, wherein the second key information comprises a second CAN message address, a second CAN message name corresponding to the second CAN message address, a second CAN message sending period and a second CAN message sending type;
comparing the plurality of second CAN message addresses with the plurality of first CAN message addresses, marking a second CAN message corresponding to the second CAN message address and a first CAN message corresponding to the first CAN message address when the second CAN message address is different from the first CAN message address, prompting that the second DBC file deletes the first CAN message relative to the first DBC file in the first CAN message, and prompting that the second CAN message is a CAN message in which the second DBC file is added relative to the first DBC file in the second CAN message;
and when the second CAN message address is the same as the first CAN message address, correspondingly comparing the second CAN message name, the second CAN message sending period and the second CAN message sending type corresponding to the second CAN message address with the first CAN message name, the first CAN message sending period and the first CAN message sending type corresponding to the first CAN message address respectively, and marking when the second CAN message address is different from the first CAN message address.
2. The method of claim 1 wherein the first critical information further comprises a first CAN signal in the first CAN message, the first CAN signal comprising a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal; the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
comparing the plurality of second CAN signal names with the plurality of first CAN signal names, and marking a second CAN signal corresponding to the second CAN signal name and a first CAN signal corresponding to the first CAN signal name when the second CAN signal name is different from the first CAN signal name;
and when the second CAN signal name is the same as the first CAN signal name, correspondingly comparing a second CAN signal start bit, a second CAN signal length and other attributes of the second CAN signal corresponding to the second CAN signal name with a first CAN signal start bit, a first CAN signal length and other attributes of the first CAN signal corresponding to the first CAN signal name respectively, and labeling when the second CAN signal name is different from the first CAN signal name.
3. The method of claim 1 wherein the first critical information further comprises a first CAN signal in the first CAN message, the first CAN signal comprising a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal; the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
and comparing a second CAN message address, a second CAN signal start bit and a second CAN signal length corresponding to a second CAN signal with a first CAN message address, a first CAN signal start bit and a first CAN signal length corresponding to a first CAN signal respectively, only when the second CAN message address, the first CAN signal start bit and the first CAN signal length are the same, comparing a second CAN signal name and other attributes of the second CAN signal corresponding to the second CAN signal with a first CAN signal name and other attributes of the first CAN signal corresponding to the first CAN signal respectively, and labeling when the second CAN message address, the second CAN signal start bit and the second CAN signal length are different.
4. The method of claim 1, wherein the method further comprises:
importing the second key information into an EXCEL file, calling a component object model com interface to perform the labeling on the EXCEL file imported with the second key information, wherein the labeling specifically comprises: when the first CAN message address is different from the second CAN message address, marking a second CAN message corresponding to the second CAN message address as a CAN message of which the second DBC file is added relative to the first DBC file;
and when the first CAN message address is the same as the second CAN message address, correspondingly comparing the second CAN message name, the second CAN message sending period and the second CAN message sending type corresponding to the second CAN message address with the first CAN message name, the first CAN message sending period and the first CAN message sending type corresponding to the first CAN message address, and marking the modification difference of the second DBC file relative to the first DBC file CAN message when the modification difference is not the same.
5. The method of claim 2, wherein the method further comprises:
importing the second key information into an EXCEL file, calling a component object model com interface to perform the labeling on the EXCEL file imported with the second key information, wherein the labeling specifically comprises: when the second CAN signal name is different from the first CAN signal name, marking a second CAN signal corresponding to the second CAN signal name as a CAN signal added by the second DBC file relative to the first DBC file;
and when the second CAN signal name is the same as the first CAN signal name, correspondingly comparing a second CAN signal start bit, a second CAN signal length and other attributes of the second CAN signal corresponding to the second CAN signal name with a first CAN signal start bit, a first CAN signal length and other attributes of the first CAN signal corresponding to the first CAN signal name respectively, and marking the second CAN signal start bit, the second CAN signal length and other attributes of the second CAN signal as the modification difference of the second DBC file relative to the CAN signal of the first DBC file when the second CAN signal name is not the same as the first CAN signal name.
6. The method of claim 3, wherein the method further comprises:
importing the second key information into an EXCEL file, calling a com interface of the component object model to perform the labeling on the EXCEL file imported with the second key information, wherein the labeling specifically comprises the following steps: and only when the two CAN signals are the same, correspondingly comparing the name of the second CAN signal corresponding to the second CAN signal and other attributes of the second CAN signal with the name of the first CAN signal corresponding to the first CAN signal and other attributes of the first CAN signal respectively, and marking the difference as the modification difference of the second DBC file relative to the CAN signal of the first DBC file when the name of the second CAN signal and other attributes of the second CAN signal are not the same.
7. A communication matrix comparison system, the system comprising:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for respectively reading a first DBC file and a second DBC file, the first DBC file comprises a plurality of first CAN messages, and the second DBC file comprises a plurality of second CAN messages;
extracting first key information from each first CAN message, wherein the first key information comprises a first CAN message address, a first CAN message name corresponding to the first CAN message address, a first CAN message sending period and a first CAN message sending type;
extracting second key information from each second CAN message, wherein the second key information comprises a second CAN message address, a second CAN message name corresponding to the second CAN message address, a second CAN message sending period and a second CAN message sending type;
the comparison unit is used for comparing the plurality of second CAN message addresses with the plurality of first CAN message addresses, marking a second CAN message corresponding to the second CAN message address and a first CAN message corresponding to the first CAN message address when the second CAN message address is different from the first CAN message address, so as to prompt the second CAN message as a CAN message in which the second DBC file is added relative to the first DBC file by deleting the first CAN message relative to the first DBC file in the first CAN message, and prompt the second CAN message as a CAN message in which the second DBC file is added relative to the first DBC file in the second CAN message;
and when the second CAN message address is the same as the first CAN message address, correspondingly comparing a second CAN message name, a second CAN message sending period and a second CAN message sending type corresponding to the second CAN message address with a first CAN message name, a first CAN message sending period and a first CAN message sending type corresponding to the first CAN message address respectively, and marking when the second CAN message address is different from the first CAN message address.
8. The system of claim 7 wherein the first critical information further comprises a first CAN signal in the first CAN message, the first CAN signal comprising a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal;
the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
the comparison unit is also used for comparing a plurality of second CAN signal names with a plurality of first CAN signal names, and labeling a second CAN signal corresponding to the second CAN signal name and a first CAN signal name corresponding to the first CAN signal name when the second CAN signal name is different from the first CAN signal name;
and when the second CAN signal name is the same as the first CAN signal name, correspondingly comparing a second CAN signal start bit, a second CAN signal length and other attributes of the second CAN signal corresponding to the second CAN signal name with a first CAN signal start bit, a first CAN signal length and other attributes of the first CAN signal corresponding to the first CAN signal name respectively, and labeling when the second CAN signal name is not the same as the first CAN signal name.
9. The system of claim 7 wherein the first critical information further includes a first CAN signal in the first CAN message, the first CAN signal including a first CAN signal name, a first CAN signal start bit corresponding to the first CAN signal name, a first CAN signal length, and other attributes of the first CAN signal; the second key information also comprises a second CAN signal in the second CAN message, wherein the second CAN signal comprises a second CAN signal name, a second CAN signal start bit corresponding to the second CAN signal name, a second CAN signal length and other attributes of the second CAN signal;
the comparison unit is also used for correspondingly comparing a second CAN message address, a second CAN signal start bit and a second CAN signal length corresponding to the second CAN signal with a first CAN message address, a first CAN signal start bit and a first CAN signal length corresponding to the first CAN signal respectively, and correspondingly comparing a second CAN signal name and other attributes of the second CAN signal with a first CAN signal name and other attributes of the first CAN signal corresponding to the first CAN signal respectively only when the second CAN message address, the second CAN signal start bit and the second CAN signal length are the same as the first CAN signal address, the first CAN signal start bit and the first CAN signal length respectively, and labeling at different times.
10. The system of any of claims 7-9, further comprising a display unit for importing the second key information into an EXCEL file; and calling a com interface of the component object model to label the top of the EXCEL file for importing the second key information.
CN201810347892.0A 2018-04-18 2018-04-18 Communication matrix comparison method and system Active CN110390082B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810347892.0A CN110390082B (en) 2018-04-18 2018-04-18 Communication matrix comparison method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810347892.0A CN110390082B (en) 2018-04-18 2018-04-18 Communication matrix comparison method and system

Publications (2)

Publication Number Publication Date
CN110390082A CN110390082A (en) 2019-10-29
CN110390082B true CN110390082B (en) 2023-04-18

Family

ID=68282914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810347892.0A Active CN110390082B (en) 2018-04-18 2018-04-18 Communication matrix comparison method and system

Country Status (1)

Country Link
CN (1) CN110390082B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113364601B (en) * 2020-03-02 2022-06-10 北京新能源汽车股份有限公司 Signal change method and device for communication matrix platform library
CN112069005A (en) * 2020-08-28 2020-12-11 东风汽车集团有限公司 Method for detecting CAN communication function of whole vehicle
CN112612694A (en) * 2020-12-17 2021-04-06 广州橙行智动汽车科技有限公司 Data detection method and device and electronic equipment
CN113533827A (en) * 2021-07-30 2021-10-22 东风汽车集团股份有限公司 Vehicle static consumed current testing device, system and method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424194A (en) * 2013-08-20 2015-03-18 广州汽车集团股份有限公司 Method and system for comparing similarities and differences of CANdb (Controller Area Network) network file

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180062988A1 (en) * 2016-08-31 2018-03-01 Faraday&Future Inc. Ethernet communication of can signals

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424194A (en) * 2013-08-20 2015-03-18 广州汽车集团股份有限公司 Method and system for comparing similarities and differences of CANdb (Controller Area Network) network file

Also Published As

Publication number Publication date
CN110390082A (en) 2019-10-29

Similar Documents

Publication Publication Date Title
CN110390082B (en) Communication matrix comparison method and system
CN112714134B (en) CAN message analysis method, adaptation method, device, equipment and medium
CN109189704B (en) Universal bus interface adaptation method and device
CN110113247B (en) Rich media information receiving and sending system, sending and displaying method and terminal equipment
CN113612654B (en) Vehicle-mounted gateway function test method based on database
CN112104596B (en) Data access method and system for aggregating multiple Internet of vehicles communication protocols
CN113360301B (en) Message transmission system and method
CN111190962A (en) File synchronization method and device and local terminal
CN112347047A (en) Vehicle data file generation method and device
CN111414339B (en) File processing method, system, device, equipment and medium
CN103095644B (en) A kind of data content analytic method and device
CN111930890A (en) Information sending method and device, terminal equipment and storage medium
CN115167351B (en) Controller function updating method, system, vehicle and server
CN116521602A (en) Bus data transmission method and device and storage medium
CN106909331B (en) BMS parameter extension and display system
CN114827967A (en) Software updating method, Bluetooth device and storage medium
CN113824724A (en) Method and device for judging tampering of sensor data of intelligent substation and storage medium
CN116431119B (en) Software component port creation method and device, electronic equipment and storage medium
CN111538651A (en) Interface testing method, device, server and storage medium
CN113596097B (en) Log transmission method and electronic equipment
CN113961750A (en) Method and device for detecting repeated labels of configuration files of remote data concentrator
CN116756104A (en) DBC file update comparison method, device, electronic equipment and storage medium
CN104601340A (en) Inter-IDC (Internet Data Center) data transmission method, device and system
CN104869546A (en) Information processing method
CN104811541A (en) Terminal and network system

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211231

Address after: 511434 No. 36, Longying Road, Shilou Town, Panyu District, Guangzhou City, Guangdong Province

Applicant after: GAC AION New Energy Vehicle Co.,Ltd.

Address before: 23 / F, Chengyue building, 448-458 Dongfeng Middle Road, Yuexiu District, Guangzhou, Guangdong 510000

Applicant before: GUANGZHOU AUTOMOBILE GROUP Co.,Ltd.

GR01 Patent grant
GR01 Patent grant