CN113542381B - Message frame processing method and device - Google Patents

Message frame processing method and device Download PDF

Info

Publication number
CN113542381B
CN113542381B CN202110764559.1A CN202110764559A CN113542381B CN 113542381 B CN113542381 B CN 113542381B CN 202110764559 A CN202110764559 A CN 202110764559A CN 113542381 B CN113542381 B CN 113542381B
Authority
CN
China
Prior art keywords
message frame
signal
sent
calibrated
message
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
CN202110764559.1A
Other languages
Chinese (zh)
Other versions
CN113542381A (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.)
Guangzhou Xiaopeng Autopilot Technology Co Ltd
Original Assignee
Guangzhou Xiaopeng Autopilot Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Xiaopeng Autopilot Technology Co Ltd filed Critical Guangzhou Xiaopeng Autopilot Technology Co Ltd
Priority to CN202110764559.1A priority Critical patent/CN113542381B/en
Publication of CN113542381A publication Critical patent/CN113542381A/en
Application granted granted Critical
Publication of CN113542381B publication Critical patent/CN113542381B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • 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
    • H04L12/40013Details regarding a bus controller
    • 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/03Protocol definition or specification 
    • 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/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • 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)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Small-Scale Networks (AREA)

Abstract

The embodiment of the invention provides a message frame processing method and a device, wherein the method comprises the following steps: the database file DBC template comprises a plurality of message frames, wherein the message frames comprise a plurality of signal marks and a page number mark; writing the signal to be calibrated into a controller area network bus access programming language CAPL script; determining a message frame to be sent through CAPL scripts, sequentially assigning values of signals to be calibrated to a plurality of signal marks of the message frame to be sent until all the signal marks in the message frame to be sent are assigned, and configuring page number values according to the sequence of page number marks of the message frame to be sent so as to complete the encapsulation of the message frame; after each completion of the encapsulation of the message frame, the encapsulated message frame is sent to the electronic control unit ECU of the vehicle. The embodiment of the invention can carry out signal transmission and calibration on the message frames with the same address without limitation, thereby greatly improving the efficiency of online calibration and reducing the flow steps of online calibration.

Description

Message frame processing method and device
Technical Field
The present invention relates to the field of message processing technologies, and in particular, to a method and an apparatus for processing a message frame.
Background
CAN (Controller Area Network ) is an ISO internationally standardized serial communication protocol, widely used in the current vehicle industry.
DBC (Database Can) is a database file of CAN, and in the DBC file, the information definition of CAN communication is very complete and clear, and CAN network communication is performed according to the description of the DBC file.
If the values of some parameters cannot be confirmed, the parameters are required to be used as signals to be sent to an electronic control unit ECU, and the calibration step of the signals is completed, so that the values can be confirmed. When the on-line calibration is performed by using the calibration tool, only one DBC can be loaded at a time for calibration, and each DBC comprises a plurality of message frames with different addresses, wherein the maximum length of each message frame with different addresses is 64bytes, namely, the message frame with each address in one DBC accommodates 64bytes at most, if signals exceeding 64bytes need to be sent from the same address to the ECU, the next DBC needs to be loaded, and the rest signals need to be sent, so that the signal calibration step can be completed. Therefore, the on-line calibration of the traditional tool greatly limits the signal transmission and calibration of the message frame with the same address, and greatly reduces the on-line calibration efficiency.
Disclosure of Invention
In view of the foregoing, embodiments of the present invention have been developed to provide a message frame processing method that overcomes, or at least partially solves, the foregoing problems.
The embodiment of the invention also provides a message frame processing device so as to ensure the implementation of the method.
In order to solve the above problems, an embodiment of the present invention discloses a message frame processing method, which is applied to an electronic device, where the electronic device is configured with a database file DBC template and a controller area network bus access programming language CAPL script, the DBC template includes a plurality of message frames, the message frames include a plurality of signal marks and a page mark, and the electronic device is communicatively connected with an electronic control unit ECU of a vehicle, and the method includes:
Writing a signal to be calibrated into the CAPL script;
Determining a message frame to be sent through the CAPL script, sequentially assigning the value of the signal to be calibrated to the signal marks of the message frame to be sent until all the signal marks in the message frame to be sent are assigned, and sequentially configuring the page number values for the page number marks of the message frame to be sent to finish the encapsulation of the message frame;
And after the encapsulation of the message frame is completed each time, sending the encapsulated message frame to the ECU.
Optionally, the message frame has a maximum length value, and the plurality of signal marks and the one page mark of the message frame are configured by:
Acquiring preset signal length information; the signal length information comprises a signal length value of the signal to be calibrated;
And calculating the ratio of the maximum length value of the message frame to the signal length value of the signal to be calibrated, and determining the ratio as the total number of the signal marks and the page marks of the message frame.
Optionally, the message frame has a corresponding address, and the determining, by the CAPL, the message frame to be sent includes:
And determining a transmitting address for transmitting the signal to be calibrated to the ECU through the CAPL script, and determining a message frame corresponding to the transmitting address as a message frame to be transmitted.
Optionally, said configuring a page value for said page tags of said message frames to be sent in order includes:
And configuring page values for the page marks of the message frames to be sent in a gradually increasing order.
Optionally, after each time of encapsulation of the message frame, sending the encapsulated message frame to the electronic control unit ECU, including:
and after the encapsulation of the message frame is completed each time, transmitting the encapsulated message frame from the transmitting address to the ECU.
Optionally, the method further comprises:
and when receiving response information returned by the ECU aiming at the sending address, determining that all signals to be calibrated are received by the ECU.
The embodiment of the invention also discloses a message frame processing device which is applied to electronic equipment, wherein the electronic equipment is configured with a database file DBC template and a controller area network bus access programming language CAPL script, the DBC template comprises a plurality of message frames, the message frames comprise a plurality of signal marks and a page number mark, and the electronic equipment is in communication connection with an electronic control unit ECU of a vehicle, and the device comprises:
The writing module is used for writing the signal to be calibrated in the CAPL script;
the packaging module is used for determining a message frame to be sent through the CAPL script, sequentially assigning the values of the signals to be calibrated to the signal marks of the message frame to be sent until all the signal marks in the message frame to be sent are assigned, and sequentially configuring the page number values for the page number marks of the message frame to be sent so as to complete packaging of the message frame;
and the sending module is used for sending the encapsulated message frame to the ECU after the encapsulation of the message frame is completed each time.
Optionally, the message frame has a maximum length value, and the plurality of signal marks and one page mark of the message frame are configured by:
The acquisition module is used for acquiring preset signal length information; the signal length information comprises a signal length value of the signal to be calibrated;
And the calculating module is used for calculating the ratio of the maximum length value of the message frame to the signal length value of the signal to be calibrated and determining the ratio as the total number of the signal marks and the page marks of the message frame.
Optionally, the message frame has a corresponding address, and the encapsulation module includes:
And the message frame to be sent determines a sending address for sending the signal to be calibrated to the ECU through the CAPL script, and determines a message frame corresponding to the sending address as a message frame to be sent.
Optionally, the packaging module includes:
A page value configuration sub-module, configured to configure a page value for the page marks of the message frame to be sent in an order of gradually increasing.
Optionally, the sending module includes:
And the sending sub-module is used for sending the encapsulated message frame from the sending address to the ECU after the encapsulation of the message frame is completed each time.
Optionally, the apparatus further comprises:
And the response information receiving module is used for determining that the ECU has received all signals to be calibrated when receiving response information returned by the ECU aiming at the sending address.
The embodiment of the invention also discloses an electronic device, which comprises: a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor implements the steps of the message frame processing method as described above.
The embodiment of the invention also discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program which realizes the steps of the message frame processing method when being executed by a processor.
Compared with the prior art, the embodiment of the invention has the following advantages:
In the embodiment of the invention, a database file DBC template and a controller local area network bus access programming language CAPL script are configured; wherein the DBC template comprises a plurality of message frames, the message frames comprising a plurality of signal marks and a page number mark; writing the signal to be calibrated into CAPL scripts; determining a message frame to be sent through CAPL scripts, sequentially assigning values of signals to be calibrated to a plurality of signal marks of the message frame to be sent until all the signal marks in the message frame to be sent are assigned, and configuring page number values according to the sequence of page number marks of the message frame to be sent so as to complete the encapsulation of the message frame; after each completion of the encapsulation of the message frame, the encapsulated message frame is sent to the electronic control unit ECU of the vehicle. According to the embodiment of the invention, by combining the DBC template and CAPL script, the signal transmission and calibration can be carried out on the message frame with the same address without limitation by only loading one DBC template, so that the efficiency of online calibration is greatly improved, and the flow steps of online calibration are reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of steps of a message frame processing method according to an embodiment of the present invention;
FIG. 2 is an interactive schematic diagram of a message frame processing procedure provided by an embodiment of the present invention;
Fig. 3 is a block diagram of a message frame processing apparatus according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the development primary stage of the CAN network, firstly, an engineering problem is faced, for example, the development of the ECU network of the vehicle is mainly: demand analysis, functional modeling, simulation analysis, partial realization and system realization. After the system is realized, the system is required to be tested or calibrated, and the calibration tool can be used for carrying out online calibration on some control parameters to be calibrated under the condition that the controller runs in real time by utilizing the existing calibration protocol, so that some errors of concept definition are checked and corrected in time, and the network design can be optimized.
Typically, each DBC includes a plurality of message frames, each message frame having a corresponding address, the maximum length of the message frame for each address being 64 bytes.
Assuming that each signal has a length of 2bytes, there are 128bytes of signals to be sent from address a to the ECU of the vehicle, that is, there are 64 signals to be sent from address a to the ECU of the vehicle. When the on-line calibration is performed by using the calibration tool, only one DBC can be loaded at a time for calibration. When the first DBC is marked, the message frame of address a can only carry 64bytes of signals, i.e. 32 signals, then the other 32 signals need to load the next DBC. Therefore, the on-line calibration of the traditional tool greatly limits the signal transmission and calibration of the message frame with the same address, and greatly reduces the on-line calibration efficiency.
Referring to fig. 1, a step flowchart of a message frame processing method provided by an embodiment of the present invention is shown and applied to an electronic device, where the electronic device is configured with a database file DBC template and a controller area network bus access programming language CAPL script, the DBC template includes a plurality of message frames, the message frames include a plurality of signal marks and a page number mark, and the electronic device is communicatively connected with an electronic control unit ECU of a vehicle, and the method specifically may include the following steps:
And step 101, writing a signal to be calibrated in the CAPL script.
For a better understanding of the embodiments of the present invention, CAN, DBC, CAPL, ECU related to the embodiments of the present invention are described in detail below:
CAN (Controller Area Network ) is an ISO internationally standardized serial communication protocol. In the current automotive industry, various electronic control systems have been developed for safety, comfort, convenience, low pollution, and low cost. Since the types of data used for communication between these systems and the requirements for reliability are not the same, the number of wiring harnesses is increased in many cases where the system is constituted by a plurality of buses. To accommodate the need for "reducing the number of wiring harnesses", "high-speed communication of large amounts of data through a plurality of LANs (local area networks)", CAN communication protocols for automobiles are emerging.
DBC (Database Can) is a database file of the CAN, in which the information definition of CAN communication is very complete and clear, and CAN network communication is performed according to the description of the file, so that the DBC file has very strong effect, and the node controller of the whole CAN network CAN be synchronously developed without errors only by virtue of the DBC file.
CAPL (Communication Access Programming Language) is a CAN bus access programming language which CAN be widely operated in automobile electronic development, is similar to C language, and is also a language based on event modeling.
An ECU (Electronic Control Unit ), also known as a "car drive computer", "car-mounted computer", etc. The ECU is similar to a common computer, and consists of a Microprocessor (MCU), a memory (ROM, RAM), an input/output interface (I/O), an analog-to-digital converter (A/D), a large-scale integrated circuit for shaping, driving and the like, and the ECU is the brain of the vehicle by a simple expression.
In the embodiment of the invention, the electronic equipment comprises, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal and the like.
In the embodiment of the invention, the DBC template can be created on the electronic equipment, the DBC template is in a format which is equivalent to defining the expression mode of the signal to be calibrated, the unified expression mode is realized through the DBC template, and the ECU of the vehicle can understand the received signal to be calibrated. Wherein the DBC template includes a plurality of message frames, and the embodiment of the present invention may configure a plurality of signal flags and a page number flag for the message frames to be transmitted.
In the embodiment of the invention, CAPL scripts can be written on the electronic equipment, CAPL scripts define the sending content, the sending mode and the sending time, and the signals to be calibrated can be automatically sent through CAPL scripts. Before that, the parameter values to be calibrated can be uniformly stored in the variables (variables) of the CAPL script as the signals to be calibrated, that is, the signals to be calibrated are written in the CAPL script without being written in the DBC template.
In one example of the invention, a user can open Vector software in the electronic device, run CAPL scripts, load DBC templates, and perform online calibration operation by taking an input interface of CAPL scripts as a calibration interface. The problem of limiting the calibration signal quantity can be effectively solved through a form of combining CAPL scripts with the DBC template. The above examples are intended only to provide a better understanding of embodiments of the present invention to those skilled in the art, and the present invention is not limited in this regard.
In an alternative embodiment of the invention, the message frame has a maximum length value, and the plurality of signal marks and the one page mark of the message frame are configured by:
Acquiring preset signal length information; the signal length information comprises a signal length value of the signal to be calibrated; and calculating the ratio of the maximum length value of the message frame to the signal length value of the signal to be calibrated, and determining the ratio as the total number of the signal marks and the page marks of the message frame.
Each message frame has the same maximum length value, 64bytes, which is an inherent property of message frames. The signal length value of each signal may be predefined, for example, a signal length value of 1byte/2bytes/3bytes, etc. may be defined.
The embodiment of the invention can be used for configuring the signal mark and the page number mark for the message frame to be sent by acquiring the preset signal length information, wherein the signal length information comprises the signal length value of the signal to be calibrated, and then calculating the ratio of the maximum length value of the message frame to the signal length value of the signal to be calibrated based on the ratio.
In one example of the present invention, the signal length value of the signal to be calibrated is not limited by the present invention, assuming that the signal length value of the signal to be calibrated is predefined to be 2bytes. When the preset signal length information is obtained, the signal length information comprises a signal length value of 2bytes of the signal to be calibrated. The ratio of the maximum length value of the message frame to the signal length value of the signal to be calibrated, namely 64bytes/2 bytes=32, can then be calculated, and the ratio 32 is determined as the total number of signal marks and page marks of the message frame, wherein the number of page marks is 1, 31 signal marks and 1 page mark are configured for the message frame, for example, the 1 page mark can be signal 1, and the 31 signal marks can be signal 2-signal 32. The above examples are intended only to provide a better understanding of embodiments of the present invention to those skilled in the art, and the present invention is not limited in this regard.
Step 102, determining a message frame to be sent through the CAPL script, sequentially assigning the values of the signals to be calibrated to the signal marks of the message frame to be sent until all the signal marks in the message frame to be sent are assigned, and sequentially configuring the page number values for the page number marks of the message frame to be sent to finish the encapsulation of the message frame.
The DBC template includes a plurality of message frames, and the embodiment of the present invention needs to determine a message frame to be transmitted from the plurality of message frames, and then configure a plurality of signal marks and a page mark for the message frame to be transmitted. The variables (variables) of the CAPL script store signals to be calibrated, the CAPL script acquires the signals to be calibrated from the variables, then sequentially assigns values of the signals to be calibrated to a plurality of signal marks of the message frames to be sent, and configures page values in sequence for the page marks of the message frames to be sent. When all the signal marks in the message frame to be sent are assigned, the message frame to be sent is indicated to reach the maximum length of 64bytes, so that the value of the signal mark and the signal to be calibrated corresponding to the signal mark and the page value corresponding to the page mark are packaged, and the message frame is packaged.
In an alternative embodiment of the present invention, the message frame has a corresponding address, and step 102 may comprise the sub-steps of:
And determining a transmitting address for transmitting the signal to be calibrated to the ECU through the CAPL script, and determining a message frame corresponding to the transmitting address as a message frame to be transmitted.
The CAPL script may correspond to multiple addresses, and if it is required to send the signal to be calibrated to the ECU of the vehicle from the same address, then the script may pre-declare the sending address of the signal to be calibrated to the ECU of the vehicle at CAPL, and then may determine the message frame corresponding to the sending address as the message frame to be sent.
In an alternative embodiment of the present invention, step 102 may comprise the sub-steps of:
And configuring page values for the page marks of the message frames to be sent in a gradually increasing order.
The embodiment of the invention can define the page mark of the message frame to be sent, for example, signal 1 as a division mark page as the page number, and then configure the page value of the page mark of the message frame to be sent according to the progressive increasing sequence, for example, when page=1, signal 1=1; when page=2, singal1=2; when page=3, sing1=3, and so on. In the embodiment of the invention, signal2/signal 3/signal 4 can be used as the page number mark, so long as one of signal 1 to signal Y (Y > 1) is used as the page number mark, and the rest is used as the signal mark, and the invention does not limit the page number mark.
Step 103, after each time of encapsulation of the message frame, sending the encapsulated message frame to the ECU.
The embodiment of the invention can package the signal mark and the value of the signal to be calibrated corresponding to the signal mark and the page number value corresponding to the page number mark, thereby completing the package of the message frame. After the encapsulation of the message frame is completed, the encapsulated message frame is sent to the ECU, and then the next encapsulation process of the message frame is performed.
In an alternative embodiment of the invention, step 103 may comprise the sub-steps of:
and after the encapsulation of the message frame is completed each time, transmitting the encapsulated message frame from the transmitting address to the ECU.
The encapsulated message frame has a corresponding transmission address, and after each time the encapsulation of the message frame is completed, the encapsulated message frame is transmitted from the transmission address to the ECU of the vehicle. The ECU of the vehicle has different reactions when receiving the packaged message frame each time, and then can search the optimal value from the values of all signals to be calibrated according to the different reactions of the vehicle, thereby completing the online calibration process.
In an alternative embodiment of the present invention, the method may further include:
and when receiving response information returned by the ECU aiming at the sending address, determining that all signals to be calibrated are received by the ECU.
When receiving response information returned by the ECU of the vehicle aiming at the sending address, the embodiment of the invention can determine that all signals to be calibrated are received by the ECU of the vehicle.
In an example of the present invention, referring to fig. 2, an interaction schematic diagram of a message frame processing procedure provided by the embodiment of the present invention is shown, an electronic device 201 is configured with CAPL scripts 202 and DBC templates 203, and it is assumed that variables (variables) of the CAPL scripts 202 store a plurality of signals to be calibrated, which are signals to be calibrated 1 to 10=3.1, 11 to 25=3.5, 26 to 40=4.3, 41 to 62=5.0, 63 to 80=2.9, and 81 to 93=7.8, respectively.
Assume that the DBC template 203 includes two message frames, namely a message frame a and a message frame B, where the address corresponding to the message frame a is an address a and the address corresponding to the message frame B is an address B. If signals to be calibrated 1 to 93 need to be transmitted from address a to ECU 204 of the vehicle, address a may be determined as the transmission address and message frame a as the message frame to be transmitted. Assuming that the signal length value of each signal to be calibrated is 2bytes, 31 signal marks (signal 2 to signal 32) and 1 page mark (signal 1) can be allocated to the message frame a.
First encapsulating message frame a procedure: a page value (page) of 1 is allocated to the page number flag (signal 1), that is, singal1=1. The values of the signals to be calibrated 1 to 31 are assigned to 31 signal marks (signal 2 to signal 32) in sequence, namely: the value of the signal to be calibrated 1 is assigned to signal 2, the value of the signal to be calibrated 2 is assigned to signal 3, the value of the signal to be calibrated 3 is assigned to signal 4. When all signal flags (signal 2 to signal 32) in the message frame A are assigned, the message frame A is encapsulated, resulting in A first encapsulated message frame A (signal 1=1, signal 2=3.1, signal 3=3.1, …, signal 31=3.5, signal 32=3.5).
After the encapsulation of the message frame a is completed for the first time, the message frame a after the encapsulation for the first time is sent from the address a to the ECU 204 of the vehicle. When the ECU 204 of the vehicle receives the first encapsulated message frame a, the message frame a resumes the state before the assignment, namely: message frame A (signal 1=, signal 2=, signal 3=, …, signal 31=, signal 32=.
The ECU 204 of the vehicle, which has left the signal to be calibrated 32-93 not yet sent to the vehicle, continues to package and send the message frame a:
Second encapsulation message frame a process: a page value (page) of 2 is allocated to the page number flag (signal 1), that is, signal 1=2. The values of the signal to be calibrated 32 to the signal to be calibrated 62 are assigned to 31 signal marks (signal 2 to signal 32) in sequence, namely: the value of signal to be calibrated 32 is assigned to signal 2, the value of signal to be calibrated 33 is assigned to signal 3, the value of signal to be calibrated 34 is assigned to signal 4. When all signal flags (signal 2 to signal 32) in the message frame A are assigned, the message frame A is encapsulated, resulting in A second encapsulated message frame A (signal 1=2, signal 2=3.5, signal 3=3.5, …, signal 31=5.0, signal 32=5.0).
After the encapsulation of the message frame a is completed for the second time, the second encapsulated message frame a is sent from the address a to the ECU 204 of the vehicle. When the ECU 204 of the vehicle receives the second encapsulated message frame a, the message frame a resumes the state before the assignment, namely: message frame A (signal 1=, signal 2=, signal 3=, …, signal 31=, signal 32=.
The to-be-calibrated signal 63 to the to-be-calibrated signal 93 are still left to be sent to the ECU 204 of the vehicle, and the message frame A is continuously packaged and sent:
Third encapsulation message frame a procedure: a page value (page) of 3 is allocated to the page number flag (signal 1), that is, signal 1=3. The values of the signal to be calibrated 63 to 93 are assigned to 31 signal marks (signal 2 to signal 32) in sequence, namely: the value of signal to be calibrated 63 is assigned to signal 2, the value of signal to be calibrated 64 is assigned to signal 3, the value of signal to be calibrated 65 is assigned to signal 4. When all signal flags (signal 2 to signal 32) in the message frame A are assigned, the message frame A is encapsulated, resulting in A third encapsulated message frame A (signal 1=3, signal 2=2.9, signal 3=2.9, …, signal 31=7.8, signal 32=7.8).
After the encapsulation of the message frame a is completed for the third time, the message frame a encapsulated for the third time is transmitted from the transmission address a to the ECU 204 of the vehicle. When the ECU 204 of the vehicle receives the third encapsulated message frame a, the message frame a resumes the state before the assignment, namely: message frame A (signal 1=, signal 2=, signal 3=, …, signal 31=, signal 32=.
When receiving the response information returned by the ECU 204 of the vehicle for the address a, it can be determined that all the signals to be calibrated (the signals to be calibrated 1 to 93) have been received by the ECU 204 of the vehicle, so that the packaging and transmission of the message frame a can be ended.
According to the embodiment of the invention, through CAPL scripts, the encapsulated message frame A can be sent to the ECU of the vehicle in the sequence of page 1-page X (X +.gtoreq.1) in a sequential cycle according to a preset frequency, for example, every 10 seconds.
The above examples are intended only to provide a better understanding of embodiments of the present invention to those skilled in the art, and the present invention is not limited in this regard.
In the embodiment of the invention, a database file DBC template and a controller local area network bus access programming language CAPL script are manufactured; wherein the DBC template comprises a plurality of message frames, the message frames comprising a plurality of signal marks and a page number mark; writing the signal to be calibrated into CAPL scripts; determining a message frame to be sent through CAPL scripts, sequentially assigning values of signals to be calibrated to a plurality of signal marks of the message frame to be sent until all the signal marks in the message frame to be sent are assigned, and configuring page number values according to the sequence of page number marks of the message frame to be sent so as to complete the encapsulation of the message frame; after each completion of the encapsulation of the message frame, the encapsulated message frame is sent to the electronic control unit ECU of the vehicle. According to the embodiment of the invention, by combining the DBC template and CAPL script, the signal transmission and calibration can be carried out on the message frame with the same address without limitation by only loading one DBC template, so that the efficiency of online calibration is greatly improved, and the flow steps of online calibration are reduced.
The embodiment of the invention also provides a message frame processing device, which is applied to electronic equipment, wherein the electronic equipment is configured with a database file DBC template and a controller area network bus access programming language CAPL script, the DBC template comprises a plurality of message frames, the message frames comprise a plurality of signal marks and a page number mark, the electronic equipment is in communication connection with an electronic control unit ECU of a vehicle, and the device can comprise:
Referring to fig. 3, a block diagram of a message frame apparatus provided by an embodiment of the present invention is shown, which may specifically include the following modules:
A writing module 301, configured to write a signal to be calibrated in the CAPL script;
The encapsulation module 302 is configured to determine a message frame to be sent through the CAPL script, and sequentially assign values of the signal to be calibrated to the plurality of signal flags of the message frame to be sent until all signal flags in the message frame to be sent are assigned, and sequentially configure page values for the page flags of the message frame to be sent, so as to complete encapsulation of the message frame;
And the sending module 303 is configured to send the encapsulated message frame to the ECU after each time of encapsulation of the message frame is completed.
In an alternative embodiment of the present invention, the message frame has a maximum length value, and the plurality of signal flags and the one page number flag of the message frame may be configured by:
The acquisition module is used for acquiring preset signal length information; the signal length information comprises a signal length value of the signal to be calibrated;
And the calculating module is used for calculating the ratio of the maximum length value of the message frame to the signal length value of the signal to be calibrated and determining the ratio as the total number of the signal marks and the page marks of the message frame.
In an alternative embodiment of the present invention, the message frame has a corresponding address, and the encapsulation module 302 may include:
And the message frame to be sent determines a sending address for sending the signal to be calibrated to the ECU through the CAPL script, and determines a message frame corresponding to the sending address as a message frame to be sent.
In an alternative embodiment of the present invention, the encapsulation module 302 may include:
A page value configuration sub-module, configured to configure a page value for the page marks of the message frame to be sent in an order of gradually increasing.
In an alternative embodiment of the present invention, the sending module 303 may include:
And the sending sub-module is used for sending the encapsulated message frame from the sending address to the ECU after the encapsulation of the message frame is completed each time.
In an alternative embodiment of the present invention, the apparatus may further include:
And the response information receiving module is used for determining that the ECU has received all signals to be calibrated when receiving response information returned by the ECU aiming at the sending address.
In the embodiment of the invention, a database file DBC template and a controller local area network bus access programming language CAPL script are manufactured; wherein the DBC template comprises a plurality of message frames, the message frames comprising a plurality of signal marks and a page number mark; writing the signal to be calibrated into CAPL scripts; determining a message frame to be sent through CAPL scripts, sequentially assigning values of signals to be calibrated to a plurality of signal marks of the message frame to be sent until all the signal marks in the message frame to be sent are assigned, and configuring page number values according to the sequence of page number marks of the message frame to be sent so as to complete the encapsulation of the message frame; after each completion of the encapsulation of the message frame, the encapsulated message frame is sent to the electronic control unit ECU of the vehicle. According to the embodiment of the invention, by combining the DBC template and CAPL script, the signal transmission and calibration can be carried out on the message frame with the same address without limitation by only loading one DBC template, so that the efficiency of online calibration is greatly improved, and the flow steps of online calibration are reduced.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention also provides electronic equipment, which comprises:
The message frame processing method comprises a processor, a memory and a computer program which is stored in the memory and can run on the processor, wherein the computer program realizes the processes of the message frame processing method embodiment when being executed by the processor, can achieve the same technical effects, and is not repeated here.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, realizes the processes of the message frame processing method embodiment, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or terminal device that comprises the element.
The foregoing has described in detail the methods, apparatus, electronic devices and computer readable storage medium for message frame processing provided by the present invention, and specific examples have been presented herein to illustrate the principles and embodiments of the present invention, the above examples being provided only to assist in understanding the methods and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (7)

1. A message frame processing method, characterized in that it is applied to an electronic device, the electronic device is configured with a database file DBC template, a controller area network bus access programming language CAPL script, the DBC template includes a plurality of message frames, the message frames include a plurality of signal marks and a page mark, the electronic device is communicatively connected with an electronic control unit ECU of a vehicle, the method includes:
Writing a signal to be calibrated into the CAPL script;
Determining a message frame to be sent through the CAPL script, sequentially assigning the value of the signal to be calibrated to the signal marks of the message frame to be sent until all the signal marks in the message frame to be sent are assigned, and sequentially configuring the page number values for the page number marks of the message frame to be sent to finish the encapsulation of the message frame;
After the encapsulation of the message frame is completed each time, the encapsulated message frame is sent to the ECU;
Wherein the message frame has a maximum length value, the plurality of signature tags and one page number tag of the message frame being configured by:
Acquiring preset signal length information; the signal length information comprises a signal length value of the signal to be calibrated;
Calculating the ratio of the maximum length value of the message frame to the signal length value of the signal to be calibrated, and determining the ratio as the total number of the signal marks and the page marks of the message frame;
Wherein the message frame has a corresponding address, and the determining, by the CAPL, the message frame to be sent includes:
And determining a transmitting address for transmitting the signal to be calibrated to the ECU through the CAPL script, and determining a message frame corresponding to the transmitting address as a message frame to be transmitted.
2. The method of claim 1, wherein said sequentially configuring the page number values for the page number tags of the message frame to be transmitted comprises:
And configuring page values for the page marks of the message frames to be sent in a gradually increasing order.
3. The method according to claim 1, wherein said sending the encapsulated message frame to the electronic control unit ECU after each completion of encapsulation of the message frame comprises:
and after the encapsulation of the message frame is completed each time, transmitting the encapsulated message frame from the transmitting address to the ECU.
4. A method according to claim 3, characterized in that the method further comprises:
and when receiving response information returned by the ECU aiming at the sending address, determining that all signals to be calibrated are received by the ECU.
5. A message frame processing apparatus for use with an electronic device configured with a database file DBC template, a controller area network bus access programming language CAPL script, the DBC template comprising a plurality of message frames, the message frames comprising a plurality of signal tags and a page tag, the electronic device communicatively coupled to an electronic control unit ECU of a vehicle, the apparatus comprising:
The writing module is used for writing the signal to be calibrated in the CAPL script;
the packaging module is used for determining a message frame to be sent through the CAPL script, sequentially assigning the values of the signals to be calibrated to the signal marks of the message frame to be sent until all the signal marks in the message frame to be sent are assigned, and sequentially configuring the page number values for the page number marks of the message frame to be sent so as to complete packaging of the message frame;
The sending module is used for sending the encapsulated message frame to the ECU after the encapsulation of the message frame is completed each time;
wherein the message frame has a maximum length value, and the plurality of signature tags and the one page number tag of the message frame are configured by:
The acquisition module is used for acquiring preset signal length information; the signal length information comprises a signal length value of the signal to be calibrated;
The calculating module is used for calculating the ratio of the maximum length value of the message frame to the signal length value of the signal to be calibrated and determining the ratio as the total number of the signal marks and the page marks of the message frame;
Wherein the message frame has a corresponding address, and the encapsulation module includes:
And the message frame to be sent determines a sending address for sending the signal to be calibrated to the ECU through the CAPL script, and determines a message frame corresponding to the sending address as a message frame to be sent.
6. An electronic device, comprising: a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor performs the steps of the message frame processing method according to any of claims 1-4.
7. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the message frame processing method according to any of claims 1 to 4.
CN202110764559.1A 2021-07-06 2021-07-06 Message frame processing method and device Active CN113542381B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110764559.1A CN113542381B (en) 2021-07-06 2021-07-06 Message frame processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110764559.1A CN113542381B (en) 2021-07-06 2021-07-06 Message frame processing method and device

Publications (2)

Publication Number Publication Date
CN113542381A CN113542381A (en) 2021-10-22
CN113542381B true CN113542381B (en) 2024-04-19

Family

ID=78097885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110764559.1A Active CN113542381B (en) 2021-07-06 2021-07-06 Message frame processing method and device

Country Status (1)

Country Link
CN (1) CN113542381B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101720458A (en) * 2007-06-30 2010-06-02 多米诺印刷科学有限公司 improvements in or relating to marking and/or coding
CN110120930A (en) * 2018-02-06 2019-08-13 阿里巴巴集团控股有限公司 Obtain method, system and the multimedia equipment of transmission file
CN111045416A (en) * 2019-12-19 2020-04-21 中国汽车技术研究中心有限公司 Method and device for analyzing CAN (controller area network) signal of whole vehicle by using diagnosis message
CN111147514A (en) * 2019-12-31 2020-05-12 上海理工大学 Communication frame suitable for real-time Ethernet session layer and design method
CN111581082A (en) * 2020-04-21 2020-08-25 东风汽车集团有限公司 Vehicle-mounted controller test script generation device and method
CN112083897A (en) * 2020-07-30 2020-12-15 济南浪潮高新科技投资发展有限公司 Signal declaration system, method, equipment and medium in digital logic design

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10824783B2 (en) * 2015-03-31 2020-11-03 Marvell Asia Pte, Ltd. Approach for logic signal grouping and RTL generation using XML

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101720458A (en) * 2007-06-30 2010-06-02 多米诺印刷科学有限公司 improvements in or relating to marking and/or coding
CN110120930A (en) * 2018-02-06 2019-08-13 阿里巴巴集团控股有限公司 Obtain method, system and the multimedia equipment of transmission file
CN111045416A (en) * 2019-12-19 2020-04-21 中国汽车技术研究中心有限公司 Method and device for analyzing CAN (controller area network) signal of whole vehicle by using diagnosis message
CN111147514A (en) * 2019-12-31 2020-05-12 上海理工大学 Communication frame suitable for real-time Ethernet session layer and design method
CN111581082A (en) * 2020-04-21 2020-08-25 东风汽车集团有限公司 Vehicle-mounted controller test script generation device and method
CN112083897A (en) * 2020-07-30 2020-12-15 济南浪潮高新科技投资发展有限公司 Signal declaration system, method, equipment and medium in digital logic design

Also Published As

Publication number Publication date
CN113542381A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
WO2021098212A1 (en) Software upgrade method, apparatus and system
CN108255152B (en) vehicle diagnosis method, diagnosis box and computer readable storage medium
CN110545220B (en) Automobile diagnosis protocol detection method and related product
CN112506756B (en) Method and device for generating test case script of vehicle controller
CN114089713A (en) Communication method based on UDS, ECU and upper computer
CN113468070A (en) Consistency test method for vehicle-mounted Ethernet
CN114780326B (en) Cross-platform calibration test method, device and equipment
CN104683126B (en) Network management based on CAN
CN107666400A (en) Vehicle simulation adjustment method and device for simulative debugging system
CN105512097A (en) File analyzing method
CN114326672A (en) ECU simulation detection method, electronic device and storage medium
CN105573294A (en) New energy automobile electronic control unit ECU based on Internet
WO2024109535A1 (en) Communication interaction method and apparatus, device, and storage medium
CN113542381B (en) Message frame processing method and device
CN111443688B (en) Automobile diagnosis service network layer test system and method based on CAN bus
CN111221317B (en) Automobile diagnosis data processing method and system
CN116455784A (en) Gateway test method, system, computer and readable storage medium
CN116319499A (en) Diagnostic method and device for vehicle, electronic equipment and storage medium
CN203643813U (en) CANOPEN main control device based on PC104 bus
CN115586019A (en) Automatic testing method, device, equipment and storage medium for vehicle
CN114756008A (en) Fault injection system, automatic test system and method for automobile hybrid bus integrated rack
CN106899702B (en) Device and method for learning address from board
CN114326503A (en) Vehicle-mounted IO gateway controller and communication method
CN113126590A (en) Vehicle diagnostic communication method, device, computer equipment and storage medium
CN115730395B (en) Automobile interface model generation method, 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
GR01 Patent grant
GR01 Patent grant