CN113608483B - Method for acquiring vehicle signal value, electronic equipment and electronic control unit - Google Patents

Method for acquiring vehicle signal value, electronic equipment and electronic control unit Download PDF

Info

Publication number
CN113608483B
CN113608483B CN202110931726.7A CN202110931726A CN113608483B CN 113608483 B CN113608483 B CN 113608483B CN 202110931726 A CN202110931726 A CN 202110931726A CN 113608483 B CN113608483 B CN 113608483B
Authority
CN
China
Prior art keywords
signal
request message
message
preset
monitored
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
CN202110931726.7A
Other languages
Chinese (zh)
Other versions
CN113608483A (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.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch 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 Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202110931726.7A priority Critical patent/CN113608483B/en
Publication of CN113608483A publication Critical patent/CN113608483A/en
Application granted granted Critical
Publication of CN113608483B publication Critical patent/CN113608483B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25257Microcontroller

Landscapes

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

Abstract

The application is suitable for the technical field of communication, and provides a method, a device, electronic equipment and an electronic control unit for acquiring a vehicle signal value, which can improve the efficiency of acquiring the vehicle signal value. The method comprises the following steps: sending a request message to a target ECU, wherein the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored; receiving a response message, wherein the response message is generated according to a message format and a signal value corresponding to a request message identifier after the target ECU obtains the signal value of the signal to be monitored specified by the preset specified code; and analyzing the response message to obtain the signal value of the signal to be monitored.

Description

Method for acquiring vehicle signal value, electronic equipment and electronic control unit
Technical Field
The application belongs to the technical field of electric communication, and particularly relates to a method for acquiring a vehicle signal value, electronic equipment and an electronic control unit.
Background
Currently, the signal value refers to data generated by the communication between the ECU (Electronic Control Unit ) and the sensors and the actuators, and the data may change with time and working conditions. When the ECU receives the message, the number of signal values contained in the message is counted, then the latest data of the signal values are sequentially obtained, and then a response message is sent through a bus, so that other devices obtain the latest data through the message.
At present, a single message of many ECUs contains values of a plurality of signals, and the latest values of the plurality of signals are acquired before the message is sent, and then a response message is generated and sent, which can lead to slow reply and untimely refreshing. If we only need to acquire one or several values of the specified signal, the existing ECU reverts to the mode with low efficiency.
Disclosure of Invention
The embodiment of the application provides a method, a device, electronic equipment, an electronic control unit and a readable storage medium for acquiring a vehicle signal value, which can solve the problem of low efficiency of acquiring the vehicle signal value in the prior art.
In a first aspect, an embodiment of the present application provides a method for acquiring a signal value of a vehicle, which is applied to an electronic device, and includes:
sending a request message to a target ECU, wherein the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored;
receiving a response message, wherein the response message is generated according to a message format corresponding to the request message identifier and the signal value after the target ECU obtains the signal value of the signal to be monitored specified by the preset specification code;
and analyzing the response message to obtain the signal value of the signal to be monitored.
Further, each bit of the code in the preset designating code corresponds to a type of signal, and the code is used for designating whether the corresponding signal is a signal to be monitored or not based on the message format corresponding to the request message identifier.
Further, the sending the request message to the target ECU includes:
and sending the request message to an automobile bus, wherein the request message also comprises request identification information of the target ECU.
Further, the response message further comprises a response identification information and a response message identification, wherein the response message identification corresponds to the request message identification;
analyzing the response message to obtain the signal value of the signal to be monitored, including:
judging whether the ECU corresponding to the reply identification information is the target ECU or not;
if yes, judging whether the response message identifier corresponds to the request message identifier;
if yes, the signal value is obtained from the response message.
In a second aspect, an embodiment of the present application provides a method for acquiring a signal value of a vehicle, which is applied to an ECU, and includes:
receiving a request message, wherein the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored;
determining a corresponding message format according to the request message identifier;
determining the signal to be monitored based on the message format and the preset specified code;
acquiring a signal value corresponding to the signal to be monitored;
generating a corresponding response message based on the message format and the signal value;
and sending the response message to the electronic equipment, wherein the electronic equipment is equipment for sending the request message.
Further, the request message further comprises request identification information of the target ECU;
before determining the corresponding message format according to the request message identifier, the method further comprises:
judging whether the request identification information is the same as preset system identification information or not;
if yes, entering the step of determining the corresponding message format according to the request message identifier.
Further, determining the signal to be monitored based on the message format and the preset specified code includes:
determining a type of signals corresponding to each bit of character code in the preset specified code based on the message format;
if the value of the character code is a first preset value, the corresponding signal is a signal to be monitored;
if the value of the character code is a second preset value, the corresponding signal is a non-monitoring signal.
In a third aspect, an embodiment of the present application provides an apparatus for acquiring a signal value of a vehicle, which is applied to an electronic device, and includes:
the communication unit is used for sending a request message to the target ECU, wherein the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored;
the response message is generated according to a message format corresponding to the request message identifier and the signal value after the target ECU obtains the signal value of the signal to be monitored specified by the preset specification code;
and the analysis unit is used for analyzing the response message to obtain the signal value of the signal to be monitored.
In a fourth aspect, an embodiment of the present application provides an apparatus for acquiring a signal value of a vehicle, which is applied to an ECU, including:
the communication unit is used for receiving a request message, wherein the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored;
the electronic equipment is used for sending a response message to the electronic equipment, and the electronic equipment is equipment for sending the request message;
the processing unit is used for determining a corresponding message format according to the request message identifier;
the method comprises the steps of determining the signal to be monitored based on the message format and the preset specified code;
the method comprises the steps of acquiring a signal value corresponding to the signal to be monitored;
and the method is used for generating a corresponding response message based on the message format and the signal value.
In a fifth aspect, embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the method according to any one of the first aspects when executing the computer program.
In a sixth aspect, embodiments of the present application provide an electronic control unit comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the method according to any one of the second aspects above when executing the computer program.
In a seventh aspect, embodiments of the present application provide a computer-readable storage medium, including: the computer readable storage medium stores a computer program which, when executed by a processor, implements a method as described in any of the first or second aspects above.
In an eighth aspect, embodiments of the present application provide a computer program product which, when run on an electronic device, causes the electronic device to perform the method of any one of the first or second aspects above.
It will be appreciated that the advantages of the second to eighth aspects may be found in the relevant description of the first aspect, and are not repeated here.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
according to the embodiment of the application, the request message is sent to the target ECU, the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored; and receiving a response message, wherein the response message is generated by the target ECU according to a message format and a signal value corresponding to the request message identifier after obtaining the signal value of the signal to be monitored specified by the preset specified code. According to the method and the device, the ECU can monitor the appointed signal, only the signal value of the signal to be monitored is obtained, and when the ECU generates the response message, only the appointed signal value of the signal to be monitored is required to be filled, other signals are directly filled with preset values, the recovery speed and the refreshing speed are improved, and therefore the efficiency of obtaining the vehicle signal value is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
FIG. 2 is a flow chart of a method for obtaining a vehicle signal value according to an embodiment of the present application;
FIG. 3 is a flow chart of a method for obtaining a vehicle signal value according to another embodiment of the present application;
FIG. 4 is a schematic structural diagram of an apparatus for acquiring a vehicle signal value according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of an apparatus for acquiring vehicle signal values according to another embodiment of the present application;
FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic control unit according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application. Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application. The method provided by the embodiment of the application can be applied to an automobile electric control system and electronic equipment communicating with the automobile electric control system, as shown in fig. 1, the automobile electric control system comprises an on-board unit ECU10, a sensor 20, an actuator 30, a diagnosis interface 40, a bus 50 and the like, and the ECU10 is respectively connected with the sensor 20 and the actuator 30; the ECU10 and the diagnostic interface 40 are connected via the bus 50, and when a vehicle diagnosis is required, the electronic device 60 is connected to the diagnostic interface 40.
The bus 50 currently used has a local interconnect protocol LIN and a controller area network CAN, and the developing automobile bus technology has a high-speed fault-tolerant network protocol FlexRay, MOST for automobile multimedia and navigation, and wireless network technologies such as bluetooth and wireless local area network compatible with computer networks.
The ECU10 is a microcomputer controller special for the automobile, and is composed of a processor, a memory, an input/output interface, a digital-to-analog converter, and large-scale integration single paths such as shaping and driving. The ECU10 is configured to comprehensively analyze and process the electrical signals input by the sensors 20, the feedback electrical signals of a part of the actuators 30, and the signal values in the received messages, provide reference voltages for the sensors 20, and then output control signals to the actuators 30, so that the actuators 30 operate according to the control purpose and receive other ECUs. The sensor 20 is used to convert various physical parameters of the vehicle condition and state, the vehicle running condition and state into an electrical signal, and transmit the electrical signal to the ECU10. The actuator 30 is configured to control the object to operate in a set optimal state in accordance with a control signal of the ECU10.
Specifically, the ECU10 communicates with the sensor 20 and the actuator 30 by signal values. The ECU10 and the diagnostic interface 40 communicate with each other by transmitting or receiving messages containing signal values over the bus, and the electronic device 60 communicates with each other by transmitting or receiving messages containing signal values over the bus via the diagnostic interface 40. However, in the process of communication, a single message of many ECUs will contain signal values of multiple signals, and each ECU needs to acquire signal values of all signals before sending the message. If monitoring is performed on a certain signal value or certain signal values, the ECU sequentially acquires the latest data of all signals before sending a message, which may result in slow reply and untimely refreshing.
The embodiment of the application provides a method, a device, electronic equipment, an electronic control unit and a readable storage medium for acquiring a vehicle signal value, which are used for solving the problem that the existing method for acquiring the vehicle signal value is low in efficiency.
Fig. 2 is a flowchart of a method for acquiring a vehicle signal value according to an embodiment of the present application. By way of example and not limitation, the method finds particular application to an electronic device that includes a diagnostic device or ECU to enable a target ECU to monitor a specified signal according to its requirements.
As shown in fig. 2, the method includes:
s201: and sending a request message to the target ECU, wherein the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored.
As one implementation, the request message is identified in the form of an ID (Identity document identification number), and the preset specific code is in the form of a mask.
Specifically, each bit of the code in the preset designating code corresponds to a type of signal, and the code is used for designating whether the corresponding signal is a signal to be monitored or not based on a message format corresponding to the request message identifier. When the value of the character code is a first preset value, the corresponding signal is the signal to be monitored. When the value of the character code is a second preset value, the corresponding signal is a non-monitoring signal.
For example, the electronic device needs to monitor the engine temperature, and the message ID where the engine temperature is located is 220101, that is, the request message is identified as 220101. The format representation of the message comprises 4 types of signals, namely a voltage signal, a temperature signal, a rotating speed signal and an oxygen sensing signal, wherein the occupied bit number of each type of signal is 8. Based on the message format, the voltage signal is a non-monitoring signal, and the value of the corresponding character code is set to be 0; the temperature signal is a signal to be monitored, and the value of the corresponding character code is set to be 1; the rotating speed signal is a non-monitoring signal, and the value of the corresponding character code is set to be 0; the oxygen sensing signal is a non-monitoring signal, and the value of the corresponding character code is set to be 0. The preset designating code is represented as 0100000, the first is a voltage signal corresponding to 0, the second is a temperature signal corresponding to 1, the third is a rotation speed signal corresponding to 0, the fourth is an oxygen sensing signal corresponding to 0, the following 4 bits are directly filled with 0 to complement 8 bits, and the preset designating code is converted into a byte of 40.
S202: receiving a response message; the response message is generated according to the message format and the signal value corresponding to the request message identifier after the target ECU obtains the signal value of the signal to be monitored specified by the preset specified code.
The target ECU obtains the format of the stored corresponding request message according to the request message identification, and the preset specified code determines the signal to be monitored, and then only obtains the signal value of the signal to be monitored. When a response message is generated, only the signal value of the signal to be monitored is filled into the corresponding byte according to the corresponding message format, the bytes corresponding to other signals are directly filled with preset values, and then the response message is transmitted through a bus, so that the electronic equipment receives the response message.
For example, the engine ECU determines that the temperature signal is a signal to be monitored, only obtains the signal value of the temperature signal, and when a response message is generated, only fills the actual temperature value of the temperature signal according to the corresponding message format, and the values of other signals are all set to preset values.
S203: and analyzing the response message to obtain the signal value of the signal to be monitored.
According to the format of the response message, all signals in the response message are analyzed, the data of all signals are taken out, the actual signal value of the signal to be monitored is obtained, and the signal values of other signals are preset values.
Correspondingly, the electronic equipment analyzes that the response message contains 4 types of signals, and takes out the data of the 4 types of signals to obtain the engine temperature value.
In the embodiment, a request message is sent to a target ECU, wherein the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored; and receiving a response message, wherein the response message is generated according to a message format and a signal value corresponding to a request message identifier after the target ECU obtains the signal value of the signal to be monitored specified by the preset specified code, so that the ECU monitors the specified signal, only obtains the signal value of the signal to be monitored, and when the ECU generates the response message, only fills the specified signal value of the signal to be monitored, other signals are directly filled with preset values, and the recovery speed and the refreshing speed are improved, thereby improving the efficiency of obtaining the signal value of the vehicle.
In another embodiment, sending the request message to the target ECU includes:
and sending a request message to the automobile bus, wherein the request message also comprises request identification information of the target ECU. The request message is identified and processed by the request identification information so that the target ECU can identify and process the request message.
As one implementation, the request identification information is in the form of an ID. The request identification information is used to specify the target ECU to process the request message. For example, if the signal to be monitored is the engine temperature, the engine ECU is required to process the request message, the request identification information is 0xfc00, the request message is correspondingly indicated as 0xfc000422010140,0xfc00 is the ID of the engine ECU, 04 indicates that the number of the following valid bytes is 4, 220101 is the request message ID, and 40 is the preset specified code. When the electronic equipment sends a request message to the bus of the automobile, all ECUs on the bus receive and identify the request message. When the engine ECU recognizes that 0xfc corresponds to its own ID, the request message is processed, and when the other ECU recognizes that 0xfc does not correspond to its own ID, the request message is not processed.
Correspondingly, the response message also comprises response identification information and a response message identification, and the response message identification corresponds to the request message identification. As one implementation. Are all in the form of an ID. For example, if the engine ECU is the target ECU, the reply ID in the response message is 0xfd, i.e. the reply identification information is 0xfd00. The request message ID is 220101, and the corresponding response message ID is 620101, namely 620101.
And the electronic equipment receives the response message and analyzes the response message to obtain the signal value of the signal to be monitored.
Specifically, whether the ECU corresponding to the reply identification information is a target ECU is judged;
if yes, judging whether the response message identifier corresponds to the request message identifier;
if yes, the signal value is obtained from the response message.
Illustratively, according to the reply ID:0xfd00 is determined to be the reply ID of the engine. Then according to the response message ID:620101 determines and requests the message ID:220101 are corresponding in that the first byte 62 of the response message ID differs from the first byte 22 of the request message ID by 40, the other bytes being identical. And then, all signals in the response message are taken out to obtain the signal value of the temperature signal.
According to the method and the device, the request message comprises the request identification information of the ECU, so that the target ECU can be guaranteed to recognize the request message and process the request message according to the request, and other ECUs do not need to process the request message, so that the efficiency of acquiring the vehicle signal value is improved; and the response message processed by the electronic equipment can be ensured to be the message in which the signal value of the signal to be monitored is positioned by the response message identifier corresponding to the request message identifier.
Fig. 3 is a flowchart of a method for acquiring a vehicle signal value according to another embodiment of the present application. By way of example and not limitation, the method is applied to an ECU to cause the target ECU to monitor a specified signal on demand.
As shown in fig. 3, the method includes:
s301: receiving a request message; the request message comprises a request message identifier and a preset designating code, wherein the preset designating code is used for designating a signal to be monitored.
The request message identifier is used for describing a target message where the signal to be monitored is located.
For example, the signal to be monitored is the engine temperature, and the received request message is 0x0422010140, including the request message ID 0x220101 and the preset designation code 0100000.
S302: and determining a corresponding message format according to the request message identifier.
After receiving the request message, the target ECU takes out the request message identifier and the preset designating code from the message, searches the corresponding message format in the interior according to the request message identifier of the request message, and determines how many kinds of signals are contained in the message, the positions of the various signals in the message and the corresponding occupied bit number.
For example, after receiving the request message, the engine ECU determines that the message is a message where the engine temperature is located through the target message ID 0x220101, so as to find a format of the message where the corresponding engine temperature is located, and obtain that the target message includes 4 types of signals, namely, a voltage signal, a temperature signal, a rotation speed signal and an oxygen sensing signal, where each type of signal occupies 8 bits.
S303: and determining a signal to be monitored based on the message format and a preset specified code.
Specifically, based on a message format, determining a type of signal corresponding to each bit of character code in a preset designated code;
if the value of the character code is a first preset value, the corresponding signal is a signal to be monitored;
if the value of the character code is a second preset value, the corresponding signal is a non-monitoring signal.
For example, the first preset value is 1 and the second preset value is 0. The message format based on the target message comprises 4 types of signals, namely a voltage signal, a temperature signal, a rotating speed signal and an oxygen sensing signal, wherein the number of bits occupied by each type of signal is 8. Then converting the byte 40 in the message into 0100000, and determining that the voltage signal is a non-monitoring signal according to the first voltage signal which is 0 and corresponds to the voltage signal; according to the second temperature signal which is 1 and corresponds to the temperature signal, the temperature signal is determined to be a signal to be monitored, according to the third temperature signal which is 0 and corresponds to the rotating speed signal, the rotating speed signal is determined to be a signal not to be monitored, according to the fourth temperature signal which is 0 and corresponds to the oxygen sensing signal, the oxygen sensing signal is determined to be a signal not to be monitored, and the following 4 is the complement bit.
S304: and acquiring a signal value corresponding to the signal to be monitored.
The target ECU acquires a signal value of a signal to be monitored through a sensor.
S305: based on the message format and the signal value, a corresponding response message is generated.
For example, the preset value is 00. After the engine acquires the actual signal value of the temperature signal through the sensor, according to the position of the signal in the message, the first is a voltage signal, and the corresponding bytes are directly filled with 00; the second is a temperature signal, and the obtained actual signal value is converted into bytes to be filled into corresponding bytes; thirdly, a rotating speed signal, and corresponding bytes are directly filled with 00; the fourth is the oxygen sense signal, and the corresponding byte is directly padded with 00, ultimately denoted 00640000.
S306: and sending a response message to the electronic equipment, wherein the electronic equipment is equipment for sending the request message.
For example, if the electronic device is a diagnostic device, the response message is sent to the diagnostic device.
And if the electronic equipment is other ECUs, sending the response message to the other ECUs.
In the embodiment, the signal to be monitored is determined based on the message format and a preset specified code; acquiring a signal value corresponding to a signal to be monitored; based on the message format and the signal value, a corresponding response message is generated, so that the ECU can monitor specific signals, only the signal value of the signal to be monitored is obtained, and when the response message is generated, only the specific signal value of the signal to be monitored is required to be filled, other signals are directly filled with preset values, and the recovery speed and the refresh speed are improved.
In another embodiment, the request message further includes request identification information of the target ECU.
After receiving the request message, the method further comprises:
judging whether the request identification information is the same as preset system identification information or not;
if yes, the step of determining the corresponding message format according to the request message identification is entered.
As one implementation, the system identification information is in the form of an ID.
For example, the request message is denoted as 0xfc000422010140, and further includes request identification information 0 xfc. 04 indicates that there are 4 following valid bytes, 220101 is a request message identifier, and 40 is a preset specific code. After receiving the request message, the engine ECU determines that the system ID of the engine itself is 0 xfc: 0xfc is the same, and the request message is determined to be the message to be processed, and the request message is analyzed.
Correspondingly, the response message also comprises response identification information and a response message identification, wherein the response message identification corresponds to the request message identification, and the response message identification is used for describing that the response message corresponds to the request message.
As one implementation. The reply identification information and the response message identification are both in an ID form. For example, the engine ECU is a target ECU, and the response message is correspondingly indicated as 0xfd00086201014000640000, and further includes a reply ID:0xfd, namely reply identification information 0xfd00, corresponds to a response message ID of 220101: 620101, i.e. the response message identification 620101. Where 08 indicates that there are 8 following valid bytes, the first is a signal value of 00 for a voltage signal, the second is an actual signal value of 64 for a temperature signal, the third is a signal value of 00 for a rotational speed signal, and the fourth is a signal value of 00 for an oxygen sensing signal. The response message identifier 620101 is formed by adding 40 to the first byte of the request message identifier 220101, so as to correspond to the request message identifier, so that the electronic device can identify and process the response message.
The request message of the embodiment also comprises request identification information of the target ECU, so that the target ECU can identify the request message and process the request message according to the requirement; and the response message also comprises response identification information and a response message identification, wherein the response message identification corresponds to the request message identification, so that the response message processed by the electronic equipment can be ensured to be the message in which the signal value of the signal to be monitored is located.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
Fig. 4 is a schematic structural diagram of an apparatus for acquiring a vehicle signal value according to an embodiment of the present application, corresponding to the method of the above embodiment. For convenience of explanation, only portions relevant to the embodiments of the present application are shown.
As shown in fig. 4, the apparatus includes:
the communication unit 40 is configured to send a request message to the target ECU, where the request message includes a request message identifier and a preset designation code, and the preset designation code is used to designate a signal to be monitored;
the method comprises the steps that a response message is received, wherein the response message is generated according to a message format and a signal value corresponding to a request message identifier after a target ECU obtains a signal value of a signal to be monitored specified by a preset specified code;
the parsing unit 41 is configured to parse the response message to obtain a signal value of the signal to be monitored.
Each bit of character code in the preset appointed code corresponds to one type of signal, and the character code is used for appointing whether the corresponding signal is a signal to be monitored or not based on a message format corresponding to the request message identifier.
In another embodiment, the communication unit 40 is specifically configured to send a request message to the automobile bus, where the request message further includes the request identification information of the target ECU.
In another embodiment, the response message further includes reply identification information and a response message identification, where the response message identification corresponds to the request message identification;
the parsing unit 41 is specifically configured to determine whether the ECU corresponding to the reply identification information is a target ECU;
if yes, judging whether the response message identifier corresponds to the request message identifier;
if yes, the signal value is obtained from the response message.
Fig. 5 is a schematic structural diagram of an apparatus for acquiring a vehicle signal value according to another embodiment of the present application, corresponding to the method of the above-described embodiment. For convenience of explanation, only portions relevant to the embodiments of the present application are shown.
As shown in fig. 5, the apparatus includes:
the communication unit 51 is configured to receive a request packet, where the request packet includes a request packet identifier and a preset designation code, and the preset designation code is used to designate a signal to be monitored;
the electronic equipment is used for sending a response message to the electronic equipment, and the electronic equipment is equipment for sending a request message;
a processing unit 52, configured to determine a corresponding message format according to the request message identifier;
the method comprises the steps of determining a signal to be monitored based on a message format and a preset specified code;
the method comprises the steps of acquiring a signal value corresponding to a signal to be monitored;
and the method is used for generating a corresponding response message based on the message format and the signal value.
In another embodiment, the request message further includes request identification information of the target ECU;
the processing unit 52 is further configured to determine whether the request identifier information is the same as the preset system identifier information;
if yes, the step of determining the corresponding message format according to the request message identification is entered.
In another embodiment, the processing unit 52 is specifically configured to determine, based on the message format, a type of signal corresponding to each codeword in the preset specified code;
if the value of the character code is a first preset value, the corresponding signal is a signal to be monitored;
if the value of the character code is a second preset value, the corresponding signal is a non-monitoring signal.
In another embodiment, the response message further includes reply identification information and a response message identification, the response message identification corresponds to the request message identification, and the response message identification is used for describing that the response message corresponds to the request message.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 6, the electronic device of this embodiment includes: at least one processor 60 (only one is shown in fig. 6), a memory 61 and a computer program 62 stored in the memory 61 and executable on the at least one processor 60, the processor 60 implementing the steps in the various method embodiments described above as applied to an electronic device when executing the computer program 62.
The electronic device may be a computing device such as a diagnostic device for a vehicle. The electronic device may include, but is not limited to, a processor 60, a memory 61. It will be appreciated by those skilled in the art that fig. 6 is merely an example of an electronic device and is not meant to be limiting, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The processor 60 may be a central processing unit (Central Processing Unit, CPU), the processor 60 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may in some embodiments be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. The memory 61 may in other embodiments also be an external storage device of the electronic device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 61 may also include both an internal storage unit and an external storage device of the electronic device. The memory 61 is used for storing an operating system, application programs, boot loader (BootLoader), data, other programs, etc., such as program codes of the computer program. The memory 61 may also be used for temporarily storing data that has been output or is to be output.
Fig. 7 is a schematic structural diagram of an electronic control unit according to an embodiment of the present application. As shown in fig. 7, the electronic apparatus of this embodiment includes: at least one processor 70 (only one is shown in fig. 7), a memory 71 and a computer program 72 stored in the memory 71 and executable on the at least one processor 70, the processor 70 implementing the steps in the various method embodiments described above as applied to an ECU when executing the computer program 72.
The electronic device may be a computing device such as an on-board unit ECU. The electronic device may include, but is not limited to, a processor 70, a memory 71. It will be appreciated by those skilled in the art that fig. 7 is merely an example of an electronic device and is not meant to be limiting, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The processor 70 may be a central processing unit (Central Processing Unit, CPU) and the processor 70 may be other general purpose processors, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may in some embodiments be an internal storage unit of the electronic device 7, such as a hard disk or a memory of the electronic device. The memory 71 may in other embodiments also be an external storage device of the electronic device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 71 may also include both an internal storage unit and an external storage device of the electronic device. The memory 71 is used for storing an operating system, application programs, boot loader (BootLoader), data, other programs, etc., such as program codes of the computer program. The memory 71 may also be used for temporarily storing data that has been output or is to be output.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps that may implement the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that may be performed in the various method embodiments described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a camera device/electronic apparatus, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (8)

1. A method for acquiring a vehicle signal value, applied to an electronic device, comprising:
sending a request message to a target ECU, wherein the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored;
receiving a response message, wherein the response message is generated according to a message format corresponding to the request message identifier and the signal value after the target ECU obtains the signal value of the signal to be monitored specified by the preset specification code;
analyzing the response message to obtain the signal value of the signal to be monitored;
each bit of the code in the preset designating code corresponds to a type of signal, and the code is used for designating whether the corresponding signal is a signal to be monitored or not based on a message format corresponding to the request message identifier.
2. The method of claim 1, wherein the sending the request message to the target ECU comprises:
and sending the request message to an automobile bus, wherein the request message also comprises request identification information of the target ECU.
3. The method of claim 1, wherein the response message further comprises reply identification information and a response message identification, the response message identification corresponding to the request message identification;
analyzing the response message to obtain the signal value of the signal to be monitored, including:
judging whether the ECU corresponding to the reply identification information is the target ECU or not;
if yes, judging whether the response message identifier corresponds to the request message identifier;
if yes, the signal value is obtained from the response message.
4. A method of acquiring a vehicle signal value, applied to an ECU, comprising:
receiving a request message, wherein the request message comprises a request message identifier and a preset designating code, and the preset designating code is used for designating a signal to be monitored;
determining a corresponding message format according to the request message identifier;
determining a type of signals corresponding to each bit of character code in the preset specified code based on the message format;
if the value of the character code is a first preset value, the corresponding signal is a signal to be monitored;
if the value of the character code is a second preset value, the corresponding signal is a non-monitoring signal;
acquiring a signal value corresponding to the signal to be monitored;
generating a corresponding response message based on the message format and the signal value;
and sending the response message to the electronic equipment, wherein the electronic equipment is equipment for sending the request message.
5. The method of claim 4, wherein the request message further includes request identification information of the target ECU;
before determining the corresponding message format according to the request message identifier, the method further comprises:
judging whether the request identification information is the same as preset system identification information or not;
if yes, entering the step of determining the corresponding message format according to the request message identifier.
6. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 3 when executing the computer program.
7. An electronic control unit comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 4 to 5 when executing the computer program.
8. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method of any one of claims 1 to 3 or any one of claims 4 to 5.
CN202110931726.7A 2021-08-13 2021-08-13 Method for acquiring vehicle signal value, electronic equipment and electronic control unit Active CN113608483B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110931726.7A CN113608483B (en) 2021-08-13 2021-08-13 Method for acquiring vehicle signal value, electronic equipment and electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110931726.7A CN113608483B (en) 2021-08-13 2021-08-13 Method for acquiring vehicle signal value, electronic equipment and electronic control unit

Publications (2)

Publication Number Publication Date
CN113608483A CN113608483A (en) 2021-11-05
CN113608483B true CN113608483B (en) 2023-05-09

Family

ID=78308541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110931726.7A Active CN113608483B (en) 2021-08-13 2021-08-13 Method for acquiring vehicle signal value, electronic equipment and electronic control unit

Country Status (1)

Country Link
CN (1) CN113608483B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114285633B (en) * 2021-12-23 2024-03-29 深圳供电局有限公司 Computer network security monitoring method and system
CN114513475B (en) * 2022-02-15 2024-03-19 一汽解放汽车有限公司 Message interaction method, device, controller, storage medium and program product
CN114942623B (en) * 2022-05-31 2024-07-09 中国第一汽车股份有限公司 Method and device for testing controller, vehicle and computer readable storage medium
CN115134186A (en) * 2022-06-29 2022-09-30 深圳市元征科技股份有限公司 Data processing method and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103458039A (en) * 2013-09-06 2013-12-18 北京经纬恒润科技有限公司 Message generation method, mobile terminal, communication server and message generation system
CN104104568A (en) * 2013-04-02 2014-10-15 上海通用汽车有限公司 Method, device and system for acquiring data from communication bus
CN112187790A (en) * 2020-09-27 2021-01-05 北京罗克维尔斯科技有限公司 Signal identifier generation method, message transmission method and device

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR200178225Y1 (en) * 1999-10-25 2000-04-15 주식회사유림기연 System for car self diagnosis
JP2007058344A (en) * 2005-08-22 2007-03-08 Fujitsu Ten Ltd Vehicle diagnosis system, vehicle information transmission apparatus and vehicle information transmission method
CN101853020A (en) * 2010-05-25 2010-10-06 金龙联合汽车工业(苏州)有限公司 Vehicle running information acquisition device based on CAN (Controller Area Network) bus
CN102809962B (en) * 2012-09-03 2015-10-21 同济汽车设计研究院有限公司 Vehicle carried data collecting terminal and vehicle information acquisition system
CN103809579B (en) * 2012-11-08 2018-01-02 厦门雅迅网络股份有限公司 By the method for each car status information of center extraction
CN103391316A (en) * 2013-07-09 2013-11-13 潍柴动力股份有限公司 Vehicle remote terminal and client-side monitoring method and device and vehicle remote monitoring system
CN110162008B (en) * 2019-05-10 2021-05-28 中国汽车技术研究中心有限公司 CAN bus analysis method for new energy vehicle
CN110850849B (en) * 2019-11-30 2022-09-09 航天科技控股集团股份有限公司 Fault code reporting method for realizing compatibility with multiple vehicle types by using mask code
CN113542333B (en) * 2020-04-22 2023-12-29 广州汽车集团股份有限公司 Method for monitoring vehicle signals
CN111880510A (en) * 2020-06-28 2020-11-03 东风汽车集团有限公司 New energy automobile data acquisition and transmission method and equipment
CN113141306A (en) * 2021-04-15 2021-07-20 常州易控汽车电子股份有限公司 Diagnostic message routing method and bus routing equipment thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104104568A (en) * 2013-04-02 2014-10-15 上海通用汽车有限公司 Method, device and system for acquiring data from communication bus
CN103458039A (en) * 2013-09-06 2013-12-18 北京经纬恒润科技有限公司 Message generation method, mobile terminal, communication server and message generation system
CN112187790A (en) * 2020-09-27 2021-01-05 北京罗克维尔斯科技有限公司 Signal identifier generation method, message transmission method and device

Also Published As

Publication number Publication date
CN113608483A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
CN113608483B (en) Method for acquiring vehicle signal value, electronic equipment and electronic control unit
US8983714B2 (en) Failsafe communication system and method
US11032300B2 (en) Intrusion detection system based on electrical CAN signal for in-vehicle CAN network
CN107113214B (en) Abnormality detection electronic control unit, vehicle-mounted network system, and communication method
US20190140778A1 (en) Information processing method, information processing system, and recording medium
RU2712138C2 (en) Method, system and electronic control unit for prevention of spoofing in automotive network
CN113852563B (en) Message data transmission method and device, terminal equipment and readable storage medium
CN113645097A (en) Vehicle signal monitoring method, terminal equipment and electronic control unit
US12052371B2 (en) Method for monitoring a network
CN113489653B (en) Message sending method and device and computer equipment
CN112445630B (en) Information interaction method and device and terminal equipment
CN112558584B (en) Diagnostic data acquisition method and device and diagnostic equipment
CN114089713A (en) Communication method based on UDS, ECU and upper computer
US7466757B2 (en) Method for transmitting data on a bus
CN113872967A (en) Vehicle information transmission method and device, electronic equipment and storage medium
CN115603975B (en) Message intrusion detection method and device, electronic equipment and storage medium
CN114756585A (en) Vehicle data acquisition method and device, electronic equipment and storage medium
CN113799601B (en) Input control method and device for vehicle-mounted LCD display screen, medium and automobile
CN110177032B (en) Message routing quality monitoring method and gateway controller
CN114326673A (en) Vehicle remote diagnosis method and device, connector and storage medium
JP7100558B2 (en) Electronic control device for automobiles
CN114900390B (en) Data transmission method, device, electronic equipment and storage medium
US11283702B1 (en) Vehicle status detecting apparatus and vehicle status detecting method thereof
CN113703868B (en) Vehicle diagnosis software configuration method, electronic device and readable storage medium
CN115834281B (en) Data transmission method, device, electronic 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