CN114780519A - DBC file generation method, device, equipment and medium based on CAN communication - Google Patents

DBC file generation method, device, equipment and medium based on CAN communication Download PDF

Info

Publication number
CN114780519A
CN114780519A CN202210478013.4A CN202210478013A CN114780519A CN 114780519 A CN114780519 A CN 114780519A CN 202210478013 A CN202210478013 A CN 202210478013A CN 114780519 A CN114780519 A CN 114780519A
Authority
CN
China
Prior art keywords
communication
dbc
file
dbc file
definitions
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
Application number
CN202210478013.4A
Other languages
Chinese (zh)
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.)
Dongfeng Off Road Vehicle Co Ltd
Original Assignee
Dongfeng Off Road Vehicle 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 Dongfeng Off Road Vehicle Co Ltd filed Critical Dongfeng Off Road Vehicle Co Ltd
Priority to CN202210478013.4A priority Critical patent/CN114780519A/en
Publication of CN114780519A publication Critical patent/CN114780519A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2237Vectors, bitmaps or matrices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • 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
    • H04L12/40006Architecture of a communication node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • 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)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Bioethics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a DBC file generation method, a DBC file generation device, DBC file generation equipment and DBC file generation media based on CAN communication, wherein the DBC file generation method comprises the following steps: acquiring a CAN database file, analyzing the CAN database file, and acquiring various key elements; acquiring a communication matrix, and generating a communication data table according to the communication matrix, wherein the communication data table comprises a plurality of pieces of communication data; analyzing the communication data item by item according to the key elements to obtain a plurality of communication character strings; merging the communication character strings to obtain a DBC file; and verifying the integrity of the DBC file based on preset CAN software, and obtaining a target DBC file. The invention CAN improve the applicability of the DBC file generation method based on CAN communication and the reliability of the generated target DBC file.

Description

DBC file generation method, device, equipment and medium based on CAN communication
Technical Field
The invention relates to the technical field of vehicle-mounted controller development software, in particular to a DBC file generation method, device, equipment and medium based on CAN communication.
Background
With the increasing of CAN nodes in an automobile network, data in the network is more and more huge, so that in order to facilitate the design and maintenance of a finished automobile, a technical scheme of analyzing and managing the automobile CAN data by using a DBC file is provided in the prior art. Conventional implementations of forming DBC files include the following three: 1. and (4) creating a DBC through system modeling software, and forming a DBC file special for the current vehicle or parts according to the communication design document and the DBC format requirement. 2. And purchasing equipment capable of realizing analysis on the DBC database file of the automobile to read the CAN file. The prior art has the following technical problems: according to the technical scheme 1, messages are analyzed in detail one by one in upper computer software through a CAN communication protocol, a large amount of repeated work needs to be carried out in system modeling along with the increase of communication data volume, the development efficiency is low, and the error rate is improved. Technical scheme 2, the DBC database file of the automobile is compiled by purchasing equipment capable of analyzing the DBC database file of the automobile, the price is high, the configuration requirement is general, and a large amount of cost is still generated if customized development is to be realized.
In order to solve the above technical problems, an autonomous software development design is proposed in the prior art, for example: chinese patent application publication No. CN107132832A, entitled "DBC file parsing based on CAN communication and its program", proposes that each frame of message is transmitted and received by setting CAN communication parameter configuration, creating DBC file message, compiling DBC file parsing program, dynamically creating information (such as frame name, ID, signal name, signal value definition, etc.) contained in DBC. But the method only supports the definition of a standard frame and an extended frame of <8 bytes, and can not realize the compilation and analysis of the J1939 protocol multi-packet transmission, so that the applicability is not high. And the generated DBC file is not verified, resulting in unreliable generated DBC file.
Therefore, a DBC file generation method, apparatus, device and medium based on CAN communication are needed to solve the technical problem of low applicability and reliability of a generated DBC file in the prior art.
Disclosure of Invention
In view of this, it is necessary to provide a DBC file generation method, apparatus, device and medium based on CAN communication, so as to solve the technical problem in the prior art that the generated DBC file has low applicability and reliability.
On one hand, the invention provides a DBC file generation method based on CAN communication, which comprises the following steps:
acquiring a CAN database file, analyzing the CAN database file, and acquiring various key elements;
acquiring a communication matrix, and generating a communication data table according to the communication matrix, wherein the communication data table comprises a plurality of pieces of communication data;
analyzing the communication data item by item according to the key elements to obtain a plurality of communication character strings;
merging the communication character strings to obtain a DBC file;
and verifying the integrity of the DBC file based on preset CAN software, and obtaining a target DBC file.
In some possible implementations, the CAN database files include a standard frame data database file and an extended frame J1939 database file.
In some possible implementations, the plurality of key elements include version and new character definitions, baud rate definitions, network node definitions, message frame definitions, signal definitions, annotation definitions, attribute definitions, numerical table definitions, and J1939 protocol proprietary definitions.
In some possible implementations, the parsing the communication data item by item according to the key element to obtain a plurality of communication character strings includes:
establishing a variable-length initial character string;
analyzing the communication data according to the key elements, and acquiring version and new character definitions, baud rate definitions, network node definitions, message frame definitions, signal definitions, annotation definitions, attribute definitions, numerical table definitions and J1939 protocol proprietary definitions in the communication data;
and writing the version and new character definition, baud rate definition, network node definition, message frame definition, signal definition, annotation definition, attribute definition, numerical table definition and J1939 protocol proprietary definition in the communication data into the initial character string to obtain the communication character string.
In some possible implementations, the merging the communication strings to obtain the DBC file includes:
constructing a DBC empty file;
and writing the communication character strings into the empty DBC file and combining the communication character strings to obtain the DBC file.
In some possible implementations, the verifying the integrity of the DBC file based on the preset CAN software and obtaining the target DBC file include:
loading the DBC file based on preset CAN software, and judging whether loading is successful or not;
if the loading is successful, the DBC file is complete, and the DBC file is the target DBC file;
and if the loading is unsuccessful, correcting the communication matrix to obtain a corrected communication matrix, and obtaining the target DBC file based on the corrected communication matrix.
In some possible implementation manners, the DBC file generation method based on CAN communication further includes:
a CAN network simulation interface is established, the target DBC file is loaded based on the CAN network simulation interface, network simulation is carried out, and a network simulation result and/or a simulation message are/is generated;
determining the integrity of the target DBC file according to the simulation message and the communication matrix;
and verifying the network performance of the CAN network according to the network simulation result.
On the other hand, the invention also provides a DBC file generating device based on CAN communication, which comprises:
the database file analysis unit is used for acquiring the CAN database file and analyzing the CAN database file to acquire various key elements;
the communication matrix processing unit is used for acquiring a communication matrix and generating a communication data table according to the communication matrix, wherein the communication data table comprises a plurality of pieces of communication data;
the communication data analysis unit is used for analyzing the communication data item by item according to the key elements to obtain a plurality of communication character strings;
the DBC file generating unit is used for combining the communication character strings to obtain a DBC file;
and the integrity verification unit is used for verifying the integrity of the DBC file based on preset CAN software and acquiring a target DBC file.
In another aspect, the present invention also provides an electronic device comprising a memory and a processor, wherein,
the memory is used for storing programs;
the processor is coupled to the memory, and configured to execute the program stored in the memory to implement the steps of the DBC file generation method based on CAN communication in any one of the foregoing implementation manners.
On the other hand, the present invention further provides a computer-readable storage medium for storing a computer-readable program or instruction, where the program or instruction, when executed by a processor, CAN implement the steps in the DBC file generation method based on CAN communication in any one of the above implementation manners.
The beneficial effects of adopting the above embodiment are: the DBC file generation method based on CAN communication obtains a plurality of key elements by obtaining a CAN database file and analyzing the CAN database file, then analyzes communication data generated by a communication matrix one by one according to the key elements to obtain a plurality of communication character strings, and then combines the communication character strings to obtain the DBC file. As the CAN database file is analyzed to obtain various key elements, the analysis of the CAN databases in different template formats CAN be realized, the DBC file CAN be established on the database structures of the extended frames and the standard frames, and the applicability of the DBC file generation method based on CAN communication is improved.
Furthermore, the integrity of the DBC file is verified based on the preset CAN software, the target DBC file is obtained, the reliability of the target DBC file CAN be ensured, and the subsequent development efficiency of the whole vehicle network CAN be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an embodiment of a DBC file generation method based on CAN communication according to the present invention;
FIG. 2 is a schematic flow chart of one embodiment of S103 of FIG. 1;
FIG. 3 is a flowchart illustrating one embodiment of S104 of FIG. 1 according to the present invention;
FIG. 4 is a schematic flow chart of one embodiment of S105 of FIG. 1;
FIG. 5 is a flowchart illustrating an embodiment of performing simulation verification on a target DBC file according to the present invention;
fig. 6 is a schematic structural diagram of an embodiment of a DBC file generating device based on CAN communication according to the present invention;
fig. 7 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It should be apparent that the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
It should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this disclosure illustrate operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flow diagrams may be performed out of order, and that steps without logical context may be performed in reverse order or concurrently. In addition, one skilled in the art, under the direction of the present disclosure, may add one or more other operations to the flowchart, or may remove one or more operations from the flowchart.
In the description of the embodiment of the present invention, "and/or" describes an association relationship of an association object, which means that three relationships may exist, for example: a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone.
Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor systems and/or microcontroller systems.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
The embodiment of the invention provides a DBC file generation method, a DBC file generation device, DBC file generation equipment and DBC file generation media based on CAN communication.
The CAN communication is a technology for performing communication based on a Controller Area Network (CAN). CAN is a serial communication protocol of ISO international standardization, and is increasingly widely applied to the fields of automobile electronics and the like due to excellent anti-interference capability and extremely strong error detection and processing capability.
DBC (database CAN) files refer to CAN database files.
Fig. 1 is a schematic flowchart of an embodiment of a DBC file generation method based on CAN communication according to the present invention, and as shown in fig. 1, the DBC file generation method based on CAN communication includes:
s101, acquiring a CAN database file, analyzing the CAN database file, and acquiring various key elements;
s102, acquiring a communication matrix, and generating a communication data table (DataTable) according to the communication matrix, wherein the communication data table comprises a plurality of pieces of communication data;
s103, analyzing the communication data item by item according to the key elements to obtain a plurality of communication character strings;
s104, combining the communication character strings to obtain a DBC file;
and S105, verifying the integrity of the DBC file based on the preset CAN software, and obtaining a target DBC file.
Compared with the prior art, the DBC file generation method based on CAN communication obtains various key elements by obtaining the CAN database file and analyzing the CAN database file, then analyzes the communication data generated by the communication matrix one by one according to the key elements to obtain a plurality of communication character strings, and then merges the communication character strings to obtain the DBC file. The CAN database file is analyzed to obtain various key elements, and the CAN databases in different template formats CAN be analyzed, so that the DBC file CAN be established for the database structures of the extended frames and the standard frames, and the applicability of the DBC file generation method based on CAN communication is improved.
Furthermore, the integrity of the DBC file is verified through the set CAN software based on the presetting, the target DBC file is obtained, the reliability of the target DBC file CAN be ensured, and the subsequent development efficiency of the whole vehicle network CAN be improved.
In an embodiment of the present invention, the CAN database file in step S101 includes, but is not limited to, a standard frame database file and an extended frame J1939 database file.
According to the embodiment of the invention, the DBC file corresponding to the J1939 database file of the commercial vehicle CAN be generated by setting the CAN database file to comprise the standard frame data database file and the expansion frame J1939 database file, so that the applicability of the DBC file generation method based on CAN communication is improved.
Wherein, the J1939 database file refers to a database file conforming to the J1939 multi-packet communication protocol.
It should be understood that: the CAN database file may also include other database files other than the standard frame database file and the extended frame J1939 database file, such as: database files generated by the DBediter customization of the CANoe software, and the like.
In an embodiment of the present invention, the key elements in step S101 include version and new character definitions, baud rate definitions, network node definitions, message frame definitions, signal definitions, annotation definitions, attribute definitions, numerical table definitions, and J1939 protocol proprietary definitions. Specifically, the method comprises the following steps:
1. version and new character definition
The format of the version is as follows: version ", which may be empty or defined by the user himself;
the format of the new character is as follows: NS _, this information will be automatically generated in the process of generating DBC file, and it is only necessary to default.
2. Baud rate definition
The format is as follows: BS _ [ baudrate: BTR1, BTR2 ];
wherein BS _ is a keyword used for defining the baud rate of the CAN network; [] The content is represented as an optional part and may be omitted.
3. Network node definition
The format is as follows: BU _: nodename1 Nodename2 Nodename3 … …;
BU _ is a key word and represents a network node, and Nodename1 and Nodename2 in the format represent defined network node names which are defined by users.
4. Message frame definition
The format is as follows: BO _ MessageId (10-ary numerical representation) MessageName MessageSize Transmitter;
respectively represent: key _ message ID, message name, number of bytes in message data field, network node of message.
5. Signal definition
The format is as follows: SG _ SignalName: StartButt | SignalSize @ ByteOrderValueType (Factor, Offset) [ Min | Max ] Unit Receiver;
respectively represent: the name, start bit, signal length @ byte order, value type, offset, minimum and maximum values of the key _ signal, unit of signal, receiving node;
if one signal is: SG _ HUD _ Brightness Lv:15|4@0+ (1,0) [0|15] "lv" ACU, AVNT denotes a signal defined as HUD _ Brightness Lv, whose start bit is the 15 th bit and whose length is 4 bits; the signal is in Motorola format, and the numerical type is an unsigned type number; factor 1, offset 0; the signal value range is 0 to 15; the signal unit is a character string 'lv'; the signal receiving nodes are two nodes of ACU and AVNT.
6. Annotation definitions
The format is as follows: CM _ Object MessageId/NodeName "Comment";
respectively represent: keyword _ annotated object type, annotated object, annotated text information.
7. Attribute definition
The system comprises two formats, namely a first format and a second format;
the first format is as follows: BA _ DEF _ Object AttributeNameValueType Min Max;
respectively represent: the object type defined by the keyword _ attribute, the attribute name for definition, the type of the attribute value and the top and bottom most values of the attribute value;
the second format is as follows: BA _ DEF _ DEF _ AttributeNameDefaultValue;
respectively represent: initial value of key _ attribute.
8. Definition of numerical table
The format is as follows: VAL _ MessageIdSignalName N "DefineN" … … 0 "Define 0";
respectively represent: the definition of key word-value table, the message ID, signal name and value table content of the signal.
9. J1939 protocol specific definition
The format is as follows: BA _ DEF _ SG _, BA _ DEF _ BO _, BA _ DEF _ BU _, BA _ DEF _
Respectively represent: a signal attribute, a message frame attribute, a network node attribute, a first format attribute, and a second format attribute.
In some embodiments of the present invention, the communication matrix is in an Excel format, and step S102 specifically includes: c # engineering is built by using a programming tool Visual Studio, a communication matrix is imported, and a communication data table (DataTable) is generated.
The communication data table represents a table of data in the memory, and the DataTable includes a plurality of data rows (DataRow) and data columns (DataColumn), and data in the DataTable can be viewed and operated through the DataRow and DataColumn.
In some embodiments of the present invention, each piece of communication data includes multiple lines, and step S103 specifically includes: each line of each piece of communication data is parsed.
In some embodiments of the present invention, as shown in fig. 2, step S103 comprises:
s201, establishing a variable-length initial character string;
s202, analyzing communication data according to key elements, and acquiring version and new character definitions, baud rate definitions, network node definitions, message frame definitions, signal definitions, annotation definitions, attribute definitions, numerical table definitions and J1939 protocol proprietary definitions in the communication data;
s203, writing the version and new character definition, the baud rate definition, the network node definition, the message frame definition, the signal definition, the annotation definition, the attribute definition, the numerical value table definition and the J1939 protocol proprietary definition in the communication data into the initial character string to obtain a communication character string.
In some embodiments of the present invention, as shown in fig. 3, step S104 comprises:
s301, constructing a DBC empty file;
and S302, writing the communication character strings into a DBC empty file and combining to obtain a DBC file.
Since the generated target DBC file needs to be readable by the CAN software, in order to avoid the technical problem that the CAN software cannot read the generated target DBC file, which results in the target DBC file being unavailable, in some embodiments of the present invention, as shown in fig. 4, step S105 includes:
s401, loading a DBC file based on preset CAN software, and judging whether loading is successful;
s402, if the loading is successful, the DBC file is complete, and the DBC file is a target DBC file;
and S403, if the loading is unsuccessful, correcting the communication matrix to obtain a corrected communication matrix, and obtaining a target DBC file based on the corrected communication matrix.
According to the embodiment of the invention, the DBC file is loaded based on the preset CAN software, when the loading is successful, the DBC file is the target DBC file, and when the loading is unsuccessful, the communication matrix is corrected, the target DBC file is obtained again, so that the reliability of the generated DBC file is ensured.
The CAN software in step S401 may be any one of CAN software in the prior art, and is not limited herein.
The step S403 of obtaining the target DBC file based on the modified communication matrix may specifically be: the modified communication matrix is taken as the communication matrix and steps S102-S105 are repeated.
Further, steps S101 to S105 implement generation of a target DBC file, and during an actual network development process, it is further required to confirm whether the generated target DBC file supports a network simulation function, and further verify integrity of the target DBC file through network simulation, so in some embodiments of the present invention, as shown in fig. 5, the DBC file generation method based on CAN communication further includes:
s501, establishing a CAN network simulation interface, loading a target DBC file based on the CAN network simulation interface, performing network simulation, and generating a network simulation result and/or a simulation message;
s502, determining the integrity of a target DBC file according to the simulation message and the communication matrix;
s503, verifying the network performance of the CAN network according to the network simulation result.
According to the embodiment of the invention, the integrity and the reliability of the target DBC file can be further ensured by determining the integrity of the target DBC file according to the simulation message and the communication matrix. According to the embodiment of the invention, the network performance of the CAN network is verified according to the network simulation result, the squaring of the CAN network CAN be realized, and the subsequent whole vehicle network development efficiency is improved.
Specifically, step S501 specifically includes: establishing a CAN network simulation interface, loading a currently generated target DBC file for network simulation, synchronizing all node data contents on a network segment defined by the target DBC file on the CAN network simulation interface, and simultaneously loading a simulation dll file in a protocol type in the attribute of the target DBC file. After configuration is completed, the CAN software loaded with J1939 configuration CAN directly click simulation operation, the software CAN combine a plurality of packets of messages into one packet according to a J1939 protocol for analysis, and a CAN network simulation interface CAN generate a network simulation result and/or a simulation message according to the content defined by a target DBC file.
Specifically, step S502 is: and placing the simulation message and the communication matrix on an excel interface, comparing the simulation message and the communication matrix through a preset comparison algorithm, identifying the difference between the communication matrix and the simulation message, and verifying the integrity of the target DBC file through the difference.
Specifically, the network simulation result includes, but is not limited to, a load rate, a period deviation, and the like of the CAN network, and the network performance of the CAN network CAN be obtained through the load rate, the period deviation, and the like of the CAN network.
In order to better implement the DBC file generation method based on CAN communication in the embodiment of the present invention, on the basis of the DBC file generation method based on CAN communication, as shown in fig. 6, correspondingly, an embodiment of the present invention further provides a DBC file generation apparatus based on CAN communication, where the DBC file generation apparatus 600 based on CAN communication includes:
the database file analysis unit 601 is used for acquiring a CAN database file, analyzing the CAN database file and acquiring various key elements;
a communication matrix processing unit 602, configured to obtain a communication matrix, and generate a communication data table according to the communication matrix, where the communication data table includes a plurality of pieces of communication data;
a communication data parsing unit 603, configured to parse the communication data item by item according to the key elements, to obtain a plurality of communication character strings;
a DBC file generating unit 604, configured to merge multiple communication character strings to obtain a DBC file;
and an integrity verification unit 605, configured to verify integrity of the DBC file based on preset CAN software, and obtain a target DBC file.
The DBC file generation apparatus 600 based on CAN communication provided in the foregoing embodiment CAN implement the technical solutions described in the foregoing DBC file generation method based on CAN communication, and the specific implementation principles of the modules or units may refer to the corresponding contents in the foregoing DBC file generation method based on CAN communication, which are not described herein again.
As shown in fig. 7, the present invention further provides an electronic device 700. The electronic device 700 includes a processor 701, a memory 702, and a display 703. Fig. 7 shows only some of the components of the electronic device 700, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The processor 701 may be a Central Processing Unit (CPU), a microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 702 or Processing data, for example, the DBC file generation method based on CAN communication in the present invention.
In some embodiments, processor 701 may be a single server or a group of servers. The server groups may be centralized or distributed. In some embodiments, the processor 701 may be local or remote. In some embodiments, processor 701 may be implemented in a cloud platform. In some embodiments of the invention, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, a multi-cloud, and the like, or any combination thereof.
The storage 702 may in some embodiments be an internal storage unit of the electronic device 700, such as a hard disk or a memory of the electronic device 700. The memory 702 may also be an external storage device of the electronic device 700 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc., provided on the electronic device 700.
Further, the memory 702 may also include both internal storage units and external storage devices of the electronic device 700. The memory 702 is used to store application software and various data for installing the electronic device 700.
The display 703 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like in some embodiments. The display 703 is used for displaying information at the electronic device 700 and for displaying a visual user interface. The components 701 and 703 of the electronic device 700 communicate with each other via a system bus.
In some embodiments of the present invention, when the processor 701 executes the DBC file generation program based on CAN communication in the memory 702, the following steps may be implemented:
acquiring a CAN database file, analyzing the CAN database file, and acquiring various key elements;
acquiring a communication matrix, and generating a communication data table according to the communication matrix, wherein the communication data table comprises a plurality of pieces of communication data;
analyzing the communication data item by item according to the key elements to obtain a plurality of communication character strings;
merging a plurality of communication character strings to obtain a DBC file;
and verifying the integrity of the DBC file based on preset CAN software, and obtaining a target DBC file.
It should be understood that: when the processor 701 executes the DBC file generation program based on CAN communication in the storage 702, other functions may be implemented besides the above functions, which may be specifically referred to in the description of the corresponding method embodiment.
Further, the type of the mentioned electronic device 700 is not specifically limited in the embodiments of the present invention, and the electronic device 700 may be a portable electronic device such as a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a wearable device, and a laptop computer (laptop). Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices that carry an IOS, android, microsoft, or other operating system. The portable electronic device may also be other portable electronic devices such as laptop computers (laptop) with touch sensitive surfaces (e.g., touch panels), etc. It should also be understood that in other embodiments of the present invention, the electronic device 700 may not be a portable electronic device, but may be a desktop computer having a touch-sensitive surface (e.g., a touch pad).
Accordingly, the present application further provides a computer-readable storage medium, where the computer-readable storage medium is used to store a computer-readable program or instruction, and when the program or instruction is executed by a processor, the steps or functions in the DBC file generation method based on CAN communication provided by the foregoing method embodiments CAN be implemented.
Those skilled in the art will appreciate that all or part of the processes of the methods of the above embodiments may be implemented by instructing relevant hardware (such as a processor, a controller, etc.) by a computer program, and the computer program may be stored in a computer readable storage medium. The computer readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory.
The DBC file generation method, device, equipment and medium based on CAN communication provided by the present invention are introduced in detail, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as limiting the present invention.

Claims (10)

1. A DBC file generation method based on CAN communication is characterized by comprising the following steps:
acquiring a CAN database file, analyzing the CAN database file, and acquiring various key elements;
acquiring a communication matrix, and generating a communication data table according to the communication matrix, wherein the communication data table comprises a plurality of pieces of communication data;
analyzing the communication data item by item according to the key elements to obtain a plurality of communication character strings;
merging the communication character strings to obtain a DBC file;
and verifying the integrity of the DBC file based on preset CAN software, and obtaining a target DBC file.
2. The CAN communication-based DBC file generation method of claim 1, wherein the CAN database file includes a standard frame database file and an extended frame J1939 database file.
3. The CAN communication-based DBC file generation method of claim 1, wherein the plurality of key elements include version and new character definitions, baud rate definitions, network node definitions, message frame definitions, signal definitions, annotation definitions, attribute definitions, numerical table definitions, and J1939 protocol proprietary definitions.
4. The DBC file generation method according to claim 1, wherein the parsing the communication data item by item according to the key elements to obtain a plurality of communication strings includes:
establishing an initial character string with variable length;
analyzing the communication data according to the key elements, and acquiring version and new character definitions, baud rate definitions, network node definitions, message frame definitions, signal definitions, annotation definitions, attribute definitions, numerical table definitions and J1939 protocol proprietary definitions in the communication data;
and writing the version and new character definition, baud rate definition, network node definition, message frame definition, signal definition, annotation definition, attribute definition, numerical table definition and J1939 protocol proprietary definition in the communication data into the initial character string to obtain the communication character string.
5. The DBC file generation method based on CAN communication according to claim 1, wherein the merging the plurality of communication strings to obtain the DBC file comprises:
constructing a DBC empty file;
and writing the communication character strings into the DBC empty file and combining to obtain the DBC file.
6. The DBC file generation method based on CAN communication of claim 1, wherein the verifying the integrity of the DBC file based on the preset CAN software and obtaining the target DBC file comprises:
loading the DBC file based on preset CAN software, and judging whether loading is successful or not;
if the loading is successful, the DBC file is complete, and the DBC file is the target DBC file;
and if the loading is unsuccessful, correcting the communication matrix to obtain a corrected communication matrix, and obtaining the target DBC file based on the corrected communication matrix.
7. The DBC file generation method based on CAN communication according to claim 1, further comprising:
a CAN network simulation interface is established, the target DBC file is loaded based on the CAN network simulation interface, network simulation is carried out, and a network simulation result and/or a simulation message are/is generated;
determining the integrity of the target DBC file according to the simulation message and the communication matrix;
and verifying the network performance of the CAN network according to the network simulation result.
8. A DBC file generating device based on CAN communication is characterized by comprising:
the CAN database file analyzing unit is used for acquiring a CAN database file, analyzing the CAN database file and acquiring various key elements;
the communication matrix processing unit is used for acquiring a communication matrix and generating a communication data table according to the communication matrix, wherein the communication data table comprises a plurality of pieces of communication data;
the communication data analysis unit is used for analyzing the communication data item by item according to the key elements to obtain a plurality of communication character strings;
the DBC file generating unit is used for combining the communication character strings to obtain a DBC file;
and the integrity verification unit is used for verifying the integrity of the DBC file based on preset CAN software and acquiring a target DBC file.
9. An electronic device comprising a memory and a processor, wherein,
the memory is used for storing programs;
the processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps in the CAN communication based DBC file generation method of any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer-readable program or instructions, which when executed by a processor, CAN implement the steps of the DBC file generation method based on CAN communication according to any one of claims 1 to 7.
CN202210478013.4A 2022-04-27 2022-04-27 DBC file generation method, device, equipment and medium based on CAN communication Pending CN114780519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210478013.4A CN114780519A (en) 2022-04-27 2022-04-27 DBC file generation method, device, equipment and medium based on CAN communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210478013.4A CN114780519A (en) 2022-04-27 2022-04-27 DBC file generation method, device, equipment and medium based on CAN communication

Publications (1)

Publication Number Publication Date
CN114780519A true CN114780519A (en) 2022-07-22

Family

ID=82435838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210478013.4A Pending CN114780519A (en) 2022-04-27 2022-04-27 DBC file generation method, device, equipment and medium based on CAN communication

Country Status (1)

Country Link
CN (1) CN114780519A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115542882A (en) * 2022-09-30 2022-12-30 东风汽车股份有限公司 Controller interface configuration method and device
CN117201304A (en) * 2023-08-30 2023-12-08 赛力斯汽车有限公司 Communication matrix updating method, device, computer equipment and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115542882A (en) * 2022-09-30 2022-12-30 东风汽车股份有限公司 Controller interface configuration method and device
CN115542882B (en) * 2022-09-30 2024-02-27 东风汽车股份有限公司 Controller interface configuration method and device
CN117201304A (en) * 2023-08-30 2023-12-08 赛力斯汽车有限公司 Communication matrix updating method, device, computer equipment and medium

Similar Documents

Publication Publication Date Title
CN112765271B (en) Block chain transaction index storage method and device, computer equipment and medium
CN108492195B (en) Rule engine package parameter generalization method, equipment and storage medium
CN111414407A (en) Data query method and device of database, computer equipment and storage medium
CN114780519A (en) DBC file generation method, device, equipment and medium based on CAN communication
CN114528044B (en) Interface calling method, device, equipment and medium
CN105550252A (en) File positioning method and device and electronic equipment
WO2023005163A1 (en) Method for loading application page, storage medium and related device thereof
CN112905933A (en) Page jump method and device, electronic equipment and storage medium
CN113204345A (en) Page generation method and device, electronic equipment and storage medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
EP4095686A2 (en) Method for switching skin of mini-program page, and electronic device
CN115795211A (en) Page display method, device, system, equipment and storage medium
CN112181542A (en) Function calling method and device, electronic equipment and storage medium
WO2023217086A1 (en) Resource file updating method and apparatus, and device and readable storage medium
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN113329096B (en) Message transmission method and device, electronic equipment and storage medium
CN114615325A (en) Message pushing method and device, computer equipment and storage medium
CN114968822A (en) Interface testing method and device, computer equipment and storage medium
CN115409002A (en) Method and device for obtaining report, electronic equipment and computer storage medium
CN114626352A (en) Report automatic generation method and device, computer equipment and storage medium
CN112394920B (en) Application software development method, platform and electronic equipment
CN114266072A (en) Authority distribution control method and device, electronic equipment and storage medium
CN114124475A (en) Network asset port scanning and service identification method and device
CN113986995A (en) Request distribution method and device, storage medium and electronic equipment
CN114143308A (en) File uploading information processing method and device, computer 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