CN114221890B - Message simulation device, message sending method and device and computer storage medium - Google Patents

Message simulation device, message sending method and device and computer storage medium Download PDF

Info

Publication number
CN114221890B
CN114221890B CN202111521382.9A CN202111521382A CN114221890B CN 114221890 B CN114221890 B CN 114221890B CN 202111521382 A CN202111521382 A CN 202111521382A CN 114221890 B CN114221890 B CN 114221890B
Authority
CN
China
Prior art keywords
message
information
control switch
transfer instruction
instruction
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
CN202111521382.9A
Other languages
Chinese (zh)
Other versions
CN114221890A (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.)
Chery Automobile Co Ltd
Original Assignee
Chery Automobile Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chery Automobile Co Ltd filed Critical Chery Automobile Co Ltd
Priority to CN202111521382.9A priority Critical patent/CN114221890B/en
Publication of CN114221890A publication Critical patent/CN114221890A/en
Application granted granted Critical
Publication of CN114221890B publication Critical patent/CN114221890B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The embodiment of the application discloses a message simulation device, a message sending method, a message sending device and a computer storage medium, and belongs to the technical field of vehicle engineering. The message simulation device comprises information processing equipment and a CAN module; the information processing equipment is in communication connection with the CAN module and is used for acquiring the control switch information of the target automobile and the analog quantity of each sensor of the target automobile sent by the terminal, processing the control switch information and the analog quantity of each sensor into a CAN message and sending the CAN message to the CAN module; the CAN module is used for transmitting the CAN message to a CAN bus of the target automobile after receiving the CAN message transmitted by the information processing equipment. According to the embodiment of the application, the hardware switch corresponding to the control switch in the message simulation device CAN be canceled, so that the message simulation device CAN expand the CAN message, the message expansion cost is reduced, and the flexibility of the message simulation device is improved.

Description

Message simulation device, message sending method and device and computer storage medium
Technical Field
The embodiment of the application relates to the technical field of vehicle engineering, in particular to a message simulation device, a message sending method, a message sending device and a computer storage medium.
Background
With the development of automobile technology, the functions of automobiles are more and more, and information among various electric systems in automobiles is more and more frequently transmitted. The electric systems of the automobile are communicated by adopting a CAN (Controller Area Network ) bus, thousands of information flows are arranged on the CAN bus at time, in the whole automobile development stage, the electric systems of the automobile do not form a complete communication network, and the ECUs of the electric systems are required to receive CAN message information from the bus at time in the test stage, so that the message simulation device of the CAN bus signal is applied.
At present, a message simulation device of the CAN bus signal is a pure hardware device, and hardware switches of all control switches required by testing are integrated on the message simulation device.
However, as the electrical functions of the automobile are more and more abundant, the number of CAN message frames on the CAN bus is also expanded, but because the message simulation device is a pure hardware device, the expansion cannot be performed on the message simulation device, the flexibility of the message simulation device is reduced, and a new message simulation device may need to be manufactured again, so that the message expansion cost is increased.
Disclosure of Invention
The embodiment of the application provides a message simulation device, a message sending method, a message sending device and a computer storage medium, which can solve the problems of high expansion cost and poor expansion flexibility of the message simulation device in the related technology. The technical scheme is as follows:
in one aspect, a message simulation device is provided, where the message simulation device includes an information processing device and a controller area network CAN module;
the information processing equipment is in communication connection with the CAN module, and is used for acquiring the control switch information of a target automobile and the analog quantity of each sensor of the target automobile, which are sent by a terminal, processing the control switch information and the analog quantity of each sensor into a CAN message, and sending the CAN message to the CAN module, wherein the target automobile is any automobile in a test stage;
and the CAN module is used for transmitting the CAN message to the CAN bus of the target automobile after receiving the CAN message transmitted by the information processing equipment.
In some embodiments, the information processing device can be a single chip microcomputer;
the singlechip is in communication connection with the terminal through a communication serial port of the singlechip, and the singlechip is in communication connection with the CAN module through SPI (Serial Peripheral Interface ).
In some embodiments, the CAN module CAN be a CAN protocol controller.
In some embodiments, the model number of the CAN protocol controller is MCP2515.
On the other hand, a message sending method is provided, the method is applied to the message simulation device in the aspect, and the method includes:
acquiring control switch information of a target automobile and sensor analog quantity of the target automobile, wherein the control switch information and the sensor analog quantity are sent by a terminal, and the target automobile is any automobile in a test stage;
processing the information of each control switch and the analog quantity of each sensor into a CAN message;
and sending the CAN message to a CAN bus of the target automobile.
In some embodiments, the processing the respective control switch information and the respective sensor analog to a CAN message includes:
writing the control switch information and the sensor analog quantity into corresponding positions of at least one CAN message structure body to obtain at least one CAN message, wherein the at least one CAN message structure body is a message structure body stored in the message simulation device.
In some embodiments, the acquiring the control switch information of the target automobile and the sensor analog quantity of the target automobile sent by the terminal includes:
receiving an information transfer instruction sent by the terminal;
checking the information transfer instruction;
and when the information transfer instruction passes the verification, acquiring the information of each control switch and the analog quantity of each sensor carried in the information transfer instruction.
In some embodiments, the method further comprises:
when a message change instruction sent by the terminal is received, acquiring a changed message structure body from the message change instruction;
and updating the stored CAN message structure according to the changed message structure.
In another aspect, a message sending device is provided, where the device is applied to the message simulation device in the above aspect, and the message sending device includes:
the first acquisition module is used for acquiring the control switch information of the target automobile and the analog quantity of each sensor of the target automobile, which are sent by the terminal, wherein the target automobile is any automobile in a test stage;
the processing module is used for processing the control switch information and the sensor analog quantity into CAN messages;
and the sending module is used for sending the CAN message to the CAN bus of the target automobile.
In some embodiments, the processing module is to:
writing the control switch information and the sensor analog quantity into corresponding positions of at least one CAN message structure body to obtain at least one CAN message, wherein the at least one CAN message structure body is a message structure body stored in the message simulation device.
In some embodiments, the first acquisition module comprises:
the receiving sub-module is used for receiving the information transfer instruction sent by the terminal;
the verification sub-module is used for verifying the information transfer instruction;
and the acquisition sub-module is used for acquiring the control switch information and the sensor analog quantity carried in the information transfer instruction when the information transfer instruction passes the verification.
In some embodiments, the message sending device further includes:
the second acquisition module is used for acquiring a changed message structure body from the message change instruction when receiving the message change instruction sent by the terminal;
and the updating module is used for updating the stored CAN message structure according to the changed message structure.
In another aspect, a computer readable storage medium is provided, on which instructions are stored, which when executed by a processor implement any of the steps of the messaging method provided in the above aspect.
The beneficial effects that technical scheme that this application embodiment provided include at least:
in the embodiment of the application, because the information processing equipment in the message simulation device CAN process the control switch information and the sensor analog quantity sent by the terminal into the CAN message, the hardware switch corresponding to the control switch in the message simulation device CAN be canceled, and the message simulation device CAN be ensured to expand the CAN message, thereby reducing the expansion cost of the message simulation device and improving the flexibility of the message simulation device.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and 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 illustration of an implementation environment provided by embodiments of the present application;
fig. 2 is a schematic structural diagram of a message simulation device according to an embodiment of the present application;
FIG. 3 is a schematic diagram of another message emulation device according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a method for sending a message according to an embodiment of the present application;
FIG. 5 is a flowchart of another method for sending a message according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a message sending device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a first obtaining module according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another message sending device according to an embodiment of the present application.
Reference numerals:
101: message simulation device, 102: a terminal;
1: information processing apparatus, 2: and a CAN module.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Before explaining the embodiments of the present application in detail, an implementation environment provided by the embodiments of the present application is explained.
Fig. 1 is a schematic diagram of an implementation environment provided in an embodiment of the present application, and referring to fig. 1, the implementation environment includes a message simulation device 101 and a terminal 102. The message simulation device 101 is in communication connection with the terminal 102. The terminal 102 is a device for providing services to the message-simulating device 101, and may be a smart phone, a tablet computer, a notebook computer or a desktop computer. The terminal 102 may also be referred to by other names, such as user equipment, portable terminals, laptop terminals, desktop terminals, etc., as the embodiments of the present application are not limited in this regard.
In one possible implementation manner, the terminal 102 can send, to the message simulation device 101, information of each control switch of the target automobile and each sensor analog of the target automobile; the message simulation device 101, after receiving the control switch information and the sensor analog quantity sent by the terminal, CAN process the control switch information and the sensor analog quantity into a CAN message, and send the CAN message to the CAN bus of the target automobile.
Those skilled in the art will appreciate that the above-described message-simulating apparatus 101 and the terminal 102 are only examples, and that other devices that may be present in the present application or in the future are also included in the scope of the present application and are incorporated herein by reference.
Next, a detailed explanation will be given of the message simulation device and the message sending method provided in the embodiments of the present application, which are divided into a plurality of embodiments.
Fig. 2 is a schematic structural diagram of a message simulation device provided in an embodiment of the present application, referring to fig. 2, the message simulation device 101 includes an information processing apparatus 1 and a controller area network CAN module 2; the information processing equipment 1 is in communication connection with the CAN module 2, the information processing equipment 1 is used for acquiring the control switch information of the target automobile and the analog quantity of each sensor of the target automobile, which are sent by the terminal 102, processing the control switch information and the analog quantity of each sensor into a CAN message, and sending the CAN message to the CAN module 2, wherein the target automobile is any automobile in a test stage; the CAN module 2 is used for sending the CAN message to the CAN bus of the target automobile after receiving the CAN message sent by the information processing equipment 1.
In the embodiment of the application, because the information processing equipment in the message simulation device CAN process the information of each control switch and the analog quantity of each sensor sent by the terminal into the CAN message, the hardware switch corresponding to the control switch in the message simulation device CAN be canceled, and the message simulation device CAN be ensured to expand the CAN message, thereby reducing the message expansion cost of the message simulation device and improving the flexibility of the message simulation device.
In some embodiments, at least one CAN message structure body CAN be stored in the information processing apparatus 1 in advance, so when the information processing apparatus 1 obtains each piece of control switch information and each piece of sensor analog quantity sent by the terminal 102, each piece of control switch information and each piece of sensor analog quantity CAN be written into a corresponding position of the CAN message structure body, and a corresponding CAN message is obtained.
As an example, since the length of each CAN message is limited, all control switch information and sensor analog quantity may not be written in one CAN message structure, and thus the information processing apparatus 1 CAN write the remaining information in the other CAN message structure after one CAN message structure is full.
As an example, the information processing apparatus 1 does not necessarily write the respective control switch information and the respective sensor analog quantities into the same CAN message structure when writing the respective control switch information and the respective sensor analog quantities into at least one CAN message structure. That is, when the information processing apparatus 1 writes the respective control switch information and the respective sensor analog values into the corresponding bits of the corresponding bytes of the corresponding messages, since the messages corresponding to the different control switch information and the different sensor analog values may be different, the information processing apparatus 1 may write the respective control switch information and the respective sensor analog values into at least one CAN message structure, thereby obtaining at least one CAN message, and transmit the at least one CAN message to the CAN module 2.
In some embodiments, different message structures may be stored in the information processing apparatus 1, and for the different message structures, an instruction identifier for communicating with the terminal 102 may be provided in the information processing apparatus 1, where the instruction identifier is used to indicate the message structure to which each control switch information and each sensor analog quantity sent by the terminal 102 are written.
In some embodiments, the information processing apparatus 1 can set the instruction identifier corresponding to the message structure body for communication with the terminal 102 after setting the message structure body. That is, when the information processing apparatus 1 receives a message change instruction transmitted from the terminal 102, it is able to acquire a changed message structure from the message change instruction; and updating the stored CAN message structure according to the changed message structure. And then generating an instruction identifier corresponding to the updated message structure body.
The information processing apparatus 1 CAN directly store the changed message structure to obtain a new CAN message structure, thereby increasing the number of message structures stored in the information processing apparatus 1. Alternatively, the information processing apparatus 1 CAN also cover or replace the previously stored CAN message structure with the changed message structure to obtain a new CAN message structure.
In some embodiments, the information processing apparatus 1 can acquire the respective control switch information and the respective sensor analog quantities by receiving the information transfer instruction transmitted from the terminal 102. That is, the information processing apparatus 1 can receive the information transfer instruction transmitted from the terminal 102, and acquire the respective control switch information and the respective sensor analog amounts carried by the information transfer instruction from the information transfer instruction.
In some embodiments, in order to ensure the safety of the message simulation device 101 and the target automobile, the information processing apparatus 1 is further capable of checking the information transfer instruction after receiving the information transfer instruction sent by the terminal 102; when the information transfer instruction passes the verification, the information processing apparatus 1 acquires the respective control switch information and the respective sensor analog quantities carried in the information transfer instruction.
As an example, the information processing apparatus 1 can verify the information delivery instruction according to whether or not the instruction format of the information delivery instruction conforms to the specified instruction format, and when the instruction format of the information delivery instruction conforms to the specified instruction format, determine that the information delivery instruction passes the verification; when the instruction format of the information transfer instruction does not accord with the designated instruction format, the information transfer instruction is determined to pass the verification.
In some embodiments, the information processing apparatus 1 may further perform verification on the information transfer instruction by other manners, for example, the information processing apparatus 1 may detect whether the information transfer instruction carries a specified verification identifier, determine that the information transfer instruction passes the verification when the information transfer instruction carries the specified verification identifier, and determine that the information transfer instruction fails the verification when the information transfer instruction does not carry the specified verification identifier.
It should be noted that, the specified instruction format and the specified check identifier can be set in advance according to the requirement.
In some embodiments, when the information transfer instruction fails the verification, the information processing apparatus 1 CAN return a hint information to the terminal 102 to hint that the information transfer instruction fails the verification, while not performing the operation of writing the respective control switch information and the respective sensor analog quantities to the CAN message structure.
In some embodiments, the CAN module 2 is capable of tracking the CAN bus of the target car and sending CAN messages to the CAN bus of the target car when it is detected that the CAN bus of the target car is idle.
As an example, since the CAN module 2 may receive at least one CAN message sent by the information processing apparatus 1, the CAN module 2 CAN randomly select one CAN message to send the CAN message to the CAN bus of the target automobile, or the CAN module 2 CAN send the CAN message to the CAN bus of the target automobile according to the priority of the at least one CAN message.
Referring to fig. 3, the information processing apparatus 1 can be a single chip microcomputer 11; the single chip microcomputer 11 is in communication connection with the terminal 102 through a communication serial port (Tx and Rx in fig. 3) of the single chip microcomputer 11, and the single chip microcomputer 11 is in communication connection with the CAN module 2 through a serial peripheral interface SPI (VCC, GND, CS, CO, SI, SCK, INT in fig. 3).
Since the information processing apparatus 1 can be the single chip microcomputer 11, when the single chip microcomputer stores the changed message structure, the changed message structure can be added to the timing terminal function of the single chip microcomputer 11.
Referring to fig. 3, the CAN module 2 CAN be a CAN protocol controller 21.
It should be noted that, the CAN protocol controller 21 CAN be communicatively connected to the single chip microcomputer 11 through an SPI (VCC, GND, CS, CO, SI, SCK, INT in fig. 2).
In some embodiments, the model of the CAN protocol controller CAN be MCP2515. Of course, other models are possible, and the embodiment of the present application is not limited thereto.
In some embodiments, the CAN module 2 CAN further comprise a CAN bus transceiver, with which CAN module 2 CAN be communicatively connected. I.e. CAN module 2 CAN be connected to the CAN bus via two outputs CANH and CANL of the CAN bus transceiver.
As an example, the state of the CANH terminal is a high level state or a floating state, and the state of the CANL terminal is a low level state or a floating state.
Note that the model of the CAN bus transceiver CAN be TJA1050 or 82C250, but it is needless to say that the present embodiment is not limited thereto.
In the embodiment of the application, the message simulation device CAN include the information processing equipment, and the information processing equipment CAN write the control switch information and the sensor analog quantity sent by the terminal into at least one CAN message structure body, so that at least one CAN message is obtained, and therefore, a hardware switch corresponding to the control switch in the message simulation device CAN be canceled. And because the information processing equipment CAN expand and change the stored message structure body according to the instruction of the terminal, the message simulation device CAN be ensured to expand the CAN message, thereby reducing the message expansion cost of the message simulation device and improving the flexibility of the message simulation device.
Fig. 4 is a flowchart of a method for sending a message, where the method for sending a message may include the following steps:
step 401: and acquiring information of each control switch of the target automobile and each sensor analog quantity of the target automobile, which are sent by the terminal, wherein the target automobile is any automobile in a test stage.
Step 402: and processing the information of each control switch and the analog quantity of each sensor into a CAN message.
Step 403: and sending the CAN message to a CAN bus of the target automobile.
In the embodiment of the application, as the message simulation device CAN process each piece of control switch information and each piece of sensor analog quantity sent by the terminal into the CAN message, a hardware switch corresponding to the control switch in the message simulation device CAN be canceled, and the message simulation device CAN be ensured to expand the CAN message, so that the message expansion cost of the message simulation device is reduced, and the flexibility of the message simulation device is improved.
In some embodiments, processing the respective control switch information and the respective sensor analog into a CAN message includes:
writing the control switch information and the sensor analog quantity into the corresponding position of at least one CAN message structure body to obtain at least one CAN message, wherein the at least one CAN message structure body is a message structure body stored in the message simulation device.
In some embodiments, obtaining information of each control switch of a target automobile and each sensor analog of the target automobile sent by a terminal includes:
receiving an information transfer instruction sent by the terminal;
checking the information transfer instruction;
and when the information transfer instruction passes the verification, acquiring the information of each control switch and the analog quantity of each sensor carried in the information transfer instruction.
In some embodiments, the method further comprises:
when a message change instruction sent by the terminal is received, acquiring a changed message structure body from the message change instruction;
and updating the stored CAN message structure according to the changed message structure.
All the above optional technical solutions may be combined according to any choice to form an optional embodiment of the present application, which is not described in detail herein.
Fig. 5 is a flowchart of a message sending method provided in the embodiment of the present application, where the embodiment is illustrated by applying the message sending method to the message simulation apparatus shown in any one of fig. 1 to 3, and the message sending method may include the following steps:
step 501: the message simulation device acquires information of each control switch of the target automobile and analog quantity of each sensor of the target automobile, wherein the information is sent by the terminal, and the target automobile is any automobile in a test stage.
As an example, the message simulation device can acquire the respective control switch information and the respective sensor analog quantity by receiving the information transfer instruction transmitted by the terminal. That is, the message simulation device can receive the information transfer instruction sent by the terminal, and acquire the control switch information and the sensor analog quantity carried by the information transfer instruction from the information transfer instruction.
In some embodiments, in order to ensure the safety of the message simulation device and the target automobile, the message simulation device is further capable of checking the information transfer instruction after receiving the information transfer instruction sent by the terminal; and when the information transfer instruction passes the verification, acquiring the information of each control switch and each sensor analog carried in the information transfer instruction.
As an example, the message simulation device can verify the information transfer instruction according to whether the instruction format of the information transfer instruction accords with the specified instruction format, and when the instruction format of the information transfer instruction accords with the specified instruction format, the information transfer instruction is determined to pass the verification; when the instruction format of the information transfer instruction does not accord with the designated instruction format, the information transfer instruction is determined to pass the verification.
In some embodiments, the message emulation device can also check the information transfer instruction in other manners, for example, the message emulation device can detect whether the information transfer instruction carries a specified check identifier, determine that the information transfer instruction passes the check when the information transfer instruction carries the specified check identifier, and determine that the information transfer instruction fails the check when the information transfer instruction does not carry the specified check identifier.
It should be noted that, the specified instruction format and the specified check identifier can be set in advance according to the requirement.
As can be seen from the above, the message simulation device can include the information processing apparatus, so that the message simulation device can obtain the control switch information of the target automobile and the sensor analog quantity of the target automobile sent by the terminal through the information processing apparatus.
In some embodiments, when the information transfer instruction fails the verification, the message emulation device can return a prompt message to the terminal, so as to prompt that the information transfer instruction fails the verification, and at the same time, does not perform the operation of step 502 described below.
Step 502: the message simulation device processes the information of each control switch and the analog quantity of each sensor into a CAN message.
Because the information in the target automobile is transmitted in the CAN bus, the message simulation device processes the information of each control switch and the analog quantity of each sensor into a CAN message.
As an example, at least one CAN message structure body CAN be stored in the message simulation device in advance, so the operation of the message simulation device for processing each control switch information and each sensor analog quantity into a CAN message at least includes: writing the information of each control switch and the analog quantity of each sensor into the corresponding position of at least one CAN message structure body to obtain at least one corresponding CAN message.
As an example, because each CAN message has a limited length, it may not be possible to write all control switch information and sensor analog values in one CAN message structure, and thus the message simulation device CAN write the remaining information into the other CAN message structure after one CAN message structure is full.
As an example, the message emulation device does not necessarily write the respective control switch information and the respective sensor analog to the same CAN message structure when writing the respective control switch information and the respective sensor analog to at least one CAN message structure. That is, when the message simulation device writes the control switch information and the sensor analog quantities into the corresponding bits of the corresponding bytes of the corresponding messages, the messages corresponding to the control switch information and the sensor analog quantities may be different, so the message simulation device may write the control switch information and the sensor analog quantities into at least one CAN message structure body, thereby obtaining at least one CAN message.
In some embodiments, different message structures may be stored in the message simulation device, and for the different message structures, an instruction identifier for communicating with the terminal may be provided in the message simulation device, where the instruction identifier is used to indicate the message structure to which each control switch information and each sensor analog sent by the terminal are written.
The message simulation device CAN process the control switch information and the sensor analog quantity into a CAN message through the information processing equipment.
In some embodiments, the message simulation device can set an instruction identifier corresponding to the message structure body and communicating with the terminal after setting the message structure body. Namely, when the message simulation device receives a message change instruction sent by the terminal, the message structure body after the change can be obtained from the message change instruction; and updating the stored CAN message structure according to the changed message structure. And then generating an instruction identifier corresponding to the updated message structure body.
The message simulation device CAN directly store the changed message structure body to obtain a new CAN message structure body, thereby increasing the number of message structure bodies stored in the message simulation device. Alternatively, the message simulation device CAN also cover or replace the previously stored CAN message structure with the altered message structure to obtain a new CAN message structure.
Note that, the message simulation device updates the message structure by the information processing apparatus as well.
Step 503: and the message simulation device sends the CAN message to a CAN bus of the target automobile.
From the above, the message simulation device further includes a CAN module, so that the message simulation device CAN send a CAN message to the target automobile bus through the CAN module. Because the CAN module CAN receive at least one CAN message sent by the information processing equipment, the CAN module CAN send at least one CAN message to the target automobile bus.
In some embodiments, the CAN module is capable of tracking a CAN bus of the target car, and when detecting that the CAN bus of the target car is idle, sending a CAN message to the CAN bus of the target car.
As an example, since the CAN module may receive at least one CAN message sent by the information processing device, the CAN module CAN randomly select one CAN message to send the CAN message to the CAN bus of the target automobile, or the CAN module CAN send the CAN message to the CAN bus of the target automobile according to the priority of the at least one CAN message.
In the embodiment of the present application, the message simulation device may include an information processing apparatus, and the information processing apparatus may write, into at least one CAN message structure body, information of each control switch and analog quantity of each sensor sent by the terminal, so as to obtain at least one CAN message, so that a hardware switch corresponding to the control switch in the message simulation device may be omitted. And because the information processing equipment CAN expand and change the stored message structure body according to the instruction of the terminal, the message simulation device CAN be ensured to expand the CAN message, thereby reducing the message expansion cost of the message simulation device and improving the flexibility of the message simulation device.
Fig. 6 is a schematic structural diagram of a message sending device according to an embodiment of the present application, where the message sending device may be implemented by software, hardware, or a combination of both. The message sending device is applied to the message simulation device shown in any one of the figures 1-3, and comprises: a first acquisition module 601, a processing module 602 and a sending module 603.
The first obtaining module 601 is configured to obtain information of each control switch of a target automobile and analog quantities of each sensor of the target automobile, where the target automobile is any automobile in a testing stage;
the processing module 602 is configured to process the control switch information and the sensor analog values into a CAN message;
and the sending module 603 is configured to send the CAN message to a CAN bus of the target automobile.
In some embodiments, the processing module 602 is configured to:
writing the control switch information and the sensor analog quantity into the corresponding position of at least one CAN message structure body to obtain at least one CAN message, wherein the at least one CAN message structure body is a message structure body stored in the message simulation device.
In some embodiments, referring to fig. 7, the first acquisition module 601 includes:
a receiving submodule 6011, configured to receive an information transfer instruction sent by the terminal;
a verification submodule 6012 for verifying the information transfer instruction;
and the acquiring submodule 6013 is used for acquiring the control switch information and the sensor analog quantity carried in the information transfer instruction when the information transfer instruction passes the verification.
In some embodiments, referring to fig. 8, the message sending apparatus further includes:
a second obtaining module 604, configured to obtain, when receiving a message change instruction sent by the terminal, a changed message structure body from the message change instruction;
and the updating module 605 is configured to update the stored CAN message structure according to the changed message structure.
In the embodiment of the present application, the message simulation device may include an information processing apparatus, and the information processing apparatus may write, into at least one CAN message structure body, information of each control switch and analog quantity of each sensor sent by the terminal, so as to obtain at least one CAN message, so that a hardware switch corresponding to the control switch in the message simulation device may be omitted. And because the information processing equipment CAN expand and change the stored message structure body according to the instruction of the terminal, the message simulation device CAN be ensured to expand the CAN message, thereby reducing the message expansion cost of the message simulation device and improving the flexibility of the message simulation device.
It should be noted that: in the message sending device provided in the above embodiment, when sending a message, only the division of the above functional modules is used for illustration, in practical application, the above functional allocation may be completed by different functional modules according to needs, that is, the internal structure of the message sending device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the message sending device and the message sending module provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the message sending device and the message sending module are detailed in the method embodiment and are not repeated herein.
The embodiment of the application also provides a non-transitory computer readable storage medium, when the instructions in the storage medium are executed by the processor of the message simulation device, the message simulation device can execute the message sending method provided by the embodiment.
The embodiment of the application also provides a computer program product containing instructions, which when run on the message simulation device, cause the message simulation device to execute the message sending method provided by the embodiment.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments is merely illustrative of the present application and is not intended to limit the embodiments of the present application, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the embodiments of the present application are intended to be included within the scope of the present application.

Claims (10)

1. The message simulation device is characterized by comprising information processing equipment and a controller area network CAN module;
the information processing equipment is in communication connection with the CAN module, and is used for receiving an information transfer instruction sent by a terminal, checking the information transfer instruction, acquiring each control switch information of a target automobile and each sensor analog of the target automobile when the information transfer instruction passes the check, processing each control switch information and each sensor analog into a CAN message, and sending the CAN message to the CAN module, wherein the target automobile is any automobile in a test stage;
the information processing equipment is used for checking the information transfer instruction according to whether the instruction format of the information transfer instruction accords with the specified instruction format, and when the instruction format of the information transfer instruction accords with the specified instruction format, the information transfer instruction is determined to pass the check; when the instruction format of the information transfer instruction is not consistent with the designated instruction format, determining that the information transfer instruction fails verification; or the information processing equipment is used for detecting whether the information transfer instruction carries a specified check mark or not, when the information transfer instruction carries the specified check mark, determining that the information transfer instruction passes the check, and when the information transfer instruction does not carry the specified check mark, determining that the information transfer instruction does not pass the check;
the information processing equipment is provided with different message structures, and for the different message structures, the information processing equipment is provided with an instruction identifier communicated with the terminal, wherein the instruction identifier is used for indicating the message structure written by each control switch information and each sensor analog quantity sent by the terminal, and when the information processing equipment is used for receiving a message change instruction sent by the terminal, the information processing equipment acquires the changed message structure from the message change instruction; updating the stored message structure according to the changed message structure, and generating an instruction identifier corresponding to the updated message structure; the CAN module is used for sending the CAN message to the CAN bus of the target automobile when the CAN bus of the target automobile is detected to be idle after receiving the CAN message sent by the information processing equipment;
and when the information transfer instruction fails to pass the verification, the information processing equipment returns prompt information to the terminal so as to prompt that the information transfer instruction fails to pass the verification.
2. The message simulation device according to claim 1, wherein the information processing apparatus can be a single chip microcomputer;
the singlechip is in communication connection with the terminal through a communication serial port of the singlechip, and the singlechip is in communication connection with the CAN module through a serial peripheral interface SPI.
3. The message emulation device of claim 1 or 2, wherein the CAN module CAN be a CAN protocol controller.
4. The message emulation device of claim 3, wherein the CAN protocol controller is model number MCP2515.
5. A method for sending a message, wherein the method is applied to the message simulation device of any one of claims 1 to 4, and the method comprises:
acquiring control switch information of a target automobile and sensor analog quantity of the target automobile, wherein the control switch information and the sensor analog quantity are sent by a terminal, and the target automobile is any automobile in a test stage;
processing the information of each control switch and the analog quantity of each sensor into a CAN message;
and sending the CAN message to a CAN bus of the target automobile.
6. The method of claim 5, wherein said processing said respective control switch information and said respective sensor analog quantities into CAN messages comprises:
writing the control switch information and the sensor analog quantity into corresponding positions of at least one CAN message structure body to obtain at least one CAN message, wherein the at least one CAN message structure body is a message structure body stored in the message simulation device.
7. The method of claim 5, wherein the obtaining the control switch information of the target automobile and the sensor analog values of the target automobile sent by the terminal includes:
receiving an information transfer instruction sent by the terminal;
checking the information transfer instruction;
and when the information transfer instruction passes the verification, acquiring the information of each control switch and the analog quantity of each sensor carried in the information transfer instruction.
8. The method of claim 5, wherein the method further comprises:
when a message change instruction sent by the terminal is received, acquiring a changed message structure body from the message change instruction;
and updating the stored CAN message structure according to the changed message structure.
9. A message sending device, wherein the device is applied to the message simulation device of any one of claims 1 to 4, and the message sending device comprises:
the first acquisition module is used for acquiring the control switch information of the target automobile and the analog quantity of each sensor of the target automobile, which are sent by the terminal, wherein the target automobile is any automobile in a test stage;
the processing module is used for processing the control switch information and the sensor analog quantity into CAN messages;
and the sending module is used for sending the CAN message to the CAN bus of the target automobile.
10. A computer readable storage medium having stored thereon instructions which, when executed by a processor, implement the steps of the method of any of the preceding claims 5 to 8.
CN202111521382.9A 2021-12-13 2021-12-13 Message simulation device, message sending method and device and computer storage medium Active CN114221890B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111521382.9A CN114221890B (en) 2021-12-13 2021-12-13 Message simulation device, message sending method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111521382.9A CN114221890B (en) 2021-12-13 2021-12-13 Message simulation device, message sending method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN114221890A CN114221890A (en) 2022-03-22
CN114221890B true CN114221890B (en) 2024-02-27

Family

ID=80701436

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111521382.9A Active CN114221890B (en) 2021-12-13 2021-12-13 Message simulation device, message sending method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN114221890B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5761429A (en) * 1995-06-02 1998-06-02 Dsc Communications Corporation Network controller for monitoring the status of a network
CN106534337A (en) * 2016-12-05 2017-03-22 常州市新科汽车电子有限公司 Debugging system and debugging method of vehicle-mounted information system
CN107979446A (en) * 2017-11-30 2018-05-01 广州科腾信息技术有限公司 A kind of bcc exclusive or check methods of IEC61850 reported data transmissions message
CN111475357A (en) * 2020-03-31 2020-07-31 北京经纬恒润科技有限公司 Bus fault injection system
CN111682993A (en) * 2020-08-11 2020-09-18 广州汽车集团股份有限公司 Automobile CAN bus signal simulation method and device
CN112378420A (en) * 2020-10-30 2021-02-19 北斗星通智联科技有限责任公司 Signal simulation method and system for automobile navigation test and electronic equipment
CN112445197A (en) * 2019-09-02 2021-03-05 北京新能源汽车股份有限公司 Controller version information verification method, processor and whole vehicle test system
CN112532492A (en) * 2020-12-08 2021-03-19 航天科技控股集团股份有限公司 CAN virtual message construction method and system for testing automobile instrument
CN112543129A (en) * 2020-11-27 2021-03-23 北京经纬恒润科技股份有限公司 Queue depth confirmation method and system and message simulator
CN113438211A (en) * 2021-06-07 2021-09-24 杭州鸿泉物联网技术股份有限公司 DBC format analysis and message analysis method, device, electronic equipment and medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5761429A (en) * 1995-06-02 1998-06-02 Dsc Communications Corporation Network controller for monitoring the status of a network
CN106534337A (en) * 2016-12-05 2017-03-22 常州市新科汽车电子有限公司 Debugging system and debugging method of vehicle-mounted information system
CN107979446A (en) * 2017-11-30 2018-05-01 广州科腾信息技术有限公司 A kind of bcc exclusive or check methods of IEC61850 reported data transmissions message
CN112445197A (en) * 2019-09-02 2021-03-05 北京新能源汽车股份有限公司 Controller version information verification method, processor and whole vehicle test system
CN111475357A (en) * 2020-03-31 2020-07-31 北京经纬恒润科技有限公司 Bus fault injection system
CN111682993A (en) * 2020-08-11 2020-09-18 广州汽车集团股份有限公司 Automobile CAN bus signal simulation method and device
CN112378420A (en) * 2020-10-30 2021-02-19 北斗星通智联科技有限责任公司 Signal simulation method and system for automobile navigation test and electronic equipment
CN112543129A (en) * 2020-11-27 2021-03-23 北京经纬恒润科技股份有限公司 Queue depth confirmation method and system and message simulator
CN112532492A (en) * 2020-12-08 2021-03-19 航天科技控股集团股份有限公司 CAN virtual message construction method and system for testing automobile instrument
CN113438211A (en) * 2021-06-07 2021-09-24 杭州鸿泉物联网技术股份有限公司 DBC format analysis and message analysis method, device, electronic equipment and medium

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
基于CAN/移动通信技术的车用发动机远程监控系统研究;张隆基;《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》;全文 *
基于CAN总线的汽车开关电器盒设计;叶芯洲;《物联网技术》;第3卷(第26期);全文 *
基于MCP2515的CAN总线控制软件的设计与实现;孙龙;刘晖虎;;现代信息科技(第07期);全文 *
基于NS2的控制器局域网网络管理模拟系统;陈筠翰;秦贵和;叶晨思;赵耀;;南京理工大学学报(01);全文 *
整车电气信号模拟与测试系统开发;何默;龚元明;代朋;;机械设计与制造(第05期);全文 *
汽车CAN网络协议设计及实验测试;王立萍;;制造业自动化(第06期);全文 *

Also Published As

Publication number Publication date
CN114221890A (en) 2022-03-22

Similar Documents

Publication Publication Date Title
CN101680932B (en) Integrated circuit with self-test feature for validating functionality of external interfaces
CN103605359A (en) Automobile diagnostic system and method
JP7562661B2 (en) Software upgrade method, apparatus and system
CN106371954B (en) I2C bus verification method and system based on 10-bit slave address
CN102967815B (en) Chip testing method, automated testing equipment and system
CN114089713A (en) Communication method based on UDS, ECU and upper computer
CN115629599B (en) CAN bus simulation test method and system
CN109842534A (en) A kind of equipment test verification method based on switch type FC artificial card
CN116737117A (en) Model development method based on Autosar architecture
CN113133041B (en) Method and device for testing vehicle-to-vehicle communication function in dynamic interval train control vehicle
CN114706768A (en) I3C bus verification method and verification system
CN114221890B (en) Message simulation device, message sending method and device and computer storage medium
CN104125047A (en) Communication circuit, physical quantity measurement device, electronic apparatus, and communication method
CN115933591B (en) Controller diagnosis method, device, equipment and storage medium
CN107645430B (en) Data processing method, system and related equipment
CN114760322A (en) Vehicle information association method, Internet of vehicles terminal and Internet of vehicles platform
CN113485912B (en) Communication function simulation method for 1553B bus BC chip
CN114019230B (en) Intelligent electric energy meter design method and system
CN114785635B (en) Programmable logic controller connection method and device, terminal equipment and storage medium
CN116418616A (en) Vehicle-mounted service providing method and vehicle-mounted system based on active CAN protocol adaptation layer
KR101069410B1 (en) Apparatus and method for setting communication interface of trusted platform module
CN115665021A (en) Communication verification system, method, device, equipment and storage medium
CN116820581A (en) Calibration parameter writing method and device, electronic equipment and storage medium
CN116541220A (en) PCIE (peripheral component interface express) acceleration card aging test method, system, terminal and storage medium
CN115220414A (en) Method for testing vehicle loading machine of vehicle by CAN bus and related product

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