CN115167368A - Method and system for converting and outputting automobile CAN data - Google Patents

Method and system for converting and outputting automobile CAN data Download PDF

Info

Publication number
CN115167368A
CN115167368A CN202210923156.1A CN202210923156A CN115167368A CN 115167368 A CN115167368 A CN 115167368A CN 202210923156 A CN202210923156 A CN 202210923156A CN 115167368 A CN115167368 A CN 115167368A
Authority
CN
China
Prior art keywords
data
output
conversion
automobile
item
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
CN202210923156.1A
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.)
Guangzhou Roadpassion Electronic Technology Co ltd
Original Assignee
Guangzhou Roadpassion Electronic 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 Roadpassion Electronic Technology Co ltd filed Critical Guangzhou Roadpassion Electronic Technology Co ltd
Priority to CN202210923156.1A priority Critical patent/CN115167368A/en
Publication of CN115167368A publication Critical patent/CN115167368A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0208Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
    • G05B23/0213Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides a method and a system for converting and outputting automobile CAN data, wherein the method comprises the following steps: s1, a CAN receiving thread and a data updating thread are newly built, and a ring buffer area is built for communication among threads; s2, the CAN receiving thread is used for receiving data from the automobile CAN bus network and writing the data into the annular buffer area; s3, the data updating thread is used for reading data from the annular buffer area and determining a corresponding conversion item according to a CAN identifier in a CAN message; s4, converting and updating CAN data according to the attribute of the conversion item; and S5, outputting the updated data. In this application, only through two CAN line access car networks, use this system to connect and to reduce the pencil when installing various products additional, keep apart the power and reduce risk etc. CAN be so that the degree of difficulty greatly reduced of troubleshooting problem source when the car breaks down.

Description

Method and system for converting and outputting automobile CAN data
Technical Field
The invention belongs to the field of vehicles, and particularly relates to a method and a system for converting and outputting automobile CAN data.
Background
Although a large number of wire harnesses are reduced by using a CAN bus network in some old automobiles, some devices are connected by using the wire harnesses at the same time, and some atmosphere lamps are additionally arranged on the market and directly supply power to the atmosphere lamps through the wire harnesses connected with headlamps, so that the vehicles are easily damaged when short circuits occur to additionally arranged equipment. Some products connected by wires on the market cannot be compatible due to differences of vehicles, such as: when the signal state of the turn signal is obtained by using a line, the line of some vehicles is connected to the signal of the turn signal (the signal can jump along with the light), and the line of some vehicles is connected to the steering rocker (the signal is fixed along with the state of the rocker).
Disclosure of Invention
The embodiment of the application provides a method and a device for automobile CAN data conversion output, which only access an automobile network through two CAN lines, and when various products are additionally installed, the system is used for connection, so that wiring harnesses CAN be reduced, a power supply is isolated, risks are reduced, and the like, and the difficulty of troubleshooting problem sources when an automobile breaks down CAN be greatly reduced.
In a first aspect, an embodiment of the present application provides a method for converting and outputting CAN data of an automobile, including:
s1, a CAN receiving thread and a data updating thread are newly built, and a ring buffer area is built for communication among threads;
s2, the CAN receiving thread is used for receiving data from the automobile CAN bus network and writing the data into a ring buffer area;
s3, the data updating thread is used for reading data from the annular buffer area and determining a corresponding conversion item according to a CAN identifier in a CAN message;
s4, CAN data conversion and updating are carried out according to the attributes of the conversion items;
and S5, outputting the updated data.
Wherein, step S1 further comprises: reading the lookup table from FLASH, initializing the CAN ID filter according to the CAN identifier list in the table, initializing each output, and setting the Baud rate of the USART output serial port.
Wherein, step S3 includes: the data updating thread is used for reading data from the ring buffer area, searching by taking the CAN identifier in the CAN message as a key value of the lookup table, and determining which conversion items have the CAN identifier, wherein different conversion items CAN have different CAN identifiers; and then the corresponding conversion items are processed.
Wherein, step S4 includes:
judging whether to take a value directly according to the attribute of the item during data conversion, if the data change of one conversion item is the change of the state, operating the data, reading the data from the position in the CAN message, and then operating according to the operational character of the item;
and if the data is changed, directly taking the value, and reading the data according to the position of the data in the CAN message.
Wherein, step S5 includes:
and after data updating, corresponding output updating is carried out, for a 12V I/O output port and a DAC voltage output port, data is output and immediately updated after data updating, for a USART output, all conversion item data are packaged into a serial port protocol after being updated, the protocol comprises a protocol header, data length, data content and CRC (cyclic redundancy check), and then the conversion item data are sent out in a period of 100 milliseconds.
Wherein, still include: use 8 12V's delivery outlets to represent the part state, the part includes the gear, turns to, door, light, radar, uses 1 red LED lamp and 1 green LED lamp as result information instruction, uses the USART interface to send automobile body information, uses 4 passageway DAC output voltage to represent parameter intensity, the parameter includes radar, speed, turns to the angle.
Wherein, step S1 also includes before:
detecting whether a TF card is inserted or not through an SPI (serial peripheral interface) after a system is powered on, enabling green lights and red lights to be in a normally-off state at the moment, and entering an upgrading mode to light up when detecting that the TF is inserted and an upgrading file update exists in a root directory; if the TF card is not detected after 0.5 second, the system is started normally, and the red light is turned on.
Wherein, the process of upgrading data includes:
step 1: when a new vehicle type is developed, data acquisition and analysis are carried out on the vehicle for the first time;
step 2: connecting a CAN collector to an automobile CAN bus network, repeatedly operating a current collection project, repeatedly engaging a reverse gear and a neutral gear when gear data are collected, and observing the change of the collected data for screening; the change is reflected by more than one CAN ID identifier, for the state change, the data which only changes one bit is selected, and for the numerical value change, the data which changes one byte is selected;
and step 3: writing the acquired data and the corresponding project into a text file according to the format of the upgrade file, and changing the file name into update after all the projects are acquired;
and 4, step 4: inserting the TF card to electrify the system, wherein if the name and the content format of the upgrade file are correct, the green LED lamp is lightened to indicate that the data file is being upgraded;
and 5: the resolver reads data line by line from a file, wherein, "<" represents the beginning of the name of a current conversion project, and ">" represents the end, and the current line of the name also comprises a CAN identifier ID and a data position and is separated by a blank space; after reading an item, constructing a hash table by using the CAN identifier of the item as a key value, wherein different items may use the same CAN identifier and need to indicate how many items the identifier contains; storing the hash tables of all the items into FLASH;
step 6: after the data is stored, the green LED lamp flickers to indicate that the data is upgraded successfully, and the TF card is waited to be pulled out to complete upgrading.
In a second aspect, the present application provides a system for converting CAN data output of an automobile, including: data analysis updates output module, data analysis updates output module and is connected with I/O output port, USART output port and DAC voltage output port, data analysis updates output module and is used for:
a CAN receiving thread and a data updating thread are newly established, and a ring buffer area is established for communication among threads;
the CAN receiving thread is used for receiving data from an automobile CAN bus network and writing the data into a ring buffer area;
the data updating thread is used for reading data from the annular buffer area and determining a corresponding conversion item according to a CAN identifier in a CAN message;
converting and updating CAN data according to the attribute of the conversion item;
and outputting the updated data.
In a third aspect, the application provides an automobile, which comprises the system for converting the CAN data of the automobile.
The method and the system for converting and outputting the automobile CAN data have the following beneficial effects:
in this application, only through two CAN line access automobile network, use this system to connect when installing various products additional and CAN reduce the pencil, keep apart the power and reduce risk etc. CAN make the degree of difficulty greatly reduced of troubleshooting problem source when the car breaks down. In the application, the CAN data of the automobile is converted into universal output, and the automobile data processing system has great compatibility with different automobile additional products.
Drawings
FIG. 1 is a schematic flow chart of a method for converting and outputting CAN data of an automobile according to an embodiment of the present application;
FIG. 2 is another schematic flow chart of a method for converting CAN data of an automobile according to the embodiment of the present application;
fig. 3 is a schematic structural diagram of a system for converting and outputting CAN data of an automobile according to an embodiment of the present application.
Detailed Description
The present application is further described with reference to the following figures and examples.
In the following description, the terms "first" and "second" are used for descriptive purposes only and are not intended to indicate or imply relative importance. The following description provides embodiments of the invention, where different embodiments may be substituted or combined, and this application is therefore intended to include all possible combinations of the same and/or different embodiments described. Thus, if one embodiment includes the feature A, B, C and another embodiment includes the feature B, D, then this application should also be considered to include embodiments that include all other possible combinations of one or more of A, B, C, D, although this embodiment may not be explicitly recited in text below.
The following description provides examples, and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made in the function and arrangement of elements described without departing from the scope of the disclosure. Various examples may omit, substitute, or add various procedures or components as appropriate. For example, the described methods may be performed in an order different than the order described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
The holding capacity of automobiles has increased year by year and automobiles have become more and more popular. More and more novelty is applied in automobiles, for example: on the car that is equipped with the look around camera, when putting into reverse gear, the display screen switches to the camera picture of afterbody, and when turning to the indicator, the display screen switches to the camera picture of indicator one side. On a car equipped with a courtesy light, when the door is opened, it projects a welcome image on the ground. Unlike other consumer products, automobiles have a long service life, the technology is updated very quickly, and many older automobiles do not have the novelty and need to be retrofitted. In the present application, the required state information of the Electronic Control Unit (ECU) inside the vehicle is acquired for retrofitting.
The CAN is an abbreviation of Controller Area Network (Controller Area Network) (hereinafter referred to as CAN), and is commonly used for communication among various Electronic Control Units (ECUs) of an automobile by using a CAN protocol, when the state of the ECU changes, the ECU sends the state to the CAN Network in the form of a message, and in the communication process, because each Network node in the CAN bus Network CAN receive data on the bus, the state of each ECU CAN be obtained through the CAN data by analyzing the data.
The invention converts the state of ECU in different vehicle CAN network into output in the same way. For example: the CAN data state information is expressed through a voltage level, the power supply of the welcome lamp is driven by the open state of the car door through output voltage, and the power supply of the atmosphere lamp is driven by the open state information of the headlight through output voltage. The vehicle speed and the data of the steering wheel can be output in a serial port protocol mode so as to provide secondary development.
As shown in fig. 1, the method for converting the CAN data of the vehicle according to the present application includes: s1, a CAN receiving thread and a data updating thread are newly built, and a ring buffer area is built for communication among threads; s2, the CAN receiving thread is used for receiving data from the automobile CAN bus network and writing the data into an annular buffer zone; s3, the data updating thread is used for reading data from the annular buffer area and determining a corresponding conversion item according to a CAN identifier in a CAN message; s4, converting and updating CAN data according to the attribute of the conversion item; and S5, outputting the updated data.
Specifically, as shown in fig. 1 to 3, the method for converting the CAN data of the vehicle includes: step 1: and after the system is powered on, whether the TF card is inserted or not is detected through the SPI, at the moment, the green light and the red light are in a normally off state, and when the TF card is detected to be inserted and an upgrade file update exists in a root directory, the system enters an upgrade mode, and the green light is lightened. If the TF card is not detected after 0.5 second, the system is started normally, and the red light is turned on.
Step 2: reading a lookup table from FLASH, initializing a CAN ID filter according to a CAN identifier list in the table, initializing each output, setting the output serial port baud rate of a USART (Universal Synchronous/Asynchronous Receiver/Transmitter), establishing a CAN receiving thread and a data updating thread, and establishing a ring buffer area for communication between threads.
And step 3: the CAN receive thread is responsible for receiving data from the automotive CAN bus network and writing the data to the ring buffer.
And 4, step 4: the data updating thread is responsible for reading data from the ring buffer, and the CAN identifier in the CAN message is used as a key value of the lookup table to search which conversion items have the identifier, and different conversion items CAN have different CAN identifiers. And then the corresponding conversion item is processed.
And 5: judging whether to take a value directly according to the attribute of the item during data conversion, generally, if the data change of a conversion item is the change of the state, operating the data, reading the data from the position in the CAN message, and then operating according to the operator of the item to update the output data; and if the data is changed, directly taking the value, and directly reading the data according to the position of the data in the CAN message to update the output data.
Step 6: and after data updating, corresponding output updating is carried out, for 12V I/O output port and DAC voltage output port, data is updated immediately after being updated, for USART output, all conversion item data are packaged into a serial port protocol after being updated, and the protocol comprises a protocol header, data length, data content and CRC (cyclic redundancy check). And then transmitted at a period of 100 milliseconds.
The filling format of the upgrade file is as follows: the name < CAN identifier > < data position > < sub-item identification > < data operation > < data >, wherein the name represents the name of the item needing to convert data, and the name comprises gear, steering angle, steering lamp state, headlight state, door state, speed and radar. The CAN identifier indicates that the data in this conversion entry is derived from the identifier in the current vehicle CAN bus network. The data position indicates the data of the conversion item in the several bytes of the CAN message of the identifier. The sub item is identified as a sub item name in the current item, and one item can have a plurality of sub items. Data operations are represented as operations that determine the data, including equals, ANDs, or, where items are ignored when they do not. The data represents the correct data in the trigger state, and the item, which is not needed, can be ignored in the # representation.
The process of upgrading data includes the steps of:
step 1: the vehicle data of the scalable automobile CAN data conversion output system is scalable, and when a new vehicle type is developed, data acquisition and analysis are firstly carried out on the vehicle for one time.
Step 2: the CAN collector is connected to an automobile CAN bus network, repeated operation is carried out on the current collection project, for example, the current collection project is repeatedly put into reverse gear and neutral gear when gear data are collected, and the collected data change is observed for screening. Usually, this change is represented by more than one CAN ID identifier, and for a change of state we prefer to change the data by only one bit. For value changes we prefer to change one byte of data.
And step 3: and writing the acquired data and the corresponding project into a text file according to the format of the upgrade file, and changing the file name into update after all the projects are acquired, wherein the bin is put into the root directory of the TF card.
And 4, step 4: and inserting the TF card for powering on the system, wherein if the name and the content format of the upgrade file are correct, the green LED lamp can be lightened to indicate that the data file is being upgraded.
And 5: the parser reads the data line by line from the file, "<" denotes the beginning of the name of the current conversion item, ">" denotes the end, the name current line also includes the CAN identifier ID, the data location, spaces are used to separate e.g. gear conversion items: < SHIFT > 0x0d36 5. The next N rows are sub-items of the current item, each conversion item has a fixed sub-item, for example, a gear conversion has sub-items P, R, N, D, and the reading is finished until the next "<" item. After reading an item, the CAN identifier of the item is used as a key value to construct a hash table, different items may use the same CAN identifier, and it is necessary to indicate how many items the identifier contains. And saving the hash tables of all the items into FLASH.
Step 6: after the data is stored, the green LED lamp flickers to indicate that the data is upgraded successfully, and the TF card is waited to be pulled out to complete upgrading.
The invention has the characteristics that: 1. the program operation of the CAN data conversion system CAN be divided into an upgrading data mode and a normal operation mode. 2. One receive thread and one process thread and ring buffer management are used. 3. The data is looked up with the CAN identifier as a key of the look-up table. 4. The mode of accessing the system is simple and safe, the output mode has universality and diversity, and the output can be customized. 5. The vehicle data of the upgradable automobile CAN data conversion output system is upgradable, when a new automobile type is developed, software and hardware do not need to be upgraded, only the data of the vehicle needs to be replaced, and software developers do not need to participate in the process. 6. The filling format of the upgrade file is as follows: < name > < CAN identifier > < data location > < sub-item identification > < data operation > < data >.
Although a large number of wire harnesses are reduced by using a CAN bus network in some old automobiles, some devices are connected by using the wire harnesses at the same time, and atmosphere lamps additionally arranged on the market directly supply power to the atmosphere lamps through the wire harnesses connected with headlamps, so that the vehicles are easily damaged when additionally arranged equipment is short-circuited. The system is accessed to the network through the CAN bus, does not influence the power supply of an automobile system, and CAN prevent the automobile storage battery from being lack of power and the like caused by additionally arranged equipment.
Some products connected by wires on the market cannot be compatible due to differences of vehicles, such as: the signal state of the turn signal is obtained by using a line, the line of the vehicle is connected to the signal of the turn signal (the signal can jump along with the light), and the line of the vehicle is connected to the steering rocker (the signal is fixed along with the state of the rocker). The system is accessed only through two CAN lines, so that the connection of the wiring harness is reduced, a large number of vehicle types CAN be compatible, and the output CAN be realized in a unified mode.
The number of automobile manufacturers is too many to be counted all over the world, and the CAN bus network of each automobile is not completely unified in design, namely, the data used by the same module is different for different automobiles. The system CAN be upgraded through the TF card, the CAN data of the vehicle CAN be collected and analyzed by using the CAN collector when the vehicle type is expanded, and then the system CAN be upgraded by writing the CAN data into an upgrade file according to a well-defined format, and the work of upgrading the system CAN be finished only by slightly training, so that the product is easy to popularize in the market.
The system of the invention is only accessed to the automobile network through two CAN lines, and when various products are additionally installed, the system is used for connection, so that the wiring harness CAN be reduced, the power supply CAN be isolated, the risk CAN be reduced, and the difficulty in troubleshooting problem sources when the automobile breaks down CAN be greatly reduced.
The data of the system can be upgraded, the upgrading data is different from upgrading software in that the upgrading data does not need to install a software development tool, compiling and compiling software are not needed again, only the upgrading file needs to be filled according to the format, even if ordinary people train slightly, the upgrading file can be completed, and vehicles of the same type can be deployed in different places after the upgrading file is made, so that the popularization of the system is very easy.
The system of the invention converts the CAN data of the automobile into universal output, and has great compatibility for different automobile add-on products.
As shown in fig. 3, the present application further provides a system for converting CAN data of an automobile, including: data analysis updates output module, data analysis updates output module and is connected with I/O output port, USART output port and DAC voltage output port, data analysis updates output module and is used for: a CAN receiving thread and a data updating thread are newly established, and a ring buffer area is established for communication among threads; the CAN receiving thread is used for receiving data from the automobile CAN bus network and writing the data to the annular buffer zone; the data updating thread is used for reading data from the annular buffer area and determining a corresponding conversion item according to a CAN identifier in a CAN message; converting and updating CAN data according to the attribute of the conversion item; and outputting the updated data.
The system for automobile CAN data conversion output reads files in TF cards by using a FATFS file system, receives data of a CAN bus network of an automobile by using a monitoring mode (without affecting nodes in an original network) of TJA1043, uses STM32 as logic master control, uses 8 12V output ports to express states of gears, steering, automobile doors, lamplight, radars and the like, uses 1 red LED lamp and 1 green LED lamp as result information indication, uses a USART interface to send automobile body information, and uses 4-channel DAC output voltage to express intensities of radars, speed, steering angles and the like.
In the present application, the embodiment of the system for converting and outputting the car CAN data is basically similar to the embodiment of the method for converting and outputting the car CAN data, and the related points refer to the introduction of the embodiment of the method for converting and outputting the car CAN data.
The application also provides an automobile, which comprises the automobile CAN data conversion output system.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
All functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for converting and outputting automobile CAN data is characterized by comprising the following steps:
s1, a CAN receiving thread and a data updating thread are newly established, and an annular buffer area is established for communication among threads;
s2, the CAN receiving thread is used for receiving data from the automobile CAN bus network and writing the data into a ring buffer area;
s3, the data updating thread is used for reading data from the annular buffer area and determining a corresponding conversion item according to a CAN identifier in a CAN message;
s4, converting and updating CAN data according to the attribute of the conversion item;
and S5, outputting the updated data.
2. The method for CAN data conversion output of an automobile according to claim 1, wherein the step S1 further comprises: reading the lookup table from the FLASH, initializing the CAN ID filter according to the CAN identifier list in the table, initializing each output, and setting the Baud rate of the USART output serial port.
3. The method for CAN data conversion output of a vehicle according to claim 2, wherein step S3 comprises: the data updating thread is used for reading data from the ring buffer area, searching by taking the CAN identifier in the CAN message as a key value of the lookup table, and determining which conversion items have the CAN identifier, wherein different conversion items CAN have different CAN identifiers; and then the corresponding conversion item is processed.
4. The method for CAN data conversion output of an automobile according to any one of claims 1 to 3, wherein the step S4 comprises:
judging whether to take a value directly according to the attribute of the item during data conversion, if the data change of one conversion item is the change of the state, operating the data, reading the data from the position in the CAN message, and then operating according to the operational character of the item;
and if the data is changed, directly taking the value, and reading the data according to the position of the data in the CAN message.
5. The method for CAN data conversion output of an automobile according to any one of claims 1 to 3, wherein the step S5 comprises:
and after data updating, corresponding output updating is carried out, for a 12V I/O output port and a DAC voltage output port, data is output and immediately updated after data updating, for a USART output, all conversion item data are packaged into a serial port protocol after being updated, the protocol comprises a protocol header, data length, data content and CRC (cyclic redundancy check), and then the conversion item data are sent out in a period of 100 milliseconds.
6. The method for CAN data conversion output of an automobile according to any one of claims 1 to 3, further comprising: use 8 12V's delivery outlets to represent the part state, the part includes the gear, turns to, door, light, radar, uses 1 red LED lamp and 1 green LED lamp as result information instruction, uses the USART interface to send automobile body information, uses 4 passageway DAC output voltage to represent parameter intensity, the parameter includes radar, speed, turns to the angle.
7. The method for CAN data conversion output of an automobile according to any one of claims 1 to 3, wherein the step S1 is preceded by the steps of:
detecting whether a TF card is inserted or not through an SPI (serial peripheral interface) after a system is powered on, enabling green lights and red lights to be in a normally-off state at the moment, and entering an upgrading mode to light up when detecting that the TF is inserted and an upgrading file update exists in a root directory; if the TF card is not detected after 0.5 second, the system is started normally, and the red light is turned on.
8. The method for CAN data conversion output of an automobile according to claim 7, wherein the process of upgrading data comprises:
step 1: when a new vehicle model is developed, data acquisition and analysis are carried out on the vehicle for the first time;
step 2: connecting a CAN collector to an automobile CAN bus network, repeatedly operating a current collection project, repeatedly engaging a reverse gear and a neutral gear when gear data are collected, observing the change of the collected data and screening; the change is reflected by more than one CAN ID identifier, for the state change, the data which only changes one bit is selected, and for the numerical value change, the data which changes one byte is selected;
and step 3: writing the acquired data and the corresponding project into a text file according to the format of the upgrade file, and changing the file name into update after all the projects are acquired;
and 4, step 4: inserting the TF card to electrify the system, wherein if the name and the content format of the upgrade file are correct, the green LED lamp is lightened to indicate that the data file is being upgraded;
and 5: the resolver reads data line by line from a file, wherein, "<" represents the beginning of the name of a current conversion project, and ">" represents the end, and the current line of the name also comprises a CAN identifier ID and a data position and is separated by a blank space; after reading an item, constructing a hash table by using the CAN identifier of the item as a key value, wherein different items may use the same CAN identifier and need to indicate how many items the identifier contains; storing the hash tables of all the items into FLASH;
step 6: after the data is stored, the green LED lamp flickers to indicate that the data is upgraded successfully, and the TF card is waited to be pulled out to complete upgrading.
9. A system for automobile CAN data conversion output is characterized by comprising: data analysis updates output module, data analysis updates output module and is connected with I/O output port, USART output port and DAC voltage output port, data analysis updates output module and is used for:
a CAN receiving thread and a data updating thread are newly established, and an annular buffer zone is established for communication among threads;
the CAN receiving thread is used for receiving data from an automobile CAN bus network and writing the data into a ring buffer area;
the data updating thread is used for reading data from the annular buffer area and determining a corresponding conversion item according to a CAN identifier in a CAN message;
converting and updating CAN data according to the attribute of the conversion item;
and outputting the updated data.
10. A vehicle comprising the system for CAN data conversion output of a vehicle of claim 9.
CN202210923156.1A 2022-08-02 2022-08-02 Method and system for converting and outputting automobile CAN data Pending CN115167368A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210923156.1A CN115167368A (en) 2022-08-02 2022-08-02 Method and system for converting and outputting automobile CAN data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210923156.1A CN115167368A (en) 2022-08-02 2022-08-02 Method and system for converting and outputting automobile CAN data

Publications (1)

Publication Number Publication Date
CN115167368A true CN115167368A (en) 2022-10-11

Family

ID=83478188

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210923156.1A Pending CN115167368A (en) 2022-08-02 2022-08-02 Method and system for converting and outputting automobile CAN data

Country Status (1)

Country Link
CN (1) CN115167368A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117155422A (en) * 2023-09-14 2023-12-01 慧勒智行汽车技术(昆山)有限公司 CAN signal receiving and transmitting method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117155422A (en) * 2023-09-14 2023-12-01 慧勒智行汽车技术(昆山)有限公司 CAN signal receiving and transmitting method and system
CN117155422B (en) * 2023-09-14 2024-04-02 慧勒智行汽车技术(昆山)有限公司 CAN signal receiving and transmitting method and system

Similar Documents

Publication Publication Date Title
CN201117091Y (en) Automobile light state feedback device based on CAN bus
EP0580189B1 (en) Collective wiring system for an automobile and control method for the wiring system
CN109808705A (en) A kind of system for remote control Driving control
CN101417636A (en) Pure electric motor coach communication system and method based on three CAN bus
KR20210090725A (en) Reinforcement of vehicle emergency system
CN115167368A (en) Method and system for converting and outputting automobile CAN data
AU2019308467B2 (en) Control of vehicle-carried warning system through controller area network (CAN) communications of global variables processed as operands of behavioral equations
CN202093389U (en) Intelligent bus control system for vehicle
CA2889585A1 (en) Device and method for allowing integration of incompatible devices into a vehicle bus network
CN104760550A (en) Automobile door signal converter and automobile flexible pedal
CN103268647A (en) Remote driving data recorder and implementation method thereof
CN102681526A (en) CAN (controller area network) bus system and fault diagnosis method thereof
CN105404271B (en) A kind of centralized body control system and its identity method for early warning
CN110163992A (en) Data capture method and device based on listening mode
CN203250340U (en) Remote driving data recorder
CN207251970U (en) A kind of automobile atmosphere lamp and its control system
CN204586746U (en) A kind of car door signal converter and vehicle telescopic pedal
CN204258837U (en) A kind of vehicle bus failure detector
CN103019792A (en) Application reprogramming method and application reprogramming system
CN113547997A (en) Vehicle-mounted display device and system based on vehicle-mounted Ethernet interface
CN102354138A (en) Electronic control unit, control method and computer program
CN113741393B (en) Vehicle safety network architecture based on central gateway and diagnosis method thereof
CN111605497A (en) VIN code and emergency valve multifunctional integrated control system and method
CN210405351U (en) Vehicle-mounted entertainment system CAN function test tool
CN114979217B (en) Vehicle body big data transmission method

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