WO2022056894A1 - Vehicle communication method and vehicle communication device - Google Patents

Vehicle communication method and vehicle communication device Download PDF

Info

Publication number
WO2022056894A1
WO2022056894A1 PCT/CN2020/116393 CN2020116393W WO2022056894A1 WO 2022056894 A1 WO2022056894 A1 WO 2022056894A1 CN 2020116393 W CN2020116393 W CN 2020116393W WO 2022056894 A1 WO2022056894 A1 WO 2022056894A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
sent
packet
frame
header
Prior art date
Application number
PCT/CN2020/116393
Other languages
French (fr)
Chinese (zh)
Inventor
李�杰
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2020/116393 priority Critical patent/WO2022056894A1/en
Priority to CN202080004605.1A priority patent/CN112585931A/en
Publication of WO2022056894A1 publication Critical patent/WO2022056894A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9063Intermediate storage in different physical parts of a node or terminal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields

Definitions

  • the present application relates to the field of vehicle communication, and in particular, to a vehicle communication method and communication device.
  • the in-vehicle device needs to establish an effective mechanism and logic to ensure that two frames of the same content can be sent synchronously, and the target device needs to complete the discrimination of the above two frames in the same period. .
  • it is usually necessary to develop a complete set of protocol mechanisms to ensure the reliability of its transmission and reception, as well as the judging of application logic, and finally realize the real-time transmission and redundancy arbitration of packets at the Ethernet network layer.
  • Common Industrial Protocol is a communication protocol applied in industrial automation, but because this connection-based communication usually needs to establish a communication path, and is usually a point-to-point communication method, it will take up a lot of connection resources. And the transmission capacity is also very limited, so it cannot be widely used in the field of vehicles.
  • automotive Ethernet emerges as the times require.
  • SOME/IP common scalable service-oriented middleware over internet protocol
  • a service-oriented scalable middleware although SOME/IP has better performance than CIP, the protocol depth of SOME/IP is too deep and has greater independence, especially for application layer complexity
  • the current SOME/IP still cannot meet the requirements of the above-mentioned redundancy mechanism, that is, cannot meet the requirements of the above-mentioned redundancy mechanism for packet synchronization and screening.
  • the present application provides a vehicle communication method and communication device, which can better realize real-time transmission of redundant data of in-vehicle equipment.
  • a first aspect provides a method for vehicle communication, the method comprising: receiving a first message, where the first message includes a check field and a unique identifier, where the unique identifier includes a frame identification ID and an Internet Protocol IP address; The first message is checked according to the check field of the first message; if the first message passes the check, the first message is stored in the buffer space corresponding to the frame ID according to the frame ID.
  • the identification of the message is realized by setting a unique identifier for the message, thereby ensuring the synchronous sending of the message and realizing the discrimination of the message.
  • the technical solution of the present application does not require time synchronization between the receiving end and the transmitting end, and at the same time avoids message discrimination errors caused by different time precisions and time errors of different devices.
  • the accuracy requirements of the equipment are not too strict, and the alignment time is not required at all, so it is suitable for on-board equipment in existing vehicles.
  • setting an independent buffer space for each frame ID is a very suitable solution for vehicle communication scenarios, which makes the storage and reading of messages more convenient and faster.
  • the first packet optionally, if the first packet fails the check, the first packet is discarded.
  • the packet can be further processed, and the packet can be discarded. That is to say, when the message is correct, the check result is considered to be "passed", and the message is further processed (for example, stored in the buffer space corresponding to the frame ID); when the message is wrong, the check result is considered to be "failed” ”, the packet is discarded.
  • a check field is often set, and the check field has a corresponding relationship with the content carried. Therefore, when there is an error in the received message, The check field calculated according to the carried data will be inconsistent with the check field carried when the message is sent, it can be considered that the message has errors, and the message can be discarded.
  • the first message received from network port 0 and network port 1 can be sent to two independent buffer areas of the application program. A separate buffer space will be created under the corresponding network port for each frame ID. After receiving the packets, the packets are sent to the corresponding buffer area for storage according to the frame ID. Each frame ID is only allocated a buffer space of the corresponding size, and the packets received in each buffer space will be overwritten and stored. That is, the latest received message will overwrite the last message in the buffer.
  • the sent packets may also be counted, that is, the packets of each frame may be numbered, or it may be understood as setting the time sequence identifier of the packet frames. That is to say, the first packet is identified with the time sequence when it is sent.
  • a frame sequence count (sequence counter) can be defined, and the frame sequence count can be used as the sequence identifier of the message. It can be accumulated at one end of the sending message, and the frame sequence counter will increase by 1 every time a frame is sent.
  • the frame sequence count is used to indicate the sequence of sending packets, which can be understood as the time sequence (sequence) of sending packets.
  • a frame sequence count of 5 in a message means that the message is sent for the 5th time. If the frame sequence count of another message is 7, it means that the message is sent for the 7th time. The message is sent after the message with the frame sequence count of 5 is sent. It can be considered that the message with the frame sequence count of 7 is sent later than the message with the frame sequence count of 5. It should be understood that the above is only an example for illustrating the meaning of the frame sequence count, and there is no limitation.
  • the sending order of the packets can be understood as the sequence of sending the packets, not the actual sending time of the packets.
  • the time stamp is used as the order of the sending time of the message, which is the order of the actual sending time, but in this application, it is only the order of the sending of the message, which does not correspond to the actual time. , which can be thought of as an ordering of each sent message. It is precisely because the freshness of the packets is distinguished by the sending order without corresponding to the actual time, so that the solution of the present application does not need to strictly require the time synchronization of all devices.
  • the frame sequence count is mainly used to assist in reading the message, so that the updated (late time) message can be selected.
  • the message selection rule is very suitable for this aspect of vehicle communication. Special application scenarios, and this method is not suitable for common communication (such as communication between mobile phones and other terminals), because the amount of data involved in common communication scenarios is very large, if the counting method is used, it is easy to appear, the frame sequence count The maximum value has been reached, but there is still no way to store the data, resulting in data loss and other problems. Moreover, in this application, it is necessary to configure an independent buffer space for each frame ID, which is also unsatisfactory in common communication scenarios.
  • the time synchronization method is currently used, and the counting method cannot be used. If the communication method based on time synchronization is applied to the communication in the vehicle field, it will be very complicated compared to the solution of the present application, which is not as concise and easy to implement as the solution of the present application.
  • the stored message may also be read, for example, when a read request sent by the application program is received, the message may be read from the buffer space of the corresponding frame ID.
  • the above-mentioned unique identifier further includes a frame sequence count, and a read request can be obtained, and the read request includes the frame ID of the message to be read; At least one first message is read from the buffer space corresponding to the frame ID of the message, and the value of the frame sequence count of the at least one first message is used to indicate the order in which it is sent; The packet with the largest frame sequence count value and the second packet is returned.
  • a suitable message can be selected from the at least one first message (that is, the message stored in the above-mentioned received first message) as the first message.
  • the second message can be understood as a message read in response to the read request, or can be understood as a message returned to the initiator of the read request.
  • the application program when the application program reads the specified frame ID message through the interface function, the program obtains the message from different network ports in the corresponding frame ID buffer area. And according to the set arbitration logic, redundant message arbitration is performed, and the message that wins the arbitration is returned to the user application layer through the interface function.
  • the buffer When the message is read, the buffer will be protected, and the buffer will be locked and mutually exclusive.
  • the request When there is a write request during the reading process, the request will be suspended. When the data copy is completed, it will be released immediately, and new received message.
  • the message may be temporarily stored during the process of reading the message without responding to the read request during the process of receiving the message.
  • an unselected packet in the at least one first packet may also be discarded. That is to say, when reading a message, discard the unselected message, which can free up buffer space and reduce storage overhead.
  • the frame ID of each frame of message is the same, and the frame sequence count is also the same.
  • the MAC address and IP address will be loaded, so the MAC address and IP address of the message sent from multiple network ports are different, so the message
  • the frame ID and IP address can form the unique identifier of the packet.
  • the frame sequence count can also be used as part of the unique identifier. Therefore, for the receiving end, the received first packet may have the same frame ID but different IP addresses.
  • the first packet is sent by the vehicle communication device from one of the network ports of multiple data transmission channels, and the IP addresses of the multiple data transmission channels are different from each other.
  • the first message is sent by using the vehicle communication device with multiple data transmission channels provided by the embodiment of the present application.
  • the above-mentioned messages may have various message structures (formats). For example, there may be no encryption-related fields in plaintext transmission, and encryption-related fields may be included in ciphertext transmission.
  • the first message may include: an IP header, a user datagram protocol UDP header, a protocol data unit PDU header, and a data area.
  • the IP address of the above-mentioned unique identifier may be loaded in the IP header, and other elements of the unique identifier (eg, frame ID, frame sequence count) may be loaded in the PDU header.
  • the first packet may further include a secure data transfer protocol area.
  • the first message may further include a digital signature area header and a key area.
  • a method for vehicle communication includes: data loading a first message to be sent, where the first message to be sent includes a frame identification ID; and transmitting the first message to be sent to a plurality of In the data transmission channel, the Internet Protocol IP addresses of multiple data transmission channels are different from each other; load the IP addresses of multiple data transmission channels for the first message to be sent, and obtain multiple second messages to be sent; within the same sending period , and send the plurality of second messages to be sent.
  • the identification of the message is realized by setting a unique identifier for the message, thereby ensuring the synchronous sending of the message and realizing the discrimination of the message.
  • the unique identifier may include, for example, the above-mentioned frame ID and IP address.
  • the technical solution of the present application does not require time synchronization between the receiving end and the transmitting end, and at the same time avoids message discrimination errors caused by different time precisions and time errors of different devices.
  • the accuracy requirements of the equipment are not too strict, and the alignment time is not required at all, so it is suitable for on-board equipment in existing vehicles.
  • setting an independent buffer space for each frame ID is a very suitable solution for vehicle communication scenarios, which makes the storage and reading of messages more convenient and faster.
  • sending a message in the same sending period can be understood as sending a message at the same time.
  • the data and frame IDs loaded in these second messages to be sent are the same, but the IP addresses are different.
  • the first message in the first aspect refers to a message received by the vehicle communication device at the receiving end
  • the first message to be sent in the second aspect is that the vehicle communication device at the transmitting end is sending a message.
  • the IP addresses of the data transmission channel may be loaded into the first message to be sent, thereby obtaining the second message to be sent. That is to say, the second message to be sent is obtained by loading the IP address on the basis of the first message to be sent.
  • the second message in the first aspect refers to the message read from the buffer space of the frame ID when the vehicle communication device at the receiving end reads the message
  • the second message in the second aspect is a message obtained by further processing on the basis of the first message to be sent by the vehicle communication device at the sending end before sending the message.
  • the frame sequence count may also be loaded for the first message to be sent, so that the second message to be sent includes the frame sequence count.
  • the sent packets are counted, that is, the packets of each frame are numbered, or it can be understood that the time sequence identifier of the packet frame is set. That is to say, the first packet is identified with the time sequence when it is sent.
  • a frame sequence count can be defined, and the frame sequence count can be used as the sequence identification code of the packet. It can be accumulated at one end of the sending message, and the frame sequence counter will increase by 1 every time a frame is sent.
  • the frame sequence count is used to indicate the sequence of sending packets, which can be understood as the time sequence (sequence) of sending packets.
  • a frame sequence count of 5 in a message means that the message is sent for the 5th time. If the frame sequence count of another message is 7, it means that the message is sent for the 7th time. The message is sent after the message with the frame sequence count of 5 is sent. It can be considered that the message with the frame sequence count of 7 is sent later than the message with the frame sequence count of 5. It should be understood that the above is only an example to illustrate the meaning of the frame sequence count, and there is no limitation.
  • a frame sequence count may also be loaded for the second message to be sent, where the frame sequence count is used to indicate the sending order of the second message to be sent.
  • the initial value of the frame sequence count may be set to 0, and the frame sequence count is less than or equal to a preset threshold.
  • the frame sequence count value is incremented by 1, and when the frame sequence count value is accumulated to be greater than or equal to a preset threshold, the frame sequence count value is reset to zero.
  • the above-mentioned messages may have various message structures (formats). For example, there may be no encryption-related fields in plaintext transmission, and encryption-related fields may be included in ciphertext transmission.
  • the frame ID of each frame of message is the same, and the frame sequence count is also the same.
  • the MAC address and IP address will be loaded, so the MAC address and IP address of the message sent from multiple network ports are different, so the message
  • the frame ID and IP address can form the unique identifier of the packet.
  • the frame sequence count can also be used as part of the unique identifier.
  • the first message to be sent and the second message to be sent both include: an IP header, a user datagram protocol UDP header, a protocol data unit PDU header and a data area , the frame ID is loaded in the PDU header of the first message to be sent and the PDU header of the second message to be sent, and the IP address is loaded in the IP header of the second message to be sent.
  • the IP address is loaded in the PDU header of the second message to be sent.
  • the second message to be sent further includes a secure data transmission protocol area.
  • the second message to be sent further includes a digital signature area header and a key area.
  • an apparatus for vehicle communication comprising a unit for executing the method in any possible implementation manner of the first aspect or the second aspect.
  • an apparatus for vehicle communication including a processor.
  • the processor is coupled to the memory and can be used to execute instructions or data in the memory, so as to implement the method in any possible implementation manner of the first aspect or the second aspect.
  • the communication device further includes a memory.
  • the communication device further includes a communication interface, and the processor is coupled to the communication interface.
  • a computer program product comprising: a computer program (also referred to as code, or instructions), when the computer program is executed, causes the computer to execute the first aspect or the first aspect above.
  • a computer program also referred to as code, or instructions
  • the method in any possible implementation manner of the second aspect.
  • a computer-readable medium stores a computer program (also referred to as code, or instruction), when it runs on a computer, causing the computer to execute the above-mentioned first aspect or the first aspect.
  • a computer program also referred to as code, or instruction
  • the method in any possible implementation manner of the second aspect.
  • FIG. 1 is a functional block diagram of a vehicle to which the embodiments of the present application are applied.
  • FIG. 2 is a schematic diagram of an automatic driving system to which an embodiment of the present application is applied.
  • FIG. 3 is a schematic diagram of an application of a cloud-side command to an autonomous driving vehicle according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of redundant communication of multiple data transmission channels of a vehicle communication device according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a processing flow of receiving redundant packets according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a processing flow of receiving redundant packets according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a process flow of sending redundant packets according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a format of a message frame according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a format of another message frame according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a format of another message frame according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of the connection of the vehicle communication device according to the embodiment of the present application in the same network.
  • FIG. 12 is a schematic diagram of the connection of the vehicle communication device according to the embodiment of the present application in different networks.
  • FIG. 13 is a schematic diagram of a PDU packet format according to an embodiment of the present application.
  • FIG. 14 is a schematic diagram of a flowchart of sending a redundant packet according to an embodiment of the present application.
  • FIG. 15 is a schematic diagram of a process of receiving a redundant packet according to an embodiment of the present application.
  • FIG. 16 is a schematic block diagram of a vehicle communication device according to an embodiment of the present application.
  • FIG. 17 is a schematic diagram of a hardware structure of a vehicle communication device according to an embodiment of the present application.
  • FIG. 18 is a schematic diagram of a vehicle communication device according to an embodiment of the present application.
  • FIG. 19 is a schematic diagram of a hardware structure of a vehicle communication device according to an embodiment of the present application.
  • the vehicle communication method and/or the vehicle communication device provided by the embodiments of the present application can be applied to various types of vehicles. These methods and/or devices can be applied to both manual driving, assisted driving, and automatic driving.
  • the technical solutions of the embodiments of the present application will be introduced below with reference to the accompanying drawings.
  • FIG. 1 is a functional block diagram of a vehicle to which the embodiments of the present application are applied.
  • the vehicle 100 may be a human-driven vehicle, or the vehicle 100 may be configured in a fully or partially autonomous driving mode.
  • the vehicle 100 may control the ego vehicle while in an autonomous driving mode, and may determine the current state of the vehicle and its surrounding environment through human manipulation, determine the possible behavior of at least one other vehicle in the surrounding environment, and A confidence level corresponding to the likelihood that other vehicles will perform the possible behavior is determined, and the vehicle 100 is controlled based on the determined information.
  • the vehicle 100 may be placed to operate without human interaction.
  • vehicle 100 Various subsystems may be included in vehicle 100 , such as travel system 110 , sensing system 120 , control system 130 , one or more peripherals 140 and power supply 160 , computer system 150 , and user interface 170 .
  • the vehicle 100 may include more or fewer subsystems, and each subsystem may include multiple elements. Additionally, each of the subsystems and elements of the vehicle 100 may be interconnected by wire or wirelessly.
  • the travel system 110 may include components for providing powered motion to the vehicle 100 .
  • travel system 110 may include engine 111, transmission 112, energy source 113, and wheels 114/tires.
  • the engine 111 may be an internal combustion engine, an electric motor, an air compression engine or other types of engine combinations; for example, a hybrid engine composed of a gasoline engine and an electric motor, or a hybrid engine composed of an internal combustion engine and an air compression engine.
  • Engine 111 may convert energy source 113 into mechanical energy.
  • the energy source 113 may include gasoline, diesel, other petroleum-based fuels, propane, other compressed gas-based fuels, ethanol, solar panels, batteries, and other sources of electricity.
  • the energy source 113 may also provide energy to other systems of the vehicle 100 .
  • transmission 112 may include a gearbox, a differential, and a driveshaft; wherein transmission 112 may transmit mechanical power from engine 111 to wheels 114 .
  • the transmission 112 may also include other devices, such as clutches.
  • the drive shafts may include one or more axles that may be coupled to one or more of the wheels 114 .
  • the sensing system 120 may include several sensors that sense information about the environment surrounding the vehicle 100 .
  • the sensing system 120 may include a positioning system 121 (eg, a global positioning system (GPS), BeiDou system, or other positioning system), an inertial measurement unit (IMU) 122, a radar 123, a laser Distance meter 124 , camera 125 and vehicle speed sensor 126 .
  • the sensing system 120 may also include sensors that monitor the internal systems of the vehicle 100 (eg, an in-vehicle air quality monitor, a fuel gauge, an oil temperature gauge, etc.). Sensor data from one or more of these sensors can be used to detect objects and their corresponding characteristics (position, shape, orientation, velocity, etc.). This detection and identification is a critical function for the safe operation of the autonomous vehicle 100 .
  • the positioning system 121 may be used to estimate the geographic location of the vehicle 100 .
  • the IMU 122 may be used to sense position and orientation changes of the vehicle 100 based on inertial acceleration.
  • IMU 122 may be a combination of an accelerometer and a gyroscope.
  • the radar 123 may utilize radio signals to sense objects within the surrounding environment of the vehicle 100 .
  • radar 123 may be used to sense the speed and/or heading of objects.
  • the laser rangefinder 124 may utilize laser light to sense objects in the environment in which the vehicle 100 is located.
  • the laser rangefinder 124 may include one or more laser sources, laser scanners, and one or more detectors, among other system components.
  • camera 125 may be used to capture multiple images of the surrounding environment of vehicle 100 .
  • camera 125 may be a still camera or a video camera.
  • the vehicle speed sensor 126 may be used to measure the speed of the vehicle 100 .
  • real-time speed measurement of the vehicle can be performed.
  • the measured vehicle speed may be communicated to the control system 130 to effect control of the vehicle.
  • control system 130 controls the operation of the vehicle 100 and its components.
  • Control system 130 may include various elements, such as may include steering system 131 , throttle 132 , braking unit 133 , computer vision system 134 , route control system 135 , and obstacle avoidance system 136 .
  • the steering system 131 may operate to adjust the heading of the vehicle 100 .
  • it may be a steering wheel system.
  • the throttle 132 may be used to control the operating speed of the engine 111 and thus the speed of the vehicle 100 .
  • the braking unit 133 may be used to control the deceleration of the vehicle 100 ; the braking unit 133 may use friction to slow the wheels 114 . In other embodiments, the braking unit 133 may convert the kinetic energy of the wheels 114 into electrical current. The braking unit 133 may also take other forms to slow the wheels 114 to control the speed of the vehicle 100 .
  • computer vision system 134 is operable to process and analyze images captured by camera 125 in order to identify objects and/or features in the environment surrounding vehicle 100 .
  • Such objects and/or features may include traffic signals, road boundaries and obstacles.
  • Computer vision system 134 may use object recognition algorithms, structure from motion (SFM) algorithms, video tracking, and other computer vision techniques.
  • the computer vision system 134 may be used to map the environment, track objects, estimate the speed of objects, and the like.
  • the route control system 135 may be used to determine the route of travel of the vehicle 100 .
  • the route control system 135 may combine data from sensors, GPS, and one or more predetermined maps to determine a driving route for the vehicle 100 .
  • the obstacle avoidance system 136 may be used to identify, evaluate and avoid or otherwise traverse potential obstacles in the environment of the vehicle 100 .
  • control system 130 may additionally or alternatively include components in addition to those shown and described. Alternatively, some of the components shown above may be reduced.
  • the vehicle 100 may interact with external sensors, other vehicles, other computer systems or users through peripheral devices 140; wherein the peripheral devices 140 may include a wireless communication system 141, an on-board computer 142, a microphone 143 and/or a or speaker 144.
  • peripheral devices 140 may include a wireless communication system 141, an on-board computer 142, a microphone 143 and/or a or speaker 144.
  • peripherals 140 may provide a means for vehicle 100 to interact with user interface 170 .
  • the onboard computer 142 may provide information to the user of the vehicle 100 .
  • the user interface 116 can also operate the onboard computer 142 to receive user input; the onboard computer 142 can be operated through a touch screen.
  • peripheral device 140 may provide a means for vehicle 100 to communicate with other devices located within the vehicle.
  • microphone 143 may receive audio (eg, voice commands or other audio input) from a user of vehicle 100 .
  • speakers 144 may output audio to a user of vehicle 100 .
  • wireless communication system 141 may wirelessly communicate with one or more devices, either directly or via a communication network.
  • wireless communication system 141 may use 3G cellular communications; eg, code division multiple access (CDMA)), EVDO, global system for mobile communications (GSM)/general packet radio service (general packet radio service, GPRS), or 4G cellular communications, such as long term evolution (LTE); or, 5G cellular communications.
  • the wireless communication system 141 may communicate with a wireless local area network (WLAN) using wireless Internet access (WiFi).
  • WLAN wireless local area network
  • WiFi wireless Internet access
  • the wireless communication system 141 may communicate directly with the device using an infrared link, Bluetooth, or ZigBee; other wireless protocols, such as various vehicle communication systems, for example, the wireless communication system 141 may include an or A number of dedicated short range communications (DSRC) devices, which may include public and/or private data communications between vehicles and/or roadside stations.
  • DSRC dedicated short range communications
  • the communication solutions provided in the embodiments of the present application are mainly applicable to scenarios in which on-board devices communicate via Ethernet, which may be communication between different on-board devices of the same vehicle, or on-board devices of different vehicles. communication between.
  • the vehicle communication device may be any device in the above wireless communication system 141 , or may be a communication device integrated in any vehicle-mounted device, for example, may be a communication device integrated in the braking unit 133 , no longer list them one by one.
  • power supply 160 may provide power to various components of vehicle 100 .
  • the power source 160 may be a rechargeable lithium-ion battery or a lead-acid battery.
  • One or more battery packs of such a battery may be configured as a power source to provide power to various components of the vehicle 100 .
  • power source 160 and energy source 113 may be implemented together, such as in some all-electric vehicles.
  • a computer system 150 may include at least one processor 151 that executes execution in a non-transitory computer-readable medium stored in, for example, memory 152 .
  • Computer system 150 may also be multiple computing devices that control individual components or subsystems of vehicle 100 in a distributed fashion.
  • processor 151 may be any conventional processor, such as a commercially available central processing unit (CPU).
  • CPU central processing unit
  • the processor may be a dedicated device such as an application specific integrated circuit (ASIC) or other hardware-based processor.
  • FIG. 1 functionally illustrates a processor, memory, and other elements of the computer in the same block, one of ordinary skill in the art will understand that the processor, computer, or memory may actually include storage that may or may not be Multiple processors, computers or memories within the same physical enclosure.
  • the memory may be a hard drive or other storage medium located within an enclosure other than a computer.
  • reference to a processor or computer will be understood to include reference to a collection of processors or computers or memories that may or may not operate in parallel.
  • some components such as the steering and deceleration components may each have their own processor that only performs computations related to component-specific functions .
  • a processor may be located remotely from the vehicle and in wireless communication with the vehicle. In other aspects, some of the processes described herein are performed on a processor disposed within the vehicle while others are performed by a remote processor, including taking steps necessary to perform a single maneuver.
  • memory 152 may contain instructions 153 (eg, program logic) that may be used by processor 151 to perform various functions of vehicle 100 , including those described above.
  • Memory 152 may also include additional instructions, such as including sending data to, receiving data from, interacting with, and/or performing data processing on one or more of travel system 110 , sensing system 120 , control system 130 , and peripherals 140 control commands.
  • memory 152 may store data such as road maps, route information, vehicle location, direction, speed, and other such vehicle data, among other information. Such information may be used by the vehicle 100 and the computer system 150 during operation of the vehicle 100 in autonomous, semi-autonomous and/or manual modes.
  • user interface 170 may be used to provide information to or receive information from a user of vehicle 100 .
  • user interface 170 may include one or more input/output devices within the set of peripheral devices 140 , eg, wireless communication system 141 , onboard computer 142 , microphone 143 , and speaker 144 .
  • computer system 150 may control functions of vehicle 100 based on input received from various subsystems (eg, travel system 110 , sensing system 120 , and control system 130 ) and from user interface 170 .
  • computer system 150 may utilize input from control system 130 to control braking unit 133 to avoid obstacles detected by sensing system 120 and obstacle avoidance system 136 .
  • computer system 150 is operable to provide control of various aspects of vehicle 100 and its subsystems.
  • one or more of these components described above may be installed or associated with the vehicle 100 separately.
  • memory 152 may exist partially or completely separate from vehicle 100 .
  • the above-described components may be communicatively coupled together in a wired and/or wireless manner.
  • FIG. 1 should not be construed as a limitation on the embodiments of the present application.
  • the vehicle 100 may be a self-driving car traveling on a road and may recognize objects in its surroundings to determine an adjustment to the current speed.
  • the objects may be other vehicles, traffic control devices, or other types of objects.
  • each identified object may be considered independently, and based on the object's respective characteristics, such as its current speed, acceleration, distance from the vehicle, etc., may be used to determine the speed at which the autonomous vehicle is to adjust.
  • the vehicle 100 or a computing device associated with the vehicle 100 eg, computer system 150, computer vision system 134, memory 152 of FIG. rain, ice on the road, etc.
  • a computing device associated with the vehicle 100 eg, computer system 150, computer vision system 134, memory 152 of FIG. rain, ice on the road, etc.
  • each of the identified objects is dependent on the behavior of the other, so it is also possible to predict the behavior of a single identified object by considering all of the identified objects together.
  • the vehicle 100 can adjust its speed based on the predicted behavior of the identified object.
  • the self-driving car can determine that the vehicle will need to adjust (eg, accelerate, decelerate, or stop) to a steady state based on the predicted behavior of the object.
  • other factors may also be considered to determine the speed of the vehicle 100, such as the lateral position of the vehicle 100 in the road being traveled, the curvature of the road, the proximity of static and dynamic objects, and the like.
  • the computing device may also provide instructions to modify the steering angle of the vehicle 100 so that the self-driving car follows a given trajectory and/or maintains contact with objects in the vicinity of the self-driving car (eg, , cars in adjacent lanes on the road) safe lateral and longitudinal distances.
  • objects in the vicinity of the self-driving car eg, , cars in adjacent lanes on the road
  • the above-mentioned vehicle 100 can be a car, a truck, a motorcycle, a bus, a boat, an airplane, a helicopter, a lawn mower, a recreational vehicle, a playground vehicle, construction equipment, a tram, a golf cart, a train, a cart, etc.
  • the application examples are not particularly limited.
  • the vehicle 100 shown in FIG. 1 may be an automatic driving vehicle, and the automatic driving system will be described in detail below.
  • FIG. 2 is a schematic diagram of an automatic driving system to which an embodiment of the present application is applied.
  • the automatic driving system shown in FIG. 2 includes a computer system 201 , wherein the computer system 201 includes a processor 203 , and the processor 203 is coupled with a system bus 205 .
  • the processor 203 may be one or more processors, wherein each processor may include one or more processor cores.
  • a display adapter 207 (video adapter), which can drive a display 209, is coupled to the system bus 205.
  • the system bus 205 may be coupled to an input output (I/O) bus 213 through a bus bridge 211, and an I/O interface 215 may be coupled to the I/O bus.
  • I/O input output
  • I/O interface 215 communicates with various I/O devices, such as input device 217 (eg, keyboard, mouse, touch screen, etc.), media tray 221 (media tray), (eg, CD-ROM, multimedia interface, etc.) .
  • the transceiver 223 can send and/or receive radio communication signals, and the camera 255 can capture landscape and dynamic digital video images.
  • the interface connected to the I/O interface 215 may be the USB port 225 .
  • the processor 203 may be any conventional processor, such as a reduced instruction set computing (reduced instruction set computer, RISC) processor, a complex instruction set computing (complex instruction set computer, CISC) processor or a combination of the above.
  • RISC reduced instruction set computer
  • CISC complex instruction set computing
  • the processor 203 may be a dedicated device such as an application specific integrated circuit (ASIC); the processor 203 may be a neural network processor or a combination of a neural network processor and the above-mentioned conventional processors.
  • ASIC application specific integrated circuit
  • computer system 201 may be located remotely from the autonomous vehicle and may communicate wirelessly with the autonomous vehicle.
  • some of the processes described herein are performed on a processor disposed within the autonomous vehicle and others are performed by a remote processor, including taking actions required to perform a single maneuver.
  • Network interface 229 may be a hardware network interface, such as a network card.
  • the network 227 may be an external network, such as the Internet, or an internal network, such as an Ethernet network or a virtual private network (VPN).
  • the network 227 may also be a wireless network, such as a WiFi network, a cellular network, and the like.
  • the communication solutions provided in the embodiments of the present application are mainly applicable to scenarios in which on-board devices communicate via Ethernet, which may be communication between different on-board devices of the same vehicle, or on-board devices of different vehicles. communication between.
  • the vehicle communication device may be a communication device independent of the in-vehicle device, or may be a communication device integrated in any in-vehicle device.
  • the hard disk drive interface is coupled with the system bus 205
  • the hardware drive interface 231 can be connected with the hard disk drive 233
  • the system memory 235 is coupled with the system bus 205 .
  • Data running in system memory 235 may include operating system 237 and application programs 243 .
  • the operating system 237 may include a parser (shell) 239 and a kernel (kernel) 241 .
  • the shell 239 is an interface between the user and the kernel of the operating system.
  • the shell can be the outermost layer of the operating system; the shell can manage the interaction between the user and the operating system, for example, waiting for user input, interpreting user input to the operating system, and processing various operating systems output result.
  • Kernel 241 may consist of those parts of the operating system that manage memory, files, peripherals, and system resources. Interacting directly with hardware, the operating system kernel usually runs processes and provides inter-process communication, providing CPU time slice management, interrupts, memory management, IO management, and more.
  • Application 243 includes programs that control the autonomous driving of the car, for example, programs that manage the interaction of the autonomous car with obstacles on the road, programs that control the route or speed of the autonomous car, and programs that control the interaction of the autonomous car with other autonomous vehicles on the road. .
  • Application 243 also exists on the system of software deployment server 249 . In one embodiment, the computer system 201 may download the application program from the software deployment server 249 when the autonomous driving related program 247 needs to be executed.
  • the application program 243 may also be a program for the autonomous vehicle to interact with the road lane lines, that is, a program that can track the lane lines in real time.
  • the application program 243 may also be a program for controlling the self-driving vehicle to perform automatic parking.
  • sensors 253 may be associated with computer system 201 , and sensors 253 may be used to detect the environment surrounding computer 201 .
  • the senor 253 can detect the lane on the road, such as the lane line, and can track the change of the lane line within a certain range in front of the vehicle in real time when the vehicle is moving (eg, while driving).
  • the sensor 253 can detect animals, cars, obstacles and pedestrian crossings, etc., and further sensors can also detect the environment around objects such as the above-mentioned animals, cars, obstacles and pedestrian crossings, such as: the environment around animals, for example, the environment around animals Other animals, weather conditions, ambient light levels, etc.
  • the sensors may be cameras, infrared sensors, chemical detectors, microphones, and the like.
  • the senor 253 can be used to detect the lane line in front of the vehicle, so that the vehicle can perceive the change of the lane during traveling, so as to plan and adjust the driving of the vehicle in real time accordingly.
  • the sensor 253 can be used to detect the size or position of the storage space and surrounding obstacles around the vehicle, so that the vehicle can perceive the distance between the storage space and surrounding obstacles, and when parking Collision detection is performed to prevent vehicles from colliding with obstacles.
  • the computer system 150 shown in Figure 1 may also receive information from or transfer information to other computer systems.
  • the sensor data collected from the sensor system 120 of the vehicle 100 may be transferred to another computer for processing the data, which will be described below by taking FIG. 3 as an example.
  • FIG. 3 is a schematic diagram of an application of a cloud-side command to an autonomous driving vehicle according to an embodiment of the present application.
  • data from computer system 312 may be transmitted via a network to server 320 on the cloud side for further processing.
  • Networks and intermediate nodes may include various configurations and protocols, including the Internet, the World Wide Web, Intranets, Virtual Private Networks, Wide Area Networks, Local Area Networks, private networks using one or more of the company's proprietary communication protocols, Ethernet, WiFi and HTTP, and various combinations of the foregoing; such communications may be by any device capable of transferring data to and from other computers, such as modems and wireless interfaces.
  • server 320 may include a server having multiple computers, such as a load balancing server farm, that exchange information with different nodes of the network for the purpose of receiving, processing, and transmitting data from computer system 312 .
  • the server may be configured similarly to computer system 312 , with processor 330 , memory 340 , instructions 350 , and data 360 .
  • the data 360 of the server 320 may include information about road conditions around the vehicle.
  • server 320 may receive, detect, store, update, and transmit information related to vehicle road conditions.
  • the relevant information of the road conditions around the vehicle includes other vehicle information and obstacle information around the vehicle.
  • Some existing vehicle communication methods either require complex point-to-point connections with too limited transmission capability (eg CIP), or involve complex communication protocols (eg SOME/IP), and none of them can meet the requirements of redundant communication. That is to say, for redundant communication, the prior art cannot well realize packet synchronization, and cannot discriminate redundant packets. Although the existing communication method based on time synchronization in the communication field can be used to realize real-time transmission, this method is too complicated and cumbersome, and the screening of redundant messages is still difficult to meet the special requirements of vehicle communication.
  • CIP complex point-to-point connections with too limited transmission capability
  • SOME/IP complex communication protocols
  • the embodiments of the present application provide a solution for vehicle redundant communication, which can realize real-time transmission of redundant data of vehicles and is easy to implement. Mainly by setting up redundant communication devices of multiple network ports to realize redundant sending and receiving of messages, and by setting unique identifiers and/or setting message numbers for messages to realize message identification, thus ensuring message integrity. Synchronous transmission and identification of packets. Compared with the communication method based on time synchronization, the technical solution of the present application does not require time synchronization between the receiving device and the sending device, and at the same time avoids packet discrimination errors caused by different time precisions and time errors of different devices. The accuracy requirements of the on-board equipment are not too strict, and the alignment time is not required at all, so it is suitable for on-board equipment in existing vehicles.
  • FIG. 4 is a schematic diagram of redundant communication of multiple data transmission channels of a vehicle communication device according to an embodiment of the present application.
  • the dual-channel Ethernet interface is used to send and receive data, and the data transmission redundancy is realized on the link.
  • Each Ethernet channel has an independent media access control (MAC) address, a port physical layer (PHY) chip, and an independent Ethernet interface (ethernet interface, ETH).
  • MAC media access control
  • PHY port physical layer
  • ETH independent Ethernet interface
  • the vehicle communication device is connected with a microcontroller unit (MCU) of the vehicle-mounted device, so that the communication between the vehicle-mounted devices can be realized.
  • MCU microcontroller unit
  • the communication may be performed between different in-vehicle devices of the same vehicle, or the communication may be performed between in-vehicle devices of different vehicles.
  • the in-vehicle device can be understood as an in-vehicle terminal device, and in this embodiment of the present application, it mainly refers to an in-vehicle device that has a communication function and can perform certain functions.
  • each device in the sensing system 120 shown in FIG. The various subsystems in the control system 130 and the devices in the various subsystems, the various devices in the peripheral devices 140, the computer system 150, and the like.
  • the in-vehicle device may also include various types of units that can be used to control the vehicle, any device in the system, for example, a vehicle interface control unit (VIU), a vehicle identification unit ( vehicle integration unit (VIU), vehicle dynamics control (vehicle dynamics control) equipment, electronic control unit (ECU), electronic power steering (EPS), electronically controlled brake system (electronically controlled brake system) , EBS), anti-lock brake control system (antilock brake system, ABS) and so on.
  • VU vehicle interface control unit
  • VIU vehicle identification unit
  • VU vehicle dynamics control
  • ECU electronic control unit
  • EPS electronic power steering
  • EBS electronically controlled brake system
  • antilock brake system antilock brake system
  • ABS antilock brake system
  • the vehicle communication device may be a device independent of the in-vehicle device, or may be a device integrated inside the in-vehicle device (that is, a part of the in-vehicle device).
  • the vehicle communication device may be a device in the wireless communication system 141 shown in FIG. 1 , or, for example, the vehicle communication device may be integrated into any of the above-mentioned in-vehicle devices.
  • the MCU of the in-vehicle device can send data (messages) through MAC0, PHY0 and network port 0 in the vehicle communication device in sequence, and can also receive data (messages) through network ports 0, PHY0 and MAC0 in sequence.
  • the MCU of the in-vehicle device also sends data (messages) through MAC1, PHY1 and network port 1 in the vehicle communication device in sequence, and can also receive data (messages) through network port 1, PHY1 and MAC1 in sequence.
  • the vehicle communication device shown in FIG. 4 includes two data transmission channels, wherein one data transmission channel includes the above-mentioned MAC0, PHY0 and network port 0, and the other data transmission channel includes the above-mentioned MAC1, PHY1 and network port 1.
  • the two data transmission channels can independently process the transceiving data or process the transceiving data in combination.
  • a frame identification (identity, ID) can be defined for each frame of message, that is, each frame of message has a unique frame ID, and then the two data transmission channels shown in FIG. A message with the same frame ID is sent to the target device/device (the device/device that received the message).
  • the sent packets may also be counted, that is, the packets of each frame may be numbered, or it may be understood as setting the time sequence identifier of the packet frames.
  • a frame sequence count (sequence counter) can be defined, and the frame sequence count can be used as the sequence identifier of the message. It can be accumulated at one end of the sending message, and the frame sequence counter will increase by 1 every time a frame is sent.
  • the frame sequence count is used to indicate the sequence of sending packets, which can be understood as the time sequence (sequence) of sending packets.
  • a frame sequence count of 5 in a message means that the message is sent for the 5th time. If the frame sequence count of another message is 7, it means that the message is sent for the 7th time. The message is sent after the message with the frame sequence count of 5 is sent. It can be considered that the message with the frame sequence count of 7 is sent later than the message with the frame sequence count of 5. It should be understood that the above is only an example for illustrating the meaning of the frame sequence count, and there is no limitation.
  • data loading may be in the order of an internet protocol (internet protocol, IP) header, a user datagram protocol (user datagram protocol, UDP) header, and a protocol data unit (protocol data unit, PDU) to load.
  • IP internet protocol
  • UDP user datagram protocol
  • PDU protocol data unit
  • the PDU message when the PDU message is ready, it can be passed to the sending layer, and then sent out simultaneously through two data channels.
  • the PDU When the PDU is passed to the UDP and IP layers for transmission, the IP header and the UDP header are loaded by the protocol stack. In this way, when the message is sent to the network, a uniquely identified message is composed of the IP header and the frame ID.
  • the two network ports of the vehicle communication device may be allocated in different network segments.
  • the destination addresses of network port 0 and network port 1 may also be in different network segments.
  • the receiver can monitor and receive the message according to the set port.
  • the in-vehicle communication device may send messages according to a fixed period. That is to say, at the same time, there will be two messages sent to the network by the vehicle communication device of the sending end through the two network ports at the same time.
  • the two frame messages are loaded with the same PDU content, frame sequence count and frame ID, and the same UDP header.
  • the IP headers of the two frames are different. Since the two frames are sent from different network ports, they are loaded with different source IP addresses and MAC addresses. Since the set destination addresses are also different, the destination IP address and destination MAC address of the IP header are also different. .
  • the vehicle communication device shown in FIG. 4 receives a message, or it can be understood that when the vehicle communication device shown in FIG. 4 is the vehicle communication device of the receiving end, the message can be received from the network port 0 and the network port 1 respectively, and the The packet is selected according to the frame ID and frame sequence count of the received packet, and the specific processing process of the received packet will be introduced in FIG. 5 .
  • FIG. 5 is a schematic diagram of a processing flow of receiving redundant packets according to an embodiment of the present application. The steps shown in FIG. 5 are described below.
  • the received packet may include a check field and a unique identifier, where the unique identifier may include a frame identification ID and an IP address.
  • packets may be received (eg, receiving the first packet) from network ports of multiple (eg, two) data transmission channels, and the receiving processes of the multiple data transmission channels are independent of each other.
  • each data transmission channel may include its own MAC, PHY and network port.
  • the same data transmission channel structure shown in FIG. 4 may be used.
  • step 510 there is no limit to the number of received packets.
  • the unique identifier may further include a frame sequence count, where the frame sequence count is used to indicate the sending and sending order of the received packets (eg, the first packet) when they are sent.
  • the sending order of the packets can be understood as the sequence of sending the packets, not the actual sending time of the packets.
  • the time stamp is used as the order of the sending time of the message, which is the order of the actual sending time, but in this application, it is only the order of the sending of the message, which does not correspond to the actual time. , which can be thought of as an ordering of each sent message. It is precisely because the freshness of the packets is distinguished by the sending order without corresponding to the actual time, so that the solution of the present application does not need to strictly require the time synchronization of all devices.
  • step 520 Check the message, when the check result is "pass”, go to step 540; when the check result is "fail”, go to step 530.
  • step 530 is executed.
  • a check field is often set, and the check field has a corresponding relationship with the content carried. Therefore, when there is an error in the received message, The check field calculated according to the carried data will be inconsistent with the check field carried when the message is sent, it can be considered that the message has errors, and the message can be discarded.
  • the received packets (for example, the first packet) that do not pass the verification (check) may be discarded.
  • step 530 may not be executed, that is, the discarding of the packet may or may not be considered.
  • the message may be stored.
  • the following is an example of the scenario shown in FIG. 4 .
  • the first packet received from network port 0 and network port 1 can be sent to two independent buffer areas of the application program, and the application program will create a separate buffer space for each frame ID under the corresponding network port. .
  • the packets are sent to the corresponding buffer area for storage according to the frame ID.
  • Each frame ID is only allocated a buffer space of the corresponding size, and the packets received in each buffer space will be overwritten and stored. That is, the latest received message will overwrite the last message in the buffer.
  • the message stored in the buffer area of the corresponding frame ID can be read according to the buffer area (storage area) of the slave message.
  • steps 550 and 560 may be performed after the read request is obtained.
  • the read request may include the frame ID of the message to be read.
  • a corresponding buffer space can be found according to the frame ID of the to-be-read message specified in the read request, and then the message stored in the buffer space is read.
  • At least one stored message in the buffer space corresponding to the frame ID may be read, and the at least one stored message includes the above-mentioned first message.
  • the packets stored in the buffer space of each frame ID here include the above-mentioned packets that have passed the inspection. Therefore, it can also be understood that at least one first packet is stored in the buffer space of each frame ID. However, it should be understood that there may also be no message in the buffer space, which is equivalent to a read failure, or an indication that there is no message is returned.
  • a suitable message can be selected from the at least one stored message as the second message, and the second message can be understood as the read request in response to the read request.
  • the extracted message or it can be understood as the message returned to the initiator of the read request.
  • the application program when the application program reads the specified frame ID message through the interface function, the program obtains the message from different network ports in the corresponding frame ID buffer area. And according to the set arbitration logic, redundant message arbitration is performed, and the message that wins the arbitration is returned to the user application layer through the interface function.
  • the buffer When the message is read, the buffer will be protected, and the buffer will be locked and mutually exclusive.
  • the request When there is a write request during the reading process, the request will be suspended. When the data copy is completed, it will be released immediately, and new received message.
  • a packet with a larger frame sequence count may be selected according to the frame sequence count of the packet, for example, a packet with the largest frame sequence count value in the buffer space may be selected as the second packet.
  • the value of the frame sequence count of the message can be set to take a value from 0 to the maximum value.
  • the count reaches the maximum value, it continues to count from 0. Therefore, when the maximum value and 0 exist at the same time, it is considered that 0 is the larger count.
  • each step shown in FIG. 5 does not need to be completely executed, for example, only steps 510 to 540 may be executed, that is, an independent buffer space is set for each frame of message, and the message is stored.
  • Steps 550 and 560 are executed only when the message needs to be read (when a read request is received). Or it can be understood that step 550 and step 560 are the process of reading the message, not the process of receiving the message, and steps 510 to 540 are the process of receiving the message. It can also be understood that steps 510 to 540 are executed every time a message needs to be received, and steps 550 and 560 are executed every time a message needs to be read.
  • an unselected packet in the at least one first packet may also be discarded. That is to say, when reading a message, discard the unselected message, which can free up buffer space and reduce storage overhead.
  • Steps 540 and 550 may not be performed simultaneously.
  • FIG. 6 is a schematic diagram of a processing flow of receiving redundant packets according to an embodiment of the present application. Each step shown in FIG. 6 will be introduced below.
  • Figure 5 can be regarded as a general description of the processing flow
  • Figure 6 is equivalent to the processing flow when two network ports receive packets respectively. It can be seen from Figure 6 that the two The processing of the message is independent. Only when the message is selected according to the frame sequence, the two channels can share the frame sequence, so as to select the message from the received message. It should also be understood that since the two data channels are independent in the processing of the packets, there is no restriction on the sequence.
  • the network port 0 receives the packet.
  • step 511 may be performed by using the method provided in step 510 .
  • the network port 1 receives the packet.
  • step 512 may be performed using the method provided in step 510 .
  • step 521 may be performed by using the method provided in step 520 .
  • step 522 may be performed using the method provided in step 520 .
  • step 531 may be performed using the method provided in step 530 .
  • step 532 may be performed using the method provided in step 530 .
  • step 541 may be performed using the method provided in step 540 .
  • step 542 may be performed using the method provided in step 540 .
  • step 551 may be performed using the method provided in step 550 .
  • step 552 may be performed using the method provided in step 550 .
  • step 561 may be performed by using the method provided in step 560 .
  • step 562 may be performed using the method provided in step 560 .
  • the two data transmission channels are independent of each other when performing the above steps, and the frame sequence count can be shared only when a packet is selected (ie, step 561 and step 562).
  • FIG. 7 is a schematic diagram of a process flow of sending redundant packets according to an embodiment of the present application. Each step of FIG. 7 will be introduced below.
  • the above-mentioned first message (shown in Fig. 5 and Fig. 6 ) refers to the message received by the vehicle communication device at the receiving end, and the first message to be sent in step 701 is the message of the sending end A message generated by the vehicle communication device before sending the message.
  • the data to be sent may be loaded in the first message to be sent, and the frame ID may be loaded in the header of the first message to be sent.
  • the IP addresses of the data transmission channel may be loaded into the first message to be sent, thereby obtaining the second message to be sent. That is to say, the second message to be sent is obtained by loading the IP address on the basis of the first message to be sent.
  • the second message to be sent in step 703 is a message obtained by further processing on the basis of the first message to be sent by the vehicle communication device at the sending end before sending the message.
  • the frame sequence count may also be loaded for the first message to be sent, so that the second message to be sent includes the frame sequence count.
  • the frame sequence count please refer to the relevant introduction above, and for the sake of brevity, it will not be repeated. It should also be understood that the loading of the frame sequence count can be performed at any time before, during, or after step 701 and step 703, as long as it is performed before step 704 is performed, and there is no other limitation.
  • the second message to be sent may be sent from the network port of each data transmission channel of the multiple data transmission channels.
  • sending a message in the same sending period can be understood as sending a message at the same time.
  • the data and frame IDs loaded in the second message to be sent are the same, but the IP addresses are different.
  • FIG. 8 is a schematic diagram of a format of a message frame according to an embodiment of the present application. As shown in Figure 8, the length of one frame of message is less than or equal to 1500 bytes.
  • the message frame may include: an IP header (header), a UDP header, a PDU header, a digital signature area (signature optional) header, a data (data) area, a secure data transmission protocol area, and a key area.
  • IP header header
  • UDP header UDP header
  • PDU header PDU header
  • digital signature area signature optional header
  • data (data) area data (data) area
  • secure data transmission protocol area a key area.
  • the standard IP header includes 20 bytes, and the standard UDP header includes 8 bytes. As shown in FIG. 8 , the IP header and the UDP header have a total of 28 bytes.
  • the PDU header includes 32 bytes. In the embodiment of this application, two quantities of message sequence count and frame ID are added to the PDU header. For other PDU components, the same settings as the existing PDU header can be used. For example, the data type, data length, frame check sequence, etc. can be set in the PDU. The specific content will be introduced in FIG. 13 and will not be expanded here.
  • the frame ID is a unique identifier of the PDU user data structure, which is unique in the protocol stack.
  • the frame ID may together with the source IP form a unique identifier within the PDU.
  • the message sequence count is to count the sent messages, and the message sequence count starts from 0. Every time a PDU message is sent, the message count is accumulated by 1, and when the count reaches the maximum value, it starts from 0 again. Start.
  • an independent packet sequence count can be set for each frame ID.
  • the header of the PDU packet includes a check field, for example, a frame check sequence (frame check sequence, FCS).
  • a check field for example, a frame check sequence (frame check sequence, FCS).
  • the digital signature area includes a header and a key area.
  • the header of the digital signature area is located after the PDU header, and the key area is located at the end of the message frame.
  • the byte lengths of the header and the key area are not fixed. situation settings.
  • the digital signature area can be used to transmit encrypted public keys.
  • Encryption algorithms of different security levels can be arbitrarily selected to encrypt packets. For example, RSA security encryption algorithm, HAL security encryption algorithm, and custom verification encryption algorithm.
  • the data area refers to an area for transferring data.
  • the packet length (the sum of the byte length of the data and the byte lengths of the above-mentioned parts) does not exceed the requirements of network transmission.
  • the byte length of the packet can be set to be less than or equal to 1500.
  • the length of the data area of each message can be customized according to the actual number of bytes used.
  • the message length is loaded in the message length field of the PDU header. for receipt confirmation.
  • the data area can customize the type of semaphore according to the type of transmission data, such as defining signals by bit offset, or defining different signals by byte offset.
  • ciphertext transmission or plaintext transmission can be selected according to the needs of data transmission.
  • the safe data transmit protocol area is used to store verification information for safe transmission.
  • the secure transmission data area supports different secure data transmission protocols, for example, the SDTV2 protocol can be used.
  • the secure data transfer protocol area may include 16 bytes.
  • FIG. 8 is only an example of the message frame format, and other message frame formats may also be used, for example, the message frame formats shown in FIG. 9 or FIG. 10 may be used.
  • FIG. 9 is a schematic diagram of a format of another message frame according to an embodiment of the present application. As shown in Figure 9, the length of one frame of message is less than or equal to 1500 bytes.
  • the message frame shown in FIG. 9 may include: an IP header, a UDP header, a PDU header, a data area, and a secure data transmission protocol area.
  • FIG. 9 can be regarded as a message form that only encrypts the message but does not verify the secure transmission, or can be understood as a way of cipher text transmission.
  • FIG. 10 is a schematic diagram of a format of another message frame according to an embodiment of the present application. As shown in Figure 10, the length of a frame is less than or equal to 1500 bytes.
  • the message frame shown in FIG. 10 may include: an IP header, a UDP header, a PDU header, a digital signature area header, a data area, and a key area.
  • FIG. 9 and FIG. 10 are only examples of the other two message formats, and other situations may exist, for example, there may be neither a secure data transmission protocol nor a digital signature authentication requirement. That is to say, the message may also only include: an IP header, a UDP header, a PDU header and a data area, and the data length of the data area may be 0-1440 bytes.
  • FIG. 11 is a schematic diagram of the connection of the vehicle communication device according to the embodiment of the present application in the same network.
  • both the device #1 and the device #2 are in-vehicle devices, both of which include a vehicle communication device, but it should be understood that the two may also be independent vehicle communication devices.
  • the two are connected in two ways through multiple switches.
  • the first path between device #1 and device #2 includes N switches, where N is a positive integer
  • the second path between device #1 and device #2 includes M switches, where M is positive Integer.
  • the N switches in the first channel are numbered from 1 to N
  • the switches in the second channel are numbered from N+1 to N+M.
  • FIG. 11 it is in the same network, so the above two channels refer to two channels in the same network, not two networks.
  • the most intuitive difference is that the two switches shown in Figure 11 are connected, for example, switch #1 is connected to switch #N+1, which can prevent communication loss caused by switch failure or link failure.
  • the device #1 and the device #2 respectively have two network ports, and the IP addresses of the two network ports are different and separated during transmission.
  • FIG. 12 is a schematic diagram of the connection of the vehicle communication device according to the embodiment of the present application in different networks.
  • device #1, device #2, and device #3 are all in-vehicle devices, and all three include a vehicle communication device, but it should be understood that the three may also be independent vehicle communication devices.
  • Device #1, Device #2, and Device #3 are connected to two networks, Network A and Network B, respectively.
  • network A includes multiple switches, which may be numbered by switches Ai, where i is a positive integer.
  • network B includes multiple switches, which may be numbered by switches Bj, where j is a positive integer.
  • FIG. 12 shows different networks, so the above-mentioned network A and network B are different networks.
  • the most intuitive difference is that the switches of network A and network B shown in Figure 12 are isolated, for example, switch A1 is not connected to any switch in network B.
  • FIG. 12 is only an example, but there is no limitation on the number of devices, the number of networks, the number of switches in the network, and the like.
  • one network port of device #1, device #2, and device #3 is connected to network A, and the other network port is connected to network B.
  • the device #1, the device #2, and the device #3 can simultaneously send data to the two networks through the two network ports according to the message format defined in the embodiment of the present application.
  • the two network ports of another device are also connected to the network, and the packet reception and arbitration can be completed. No matter which network port packets arrive first, the transmission of the current cycle can be completed, making full use of the data link characteristics in the redundant network, and improving the transmission timeliness and reliability of data in the entire network.
  • the first is to set the network topology and data flow.
  • the IPs of the two network ports of the in-vehicle device are allocated to different network segments, and both network ports are connected to the switch network (including the network shown in Figure 11 and the network shown in Figure 12).
  • IP of network port 1 of device #1 is configured as 10.0.0.10/21
  • the IP of network port 0 of device #1 is configured as 10.0.8.10/21
  • the IP of network port 1 of device #2 is configured as 10.0 .0.20/21
  • the in-vehicle device can send the same PDU message from network port 1 and network port 0 at the same time in the same communication cycle.
  • the frame ID of this PDU is the same as the frame sequence count.
  • the UDP header of the PDU message is loaded by the system to record the source port, destination port and message length.
  • the source port may be different by implementation, but the destination port value is the same.
  • the data length is also the same.
  • the IP header of the network port is loaded by the protocol stack of the network port according to the IP information of the network port. Therefore, the contents of the IP header of the PDU message sent by the two network ports are different. .
  • the in-vehicle device When the in-vehicle device receives a message from network port 1 and network port 0, the data transmission channel where network port 1 and network port 0 are located can independently process the received message. As a result of the check, it is decided to discard the packet or store the packet.
  • FIG. 13 is a schematic diagram of a PDU packet format according to an embodiment of the present application.
  • the PDU message frame includes: a frame header and a data area, wherein the frame header includes 32 bytes, and the data area may include data less than or equal to 1440 bytes.
  • the frame header includes frame sequence count (sequence counter), frame ID, protocol version (protocol version), data type (data type), data length (data length), reserved field (reserve), reserved field 01, reserved field 02, reserved Field 03, data area (data), frame check sequence.
  • the frame sequence count is counted and updated by the vehicle communication device at the sending end, and the vehicle communication device at the receiving end can mainly use the frame sequence count to read the message.
  • the frame sequence count starts to accumulate from 0. Every time the vehicle communication device at the sending end sends a frame, the frame sequence count increases by 1. When the maximum value is reached, it returns to zero (that is, it returns to zero when it is greater than or equal to the preset threshold), and then starts from zero again. Start counting.
  • the preset threshold (maximum value) can be set to 0xFFFF FFFF.
  • the frame sequence count is mainly used to assist in reading the message, so that the updated (late time) message can be selected.
  • the message selection rule is very suitable for this aspect of vehicle communication. Special application scenarios, and this method is not suitable for common communication (such as communication between terminals such as mobile phones), because the amount of data involved in common communication scenarios is very large, if the counting method is used, it is easy to appear, and the frame sequence has When the maximum value is reached, there is still a situation where the data cannot be stored, resulting in data loss and other problems. Moreover, in this application, it is necessary to configure an independent buffer space for each frame ID, which is also unsatisfactory in common communication scenarios.
  • the time synchronization method is currently used, and the counting method cannot be used. If the communication method based on time synchronization is applied to the communication in the vehicle field, it will be very complicated compared to the solution of the present application, which is not as concise and easy to implement as the solution of the present application.
  • the vehicle communication device at the receiving end may arbitrate the freshness of the message according to the frame sequence count, and the larger the frame sequence count value, the fresher the data.
  • the packet with a larger frame sequence count value is selected for analysis, and the packet with a smaller frame sequence count value can be discarded. Assuming that the frame sequence count values of the two network ports are the same, you can set it to select the packets of the specified default network port for parsing.
  • the unique identifier of the packet can be set to include the frame ID and source IP of the packet.
  • the frame ID of each frame of message is the same as the frame sequence count.
  • the MAC address and IP address will be loaded, so the MAC address and IP address of the message sent from multiple network ports are different, so the message
  • the frame ID and IP address can form the unique identifier of the packet.
  • the frame sequence count can also be used as part of the unique identifier.
  • the protocol version is mainly used to define the PDU version information to determine its compatibility.
  • the data type refers to the PDU communication data type, which is usually defined as process data and message data.
  • the data length can be understood as the length of the data frame, which refers to the length of the data field of the actual PDU message, excluding the 20-byte header.
  • the frame check sequence refers to the protocol sequence used to check the PDU header.
  • a cyclic redundancy check (cyclic redundancy check, CRC) check may be performed using a general-purpose FCS.
  • the data size of the data area can be 0 to 1440 bytes, that is to say, the data size does not exceed the total byte length limit of the PDU message, and the limit of the total byte length of the message needs to be deducted from the header of the message. length.
  • the signal table mapping may be defined by the appendix neutron subprotocol.
  • the data area may include the above-mentioned secure transmission check area, digital signature area and key area.
  • FIG. 14 is a schematic diagram of a flowchart of sending a redundant packet according to an embodiment of the present application. Each step of FIG. 14 is described below.
  • the message when a message needs to be sent, the message is published.
  • the data area of the PDU is loaded in the application program.
  • the data comes from the MCU of the in-vehicle equipment. After these data are loaded in the data area, the message can be transmitted to different data transmission channels respectively, and the data transmission channel performs subsequent operations such as loading frame ID, loading frame sequence count, and sending message.
  • the information of the frame header of the message can be loaded continuously, and the FCS can be calculated according to the current frame header information, so as to complete the data loading, and then the packaged message can be transmitted to different networks.
  • the protocol stack of the transport channel Add the IP header and MAC address information of the respective network ports into the protocol stack.
  • a timer can be used to send outgoing packets and wait for the timer to be triggered.
  • the packets are sent from different network ports of different data transmission channels at the same time, and the frame sequence count value is accumulated by 1. .
  • the frame sequence count is accumulated after the execution of the transmission behavior and is not affected by the success or failure of the transmission. That is to say, the loop counting operations in steps 1411 and 1421 are performed after each sending behavior is performed.
  • network port 0 may use a counter to cyclically count the number of times the packet is sent.
  • network port 0 may use a counter to cyclically count the number of times the packet is sent.
  • steps 1411-1415 are operations performed by the data transmission channel where network port 0 is located
  • steps 1421-1424 are operations performed by the data transmission channel where network port 1 is located.
  • the operations of the two data transmission channels are independent of each other. .
  • step 1412 or step 1421 is executed to clear the counter (that is, the value of the frame sequence count is reset to zero), and the steps are executed regardless of whether the transmission fails or not.
  • step 1413 or step 1423 update the PDU message.
  • the value of the frame sequence count is generated by the transmit counter, which is continuously accumulated during power-on.
  • the frame sequence count does not support external software modification.
  • the sending counter When powered on, the sending counter is set to 0, that is, the initial value of the frame sequence count is 0. After each message is sent, the counter is incremented by 1, and the frame sequence count value is incremented by 1 until the frame sequence count value is accumulated to be greater than or equal to the preset value.
  • the threshold When the threshold is set, the counter is cleared, the value of the frame sequence count is reset to zero, and the count starts from 0 again.
  • the data transmission field after the data transmission field is calculated locally through the SID, it can be loaded in the data area.
  • the encryption of the message data area is completed and transmitted to the sending layer. Sent by the protocol stack sending area.
  • step 1415 and step 1422 are executed to send the packets from network port 0 and network port 1 respectively. If the time interval or the number of times of sending failure exceeds the preset value, step 1403 may be executed to cancel the publishing of the message.
  • the PDU ID, frame sequence count, IP and MAC constitute the displacement identifier of this frame message in the network.
  • two packets with the same PDU ID have different IP headers and MAC addresses, so the identifiers of the two identical packets are unique.
  • FIG. 14 is an example of the process of sending redundant packets, and the specific process can refer to the related introduction in FIG. 7 , so for brevity, details are not repeated here.
  • FIG. 15 is a schematic diagram of a process of receiving a redundant packet according to an embodiment of the present application. Each step of FIG. 15 is described below.
  • PDU subscription can be understood as one of the triggering conditions for receiving a message, and can also be understood as information for starting a process of receiving a message.
  • step 1504 is performed, and when SDT or security mode is selected, step 1503 is performed.
  • RT mode can be understood as the above-mentioned plaintext transmission, that is, the message is not encrypted, and the decryption operation is not required at this time.
  • SDT and security mode can be understood as the ciphertext transmission described above, that is, the message is encrypted, and the message needs to be decrypted first.
  • step 1503 needs to be performed only for encrypted packets.
  • the content of the received message is read out, so as to use the check field of the received message to check whether there is an error in the message.
  • this step 1505 may be performed using the method provided in step 520 in FIG. 5 .
  • step 1506 may be performed using the methods of steps 550 and 560 in FIG. 5 .
  • FIG. 15 is an example of the process of receiving redundant packets and reading in packets, and the specific process can refer to the related introduction in FIG. 5 or FIG.
  • the vehicle communication method of the embodiment of the present application is described above, and the vehicle communication device of the embodiment of the present application is described below. It should be understood that the vehicular communication device introduced hereinafter can execute each process of the vehicular communication method of the embodiments of the present application, and repeated descriptions will be appropriately omitted when introducing the embodiments of the device below.
  • FIG. 16 is a schematic diagram of a vehicle communication device according to an embodiment of the present application.
  • the device 2000 includes a receiving unit 2001 and a processing unit 2002 .
  • the device 2000 can be used to execute each step performed by the vehicle communication device at the receiving end in the vehicle communication method of the embodiment of the present application.
  • the receiving unit 2001 can be used to perform steps 510 and 550 in the method shown in FIG. 5
  • the processing unit 2002 can be used to perform steps 520 to 540 and 560 in the method shown in FIG. 5 .
  • the receiving unit 2001 can be used to perform steps 511, 512 and 551, 552 in the method shown in 541, 542 and steps 561, 562.
  • the receiving unit 2001 may be configured to perform step 1501 in the method shown in FIG. 15
  • the processing unit 2002 may be configured to perform steps 1502 to 1506 in the method shown in FIG. 15 .
  • the above-mentioned apparatus 2000 may be the vehicle communication apparatus shown in FIG. 4 .
  • FIG. 17 is a schematic diagram of a hardware structure of a vehicle communication device according to an embodiment of the present application.
  • the apparatus 3000 includes a memory 3001 , a processor 3002 , a communication interface 3003 and a bus 3004 .
  • the memory 3001 , the processor 3002 , and the communication interface 3003 are connected to each other through the bus 3004 for communication.
  • the apparatus 3000 may be used to execute each step performed by the vehicle communication device at the receiving end in the above vehicle communication method.
  • the memory 3001 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • the memory 3001 may store a program.
  • the processor 3002 and the communication interface 3003 are used to execute each step of the vehicle communication method of the embodiment of the present application.
  • the memory 3001 may have the function of the memory 152 shown in FIG. 1 , the function of the system memory 235 shown in FIG. 2 , or the function of the memory 340 shown in FIG. 4 to realize the above function of storing programs.
  • the processor 3002 may adopt a general-purpose CPU, a microprocessor, an ASIC, a graphics processing unit (graphic processing unit, GPU), or one or more integrated circuits, for executing related programs, so as to implement the functions of the embodiments of the present application.
  • the processor 3002 may have the function of the processor 151 shown in FIG. 1 , or the function of the processor 203 shown in FIG. 2 , or the function of the processor 330 shown in FIG. 3 , so as to realize the above-mentioned function of executing related programs .
  • the processor 3002 may also be an integrated circuit chip with signal processing capability.
  • each step of the vehicle communication method in the embodiment of the present application may be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
  • the above-mentioned processor 3002 may also be a general-purpose processor, a digital signal processor (digital signal processing, DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (field programmable gate array, FPGA) or other Programming logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processing
  • ASIC application-specific integrated circuit
  • FPGA field programmable gate array
  • Programming logic devices discrete gate or transistor logic devices, discrete hardware components.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory and, in combination with its hardware, completes the functions required to be performed by the units included in the vehicle communication device of the embodiment of the present application, or executes each step of the vehicle communication method of the embodiment of the present application .
  • the communication interface 3003 may use a transceiver device such as, but not limited to, a transceiver to implement communication between the device and other devices or a communication network.
  • a transceiver device such as, but not limited to, a transceiver to implement communication between the device and other devices or a communication network.
  • the bus 3004 may include pathways for transferring information between various components of the device (eg, memory, processor, communication interface).
  • FIG. 18 is a schematic diagram of a vehicle communication device according to an embodiment of the present application.
  • the device 4000 includes a sending unit 4001 and a processing unit 4002 .
  • the device 4000 can be used to execute each step performed by the vehicle communication device at the transmitting end in the vehicle communication method of the embodiment of the present application.
  • the sending unit 4001 may be configured to execute step 704 in the method shown in FIG. 7
  • the processing unit 4002 may be configured to execute steps 701 to 703 of the method shown in FIG. 7
  • the sending unit 4001 can be used to perform steps 1414 and 1424 in the method shown in FIG. 14
  • the processing unit 4002 can be used to perform other steps in the method shown in FIG. 14 .
  • the above-mentioned apparatus 4000 may be the vehicle communication apparatus shown in FIG. 4 .
  • FIG. 19 is a schematic diagram of a hardware structure of a vehicle communication device according to an embodiment of the present application.
  • the apparatus 5000 includes a memory 5001 , a processor 5002 , a communication interface 5003 and a bus 5004 .
  • the memory 5001 , the processor 5002 , and the communication interface 5003 are connected to each other through the bus 5004 for communication.
  • the apparatus 5000 can be used to execute each step performed by the vehicle communication apparatus at the transmitting end in the above vehicle communication method.
  • the memory 5001 may be a ROM, a static storage device, a dynamic storage device or a RAM.
  • the memory 5001 may store a program. When the program stored in the memory 5001 is executed by the processor 5002, the processor 5002 and the communication interface 5003 are used to execute each step of the vehicle communication method of the embodiment of the present application.
  • the memory 5001 may have the function of the memory 152 shown in FIG. 1 , the function of the system memory 235 shown in FIG. 2 , or the function of the memory 340 shown in FIG. 4 to realize the above function of storing programs.
  • the processor 5002 may adopt a general-purpose CPU, a microprocessor, an ASIC, a GPU, or one or more integrated circuits, for executing a related program, so as to realize the required execution of the unit in the vehicle communication device of the embodiment of the present application function, or execute each step of the vehicle communication method of the embodiments of the present application.
  • the processor 5002 may have the function of the processor 151 shown in FIG. 1 , the function of the processor 203 shown in FIG. 2 , or the function of the processor 330 shown in FIG. 3 , so as to realize the above-mentioned function of executing related programs .
  • the processor 5002 may also be an integrated circuit chip with signal processing capability.
  • each step of the vehicle communication method in the embodiment of the present application may be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
  • the above-mentioned processor 5002 may also be a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
  • the methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory and, in combination with its hardware, completes the functions required to be performed by the units included in the vehicle communication device of the embodiment of the present application, or executes each step of the vehicle communication method of the embodiment of the present application .
  • the communication interface 5003 may use a transceiver device such as, but not limited to, a transceiver to implement communication between the device and other devices or a communication network.
  • a transceiver device such as, but not limited to, a transceiver to implement communication between the device and other devices or a communication network.
  • the bus 5004 may include pathways for communicating information between various components of the device (eg, memory, processor, communication interface).
  • the embodiments of the present application further provide a computer program product including instructions, and when the instructions are executed by a computer, the instructions cause the computer to implement the methods in the foregoing method embodiments.
  • the embodiments of the present application do not specifically limit the specific structure of the execution body of the methods provided by the embodiments of the present application, as long as the program in which the codes of the methods provided by the embodiments of the present application are recorded can be executed to execute the methods according to the embodiments of the present application. Just communicate.
  • Computer readable media may include, but are not limited to, magnetic storage devices (eg, hard disks, floppy disks, or magnetic tapes, etc.), optical disks (eg, compact discs (CDs), digital versatile discs (DVDs), etc. ), smart cards and flash memory devices (eg, erasable programmable read-only memory (EPROM), cards, stick or key drives, etc.).
  • magnetic storage devices eg, hard disks, floppy disks, or magnetic tapes, etc.
  • optical disks eg, compact discs (CDs), digital versatile discs (DVDs), etc.
  • smart cards and flash memory devices eg, erasable programmable read-only memory (EPROM), cards, stick or key drives, etc.
  • the various storage media described herein may represent one or more devices and/or other machine-readable media for storing information.
  • the term "machine-readable medium” may include, but is not limited to, wireless channels and various other media capable of storing, containing, and/or carrying instructions and/or data.
  • the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components
  • the memory storage module
  • the disclosed apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution can be embodied in the form of a computer software product, and the computer software product is stored in a storage
  • the computer software product includes several instructions, the instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium may include, but is not limited to, various media that can store program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Security & Cryptography (AREA)
  • Small-Scale Networks (AREA)

Abstract

The present application provides a vehicle communication method and a vehicle communication device, relating to the field of vehicle communication. The method comprises: receiving a first packet, the first packet comprising a check field and a unique identifier, and the unique identifier comprising a frame identifier (ID) and an Internet Protocol (IP) address; checking the first packet according to the check field of the first packet; and storing, according to the frame ID, the first packet that has passed the checking into a cache space corresponding to the frame ID. The method is applicable to vehicles such as networked vehicles, intelligent vehicles and autonomous vehicles, and achieves packet identification by configuring a unique identifier for each packet, thereby ensuring synchronous packet transmission and achieving packet discrimination. Moreover, the accuracy requirement on vehicle-mounted devices is not strict, and time alignment is not required at all, allowing the method to be applied to existing vehicle-mounted devices in vehicles. In addition, each frame ID is provided with an independent cache space, thereby facilitating and accelerating packet storage and reading.

Description

车辆通信方法和通信装置Vehicle communication method and communication device 技术领域technical field
本申请涉及车辆通信领域,并且具体地,涉及一种车辆通信方法和通信装置。The present application relates to the field of vehicle communication, and in particular, to a vehicle communication method and communication device.
背景技术Background technique
随着汽车技术的不断发展,对于车载设备之间的通信需求越来越高。为了满足通信需求,通常需要对车载设备采用冗余连接的方式,对接入链路进行冗余备份。在这种冗余连接方式下,对于报文的发送和接收期间的处理方式都提出了更高的要求,例如,如何将报文同步、如何甄别报文等等。举例说明,某个车载设备先发送相同内容的两帧报文至网络中进行传输,这两帧报文最终抵达目标设备(例如可以是另外一个车载设备或者上位机设备等等)的指定网口和指定端口,但在这期间该车载设备需要建立有效机制和逻辑,保证可以同步发送上述相同内容的两帧报文,而该目标设备又需要在同一周期内完成对上述两帧报文的甄别。要想实现上述过程,通常需要制定一整套完整的协议机制来保证其发送和接收的可靠性,以及应用逻辑的可判断性,最终实现报文在以太网网络层的实时传输和冗余仲裁。With the continuous development of automotive technology, the demand for communication between in-vehicle devices is getting higher and higher. In order to meet the communication requirements, it is usually necessary to adopt a redundant connection method for the in-vehicle equipment to perform redundant backup of the access link. In this redundant connection mode, higher requirements are put forward for the processing methods during packet transmission and reception, for example, how to synchronize packets, how to identify packets, and so on. For example, an in-vehicle device first sends two frames of messages with the same content to the network for transmission, and the two frames of messages finally arrive at the designated network port of the target device (for example, another in-vehicle device or a host computer device, etc.). and the designated port, but during this period, the in-vehicle device needs to establish an effective mechanism and logic to ensure that two frames of the same content can be sent synchronously, and the target device needs to complete the discrimination of the above two frames in the same period. . In order to realize the above process, it is usually necessary to develop a complete set of protocol mechanisms to ensure the reliability of its transmission and reception, as well as the judging of application logic, and finally realize the real-time transmission and redundancy arbitration of packets at the Ethernet network layer.
通用工业协议(common industrial protocol,CIP)是一种应用在工业自动化的通信协定,但由于这种基于连接的通信通常需要建立通信通路,且通常是点对点的通信方式,会占用很多的连接资源,且传输能力也非常局限,所以无法在车领域中得到广泛应用。为了实现车载设备之间的良好通信,汽车以太网应运而生,例如采用常见的可扩展的面向服务的协议栈(scalable service-oriented middleware over internet protocol,SOME/IP)(即位于IP协议层以上的一种面向服务的可伸缩的中间件),虽然SOME/IP具有比CIP更好的性能,但是SOME/IP的协议深度太深且具有较大的独立性,尤其对于应用层来说复杂度较高,此外,目前的SOME/IP依然无法满足上述冗余机制的需求,也就是说,无法满足上述冗余机制对于报文同步和甄别的要求。Common Industrial Protocol (CIP) is a communication protocol applied in industrial automation, but because this connection-based communication usually needs to establish a communication path, and is usually a point-to-point communication method, it will take up a lot of connection resources. And the transmission capacity is also very limited, so it cannot be widely used in the field of vehicles. In order to achieve good communication between in-vehicle devices, automotive Ethernet emerges as the times require. For example, a common scalable service-oriented middleware over internet protocol (SOME/IP) (that is, above the IP protocol layer) is used. A service-oriented scalable middleware), although SOME/IP has better performance than CIP, the protocol depth of SOME/IP is too deep and has greater independence, especially for application layer complexity In addition, the current SOME/IP still cannot meet the requirements of the above-mentioned redundancy mechanism, that is, cannot meet the requirements of the above-mentioned redundancy mechanism for packet synchronization and screening.
而如果直接将现有的通信领域的通信机制应用于车领域的通信,即基于时间同步来实现上述车领域的以太网的实时传输,则过于复杂繁琐。However, if the existing communication mechanism in the communication field is directly applied to the communication in the vehicle field, that is, the real-time transmission of the above-mentioned Ethernet in the vehicle field is realized based on time synchronization, it is too complicated and cumbersome.
因此,如何更好地实现车载设备的冗余数据的实时传输是亟待解决的技术问题。Therefore, how to better realize real-time transmission of redundant data of in-vehicle equipment is a technical problem to be solved urgently.
发明内容SUMMARY OF THE INVENTION
本申请提供一种车辆通信方法和通信装置,能够更好地实现车载设备的冗余数据的实时传输。The present application provides a vehicle communication method and communication device, which can better realize real-time transmission of redundant data of in-vehicle equipment.
第一方面,提供了一种车辆通信的方法,该方法包括:接收第一报文,第一报文包括校验字段和唯一标识符,该唯一标识符包括帧标识ID和互联网协议IP地址;根据第一报文的校验字段,对第一报文进行检查;若第一报文通过检查,根据帧ID将第一报文存储到帧ID所对应的缓存空间。A first aspect provides a method for vehicle communication, the method comprising: receiving a first message, where the first message includes a check field and a unique identifier, where the unique identifier includes a frame identification ID and an Internet Protocol IP address; The first message is checked according to the check field of the first message; if the first message passes the check, the first message is stored in the buffer space corresponding to the frame ID according to the frame ID.
在本申请技术方案中,通过为报文设置唯一标识符,实现报文的识别,从而保证了报 文的同步发送和实现报文的甄别。本申请技术方案相比于基于时间同步的通信方式,不要求接收端和发送端的时间同步,同时避免了不同设备的时间精度不同和时间误差等导致的报文甄别错误,也就是说,对于车载设备的精度要求没有过于严格的要求,完全不需要对齐时间,所以适用于现有的车辆中的车载设备。此外,为每个帧ID设置独立的缓存空间,是非常适用于车辆通信场景的方案,使得报文的存储和读取都更为方便快捷。In the technical solution of the present application, the identification of the message is realized by setting a unique identifier for the message, thereby ensuring the synchronous sending of the message and realizing the discrimination of the message. Compared with the communication method based on time synchronization, the technical solution of the present application does not require time synchronization between the receiving end and the transmitting end, and at the same time avoids message discrimination errors caused by different time precisions and time errors of different devices. The accuracy requirements of the equipment are not too strict, and the alignment time is not required at all, so it is suitable for on-board equipment in existing vehicles. In addition, setting an independent buffer space for each frame ID is a very suitable solution for vehicle communication scenarios, which makes the storage and reading of messages more convenient and faster.
结合第一方面,在第一方面的某些实现方式中,可选地,若第一报文没有通过检查,将第一报文丢弃。With reference to the first aspect, in some implementations of the first aspect, optionally, if the first packet fails the check, the first packet is discarded.
可选地,在上述检查报文、存储报文或丢弃报文的过程中,可以根据接收到的报文(例如第一报文)的校验字段,检查报文是否正确,当报文正确的时候对报文进行进一步处理,当报文存在错误的时候,可以将报文丢弃。也就是说,当报文正确的时候认为检查结果为“通过”,对报文进行进一步处理(例如存储到帧ID对应的缓存空间中);当报文错误的时候认为检查结果为“未通过”,将报文丢弃。这是因为,为了保证接收到的报文所承载的数据是正确的,往往会设置校验字段,该校验字段与承载的内容存在对应关系,因此,当接收到的报文存在错误时,根据承载的数据推算出的校验字段与发送报文时承载的校验字段就会不一致,就可以认为该报文存在错误,就可以将报文进行丢弃。Optionally, in the above process of checking the message, storing the message or discarding the message, it is possible to check whether the message is correct according to the check field of the received message (for example, the first message). When there is an error in the packet, the packet can be further processed, and the packet can be discarded. That is to say, when the message is correct, the check result is considered to be "passed", and the message is further processed (for example, stored in the buffer space corresponding to the frame ID); when the message is wrong, the check result is considered to be "failed" ”, the packet is discarded. This is because, in order to ensure that the data carried by the received message is correct, a check field is often set, and the check field has a corresponding relationship with the content carried. Therefore, when there is an error in the received message, The check field calculated according to the carried data will be inconsistent with the check field carried when the message is sent, it can be considered that the message has errors, and the message can be discarded.
在存储报文时,以从两个数据传输通道接收报文为例,例如可以将从网口0和网口1接收的第一报文传送至应用程序的两个独立的缓存区,应用程序会给每一个帧ID在对应的网口下分别创建一个独立的缓存空间。当接受到报文后,将这些报文根据帧ID投送到对应缓存区间储存。每一个帧ID只分配一个对应大小的缓存空间,在每个缓存空间接收的报文都会被覆盖存储。即当前最新接收到的报文会覆盖上一次存在该缓存区的报文。When storing a message, take receiving a message from two data transmission channels as an example. For example, the first message received from network port 0 and network port 1 can be sent to two independent buffer areas of the application program. A separate buffer space will be created under the corresponding network port for each frame ID. After receiving the packets, the packets are sent to the corresponding buffer area for storage according to the frame ID. Each frame ID is only allocated a buffer space of the corresponding size, and the packets received in each buffer space will be overwritten and stored. That is, the latest received message will overwrite the last message in the buffer.
可选地,还可以对发送的报文进行计数,也就是说,对每帧报文进行编号,或者可以理解为设置报文帧的时间顺序标识。也就是说,第一报文是带有发送时的时间顺序的标识的。Optionally, the sent packets may also be counted, that is, the packets of each frame may be numbered, or it may be understood as setting the time sequence identifier of the packet frames. That is to say, the first packet is identified with the time sequence when it is sent.
可选地,可以定义帧序列计数(sequence counter),将帧序列计数作为报文的顺序识别码。可以在发送报文的一端进行累加,每发送一帧报文,帧序列计数器累加1。Optionally, a frame sequence count (sequence counter) can be defined, and the frame sequence count can be used as the sequence identifier of the message. It can be accumulated at one end of the sending message, and the frame sequence counter will increase by 1 every time a frame is sent.
需要说明的是,在本申请实施例中,帧序列计数用于表示发送报文的先后顺序,可以理解为是发送报文的时间次序(顺序)。例如某个报文帧序列计数为5相当于该报文是第5次发送的,假设另外一个报文的帧序列计数为7相当于该报文是第7次发送的,还可以知道该报文是在帧序列计数为5的报文发送之后发送的,可以看作是,帧序列计数为7的报文的发送时间晚于帧序列计数为5的报文。应理解,上述只是为了说明帧序列计数的含义的一种示例,不存在限定。It should be noted that, in this embodiment of the present application, the frame sequence count is used to indicate the sequence of sending packets, which can be understood as the time sequence (sequence) of sending packets. For example, a frame sequence count of 5 in a message means that the message is sent for the 5th time. If the frame sequence count of another message is 7, it means that the message is sent for the 7th time. The message is sent after the message with the frame sequence count of 5 is sent. It can be considered that the message with the frame sequence count of 7 is sent later than the message with the frame sequence count of 5. It should be understood that the above is only an example for illustrating the meaning of the frame sequence count, and there is no limitation.
还需要说明的是,在本申请中,报文的发送次序可以理解为发送报文的先后顺序,并不是报文的实际发送时间。换而言之,在现有的通讯中是用时间戳作为报文的发送时间顺序的,这是实际发送时间的先后,而在本申请中只是报文发送次序的先后,并不对应实际时间,可以将其看作是对每个发送报文的排序。正是由于通过发送次序来区分报文的新鲜度,而不需要对应实际的时间,才使得本申请的方案不需要严格要求所有设备的时间同步。需要说明的是,在本申请实施例中,主要利用帧序列计数来辅助读取报文,使得可以选择更新(时间较晚)的报文,该报文选择规则非常适用于车辆通信的这一特殊应用场景,而这种方法在常见的通信(例如手机等终端之间的通信)并不适用,因为常见的通信场景涉 及的数据量非常庞大,如果采用计数的方式很容易出现,帧序列计数已经达到最大值,却还有数据没有办法存储的情况,导致数据丢失等等问题。且本申请中需要为每个帧ID配置独立的缓存空间,这也是常见的通信场景无法满足的。正因为上述原因,在常见的通信场景中目前均采用时间同步的方式,而无法采用计数的方式。如果将基于时间同步的通信方式应用到车领域通信,则相比于本申请的方案会非常繁琐,没有本申请的方案简洁和易于实现。It should also be noted that, in this application, the sending order of the packets can be understood as the sequence of sending the packets, not the actual sending time of the packets. In other words, in the existing communication, the time stamp is used as the order of the sending time of the message, which is the order of the actual sending time, but in this application, it is only the order of the sending of the message, which does not correspond to the actual time. , which can be thought of as an ordering of each sent message. It is precisely because the freshness of the packets is distinguished by the sending order without corresponding to the actual time, so that the solution of the present application does not need to strictly require the time synchronization of all devices. It should be noted that, in the embodiment of the present application, the frame sequence count is mainly used to assist in reading the message, so that the updated (late time) message can be selected. The message selection rule is very suitable for this aspect of vehicle communication. Special application scenarios, and this method is not suitable for common communication (such as communication between mobile phones and other terminals), because the amount of data involved in common communication scenarios is very large, if the counting method is used, it is easy to appear, the frame sequence count The maximum value has been reached, but there is still no way to store the data, resulting in data loss and other problems. Moreover, in this application, it is necessary to configure an independent buffer space for each frame ID, which is also unsatisfactory in common communication scenarios. Because of the above reasons, in common communication scenarios, the time synchronization method is currently used, and the counting method cannot be used. If the communication method based on time synchronization is applied to the communication in the vehicle field, it will be very complicated compared to the solution of the present application, which is not as concise and easy to implement as the solution of the present application.
可选地,还可以对存储的报文进行读取,例如可以在接收到应用程序发出的读取请求时,从相应的帧ID的缓存空间中读取出报文。Optionally, the stored message may also be read, for example, when a read request sent by the application program is received, the message may be read from the buffer space of the corresponding frame ID.
结合第一方面,在第一方面的某些实现方式中,上述唯一标识符还包括帧序列计数,可以获取读取请求,读取请求包括待读取报文的帧ID;从待读取报文的帧ID所对应的缓存空间中读取至少一个第一报文,该至少一个第一报文的帧序列计数的值用于表示其被发送次序;从至少一个存储的报文中选中对应的帧序列计数的值最大的报文且返回该第二报文。In combination with the first aspect, in some implementations of the first aspect, the above-mentioned unique identifier further includes a frame sequence count, and a read request can be obtained, and the read request includes the frame ID of the message to be read; At least one first message is read from the buffer space corresponding to the frame ID of the message, and the value of the frame sequence count of the at least one first message is used to indicate the order in which it is sent; The packet with the largest frame sequence count value and the second packet is returned.
可选地,可以根据存储的报文的上述帧序列计数,从这至少一个第一报文(即上述接收的第一报文中被存储起来的报文)中选择出合适的报文作为第二报文,第二报文可以理解为响应读取请求所读取出来的报文,或者可以理解为返回给读取请求的发起者的报文。Optionally, according to the above-mentioned frame sequence count of the stored message, a suitable message can be selected from the at least one first message (that is, the message stored in the above-mentioned received first message) as the first message. Two messages, the second message can be understood as a message read in response to the read request, or can be understood as a message returned to the initiator of the read request.
也就是说,当应用程序通过接口函数读取指定帧ID报文时,程序在对应的帧ID缓存区获取来自不同网口的报文。并且按照设定的仲裁逻辑进行冗余报文仲裁,仲裁获胜的报文,通过接口函数返回给用户应用层。在报文读取时会保护该缓冲区,对缓冲区进行加锁互斥处理,当读取过程中有写入请求,则将该请求挂起,当数据拷贝完成立即释放,并写入新接收的报文。That is to say, when the application program reads the specified frame ID message through the interface function, the program obtains the message from different network ports in the corresponding frame ID buffer area. And according to the set arbitration logic, redundant message arbitration is performed, and the message that wins the arbitration is returned to the user application layer through the interface function. When the message is read, the buffer will be protected, and the buffer will be locked and mutually exclusive. When there is a write request during the reading process, the request will be suspended. When the data copy is completed, it will be released immediately, and new received message.
可选地,为了使得接收报文和读取报文不会互相影响,可以在接收报文的过程中不响应读取请求,在读取报文的过程中暂停存储报文。Optionally, in order to prevent the received message and the read message from affecting each other, the message may be temporarily stored during the process of reading the message without responding to the read request during the process of receiving the message.
结合第一方面,在第一方面的某些实现方式中,还可以将至少一个第一报文中未被选中的报文丢弃。也就是说,在读取报文的时候,丢弃没有被选中的报文,这样可以释放缓存空间,降低存储开销。With reference to the first aspect, in some implementations of the first aspect, an unselected packet in the at least one first packet may also be discarded. That is to say, when reading a message, discard the unselected message, which can free up buffer space and reduce storage overhead.
从上文可以看出,每帧报文的帧ID是相同的,帧序列计数也是相同的。但是每帧报文从多个数据传输通道的网口发送出去之前,会装载MAC地址和IP地址,所以从多个网口发出去的报文的MAC地址和IP地址是不同的,因此报文的帧ID和IP地址可以构成报文的唯一标识符。且帧序列计数也可以作为唯一标识符的组成部分。因此对于接收端来说,接收到的第一报文可可能会出现帧ID相同但IP地址不同的情况。As can be seen from the above, the frame ID of each frame of message is the same, and the frame sequence count is also the same. However, before each frame of message is sent from the network ports of multiple data transmission channels, the MAC address and IP address will be loaded, so the MAC address and IP address of the message sent from multiple network ports are different, so the message The frame ID and IP address can form the unique identifier of the packet. And the frame sequence count can also be used as part of the unique identifier. Therefore, for the receiving end, the received first packet may have the same frame ID but different IP addresses.
结合第一方面,在第一方面的某些实现方式中,第一报文是车辆通信装置从多个数据传输通道的网口之一发送的,多个数据传输通道的IP地址互不相同。With reference to the first aspect, in some implementations of the first aspect, the first packet is sent by the vehicle communication device from one of the network ports of multiple data transmission channels, and the IP addresses of the multiple data transmission channels are different from each other.
也就是说,第一报文是利用本申请实施例所提供的具有多个数据传输通道的车辆通信装置发送的。That is to say, the first message is sent by using the vehicle communication device with multiple data transmission channels provided by the embodiment of the present application.
可选地,上述报文,例如第一报文、第二报文、存储的报文等等,可以存在多种报文结构(格式)。例如在明文传输的时候可以没有加密相关的字段,在密文传输的时候可以包括加密相关的字段。Optionally, the above-mentioned messages, such as the first message, the second message, the stored message, etc., may have various message structures (formats). For example, there may be no encryption-related fields in plaintext transmission, and encryption-related fields may be included in ciphertext transmission.
结合第一方面,在第一方面的某些实现方式中,第一报文可以包括:IP首部、用户数 据报协议UDP首部、协议数据单元PDU首部和数据区。With reference to the first aspect, in some implementations of the first aspect, the first message may include: an IP header, a user datagram protocol UDP header, a protocol data unit PDU header, and a data area.
可选地,上述唯一标识符的IP地址可以是被装载在IP首部中的,唯一标识符的其他元素(例如帧ID、帧序列计数)可以是被装载在PDU首部中的。Optionally, the IP address of the above-mentioned unique identifier may be loaded in the IP header, and other elements of the unique identifier (eg, frame ID, frame sequence count) may be loaded in the PDU header.
结合第一方面,在第一方面的某些实现方式中,第一报文还可以包括安全数据传输协议区。With reference to the first aspect, in some implementations of the first aspect, the first packet may further include a secure data transfer protocol area.
结合第一方面,在第一方面的某些实现方式中,第一报文还可以包括数字签名区首部和密钥区。With reference to the first aspect, in some implementations of the first aspect, the first message may further include a digital signature area header and a key area.
第二方面,提供了一种车辆通信的方法,该方法包括:将第一待发送报文进行数据装载,第一待发送报文包括帧标识ID;将第一待发送报文传递给多个数据传输通道,多个数据传输通道的互联网协议IP地址互不相同;为第一待发送报文装载多个数据传输通道的IP地址,得到多个第二待发送报文;在同一发送周期内,发送该多个第二待发送报文。In a second aspect, a method for vehicle communication is provided. The method includes: data loading a first message to be sent, where the first message to be sent includes a frame identification ID; and transmitting the first message to be sent to a plurality of In the data transmission channel, the Internet Protocol IP addresses of multiple data transmission channels are different from each other; load the IP addresses of multiple data transmission channels for the first message to be sent, and obtain multiple second messages to be sent; within the same sending period , and send the plurality of second messages to be sent.
在本申请技术方案中,通过为报文设置唯一标识符,实现报文的识别,从而保证了报文的同步发送和实现报文的甄别。唯一标识符例如可以包括上述帧ID和IP地址。本申请技术方案相比于基于时间同步的通信方式,不要求接收端和发送端的时间同步,同时避免了不同设备的时间精度不同和时间误差等导致的报文甄别错误,也就是说,对于车载设备的精度要求没有过于严格的要求,完全不需要对齐时间,所以适用于现有的车辆中的车载设备。此外,为每个帧ID设置独立的缓存空间,是非常适用于车辆通信场景的方案,使得报文的存储和读取都更为方便快捷。In the technical solution of the present application, the identification of the message is realized by setting a unique identifier for the message, thereby ensuring the synchronous sending of the message and realizing the discrimination of the message. The unique identifier may include, for example, the above-mentioned frame ID and IP address. Compared with the communication method based on time synchronization, the technical solution of the present application does not require time synchronization between the receiving end and the transmitting end, and at the same time avoids message discrimination errors caused by different time precisions and time errors of different devices. The accuracy requirements of the equipment are not too strict, and the alignment time is not required at all, so it is suitable for on-board equipment in existing vehicles. In addition, setting an independent buffer space for each frame ID is a very suitable solution for vehicle communication scenarios, which makes the storage and reading of messages more convenient and faster.
需要说明的是,在同一个发送周期内发送报文可以理解为同时发送报文。这些第二待发送报文中装载的数据、帧ID相同,但是IP地址不同。It should be noted that, sending a message in the same sending period can be understood as sending a message at the same time. The data and frame IDs loaded in these second messages to be sent are the same, but the IP addresses are different.
还需要说明的是,第一方面所述第一报文是指接收端的车辆通信装置所接收到的报文,而第二方面所述第一待发送报文是发送端的车辆通信装置在发送报文前生成的报文。It should also be noted that the first message in the first aspect refers to a message received by the vehicle communication device at the receiving end, and the first message to be sent in the second aspect is that the vehicle communication device at the transmitting end is sending a message. The message generated before the text.
可选地,当第一待发送报文传送到不同的数据传输通道后,可以分别把数据传输通道的IP地址装载进第一待发送报文,从而得到第二待发送报文。也就是说,第二待发送报文是在第一待发送报文的基础上装载了IP地址得到的。Optionally, after the first message to be sent is transmitted to different data transmission channels, the IP addresses of the data transmission channel may be loaded into the first message to be sent, thereby obtaining the second message to be sent. That is to say, the second message to be sent is obtained by loading the IP address on the basis of the first message to be sent.
需要说明的是,第一方面所述第二报文是指接收端的车辆通信装置在读取报文时,从帧ID的缓存空间中读取到的报文,而第二方面所述第二待发送报文是发送端的车辆通信装置在发送报文前,在第一待发送报文的基础上经过进一步处理得到的报文。It should be noted that the second message in the first aspect refers to the message read from the buffer space of the frame ID when the vehicle communication device at the receiving end reads the message, and the second message in the second aspect The message to be sent is a message obtained by further processing on the basis of the first message to be sent by the vehicle communication device at the sending end before sending the message.
可选地,还可以为第一待发送报文装载帧序列计数,使得第二待发送报文中包括帧序列计数。可以理解为,对发送的报文进行计数,也就是说,对每帧报文进行编号,或者可以理解为设置报文帧的时间顺序标识。也就是说,第一报文是带有发送时的时间顺序的标识的。Optionally, the frame sequence count may also be loaded for the first message to be sent, so that the second message to be sent includes the frame sequence count. It can be understood that the sent packets are counted, that is, the packets of each frame are numbered, or it can be understood that the time sequence identifier of the packet frame is set. That is to say, the first packet is identified with the time sequence when it is sent.
可选地,可以定义帧序列计数,将帧序列计数作为报文的顺序识别码。可以在发送报文的一端进行累加,每发送一帧报文,帧序列计数器累加1。Optionally, a frame sequence count can be defined, and the frame sequence count can be used as the sequence identification code of the packet. It can be accumulated at one end of the sending message, and the frame sequence counter will increase by 1 every time a frame is sent.
需要说明的是,在本申请实施例中,帧序列计数用于表示发送报文的先后顺序,可以理解为是发送报文的时间次序(顺序)。例如某个报文帧序列计数为5相当于该报文是第5次发送的,假设另外一个报文的帧序列计数为7相当于该报文是第7次发送的,还可以知道该报文是在帧序列计数为5的报文发送之后发送的,可以看作是,帧序列计数为7的报文的发送时间晚于帧序列计数为5的报文。应理解,上述只是为了说明帧序列计数的含 义的一种示例,不存在限定。It should be noted that, in this embodiment of the present application, the frame sequence count is used to indicate the sequence of sending packets, which can be understood as the time sequence (sequence) of sending packets. For example, a frame sequence count of 5 in a message means that the message is sent for the 5th time. If the frame sequence count of another message is 7, it means that the message is sent for the 7th time. The message is sent after the message with the frame sequence count of 5 is sent. It can be considered that the message with the frame sequence count of 7 is sent later than the message with the frame sequence count of 5. It should be understood that the above is only an example to illustrate the meaning of the frame sequence count, and there is no limitation.
结合第二方面,在第二方面的某些实现方式中,还可以为第二待发送报文装载帧序列计数,帧序列计数用于表示第二待发送报文的发送次序。With reference to the second aspect, in some implementations of the second aspect, a frame sequence count may also be loaded for the second message to be sent, where the frame sequence count is used to indicate the sending order of the second message to be sent.
结合第二方面,在第二方面的某些实现方式中,可以设置帧序列计数初始值为0,且帧序列计数小于或等于预设阈值。With reference to the second aspect, in some implementations of the second aspect, the initial value of the frame sequence count may be set to 0, and the frame sequence count is less than or equal to a preset threshold.
可选地,可以每发送一次第二待发送报文,帧序列计数的值累加1,且当帧序列计数的值累加到大于或等于预设阈值时,将帧序列计数的值归零。Optionally, every time the second to-be-sent message is sent, the frame sequence count value is incremented by 1, and when the frame sequence count value is accumulated to be greater than or equal to a preset threshold, the frame sequence count value is reset to zero.
可选地,上述报文,例如第一待发送报文、第二待发送报文,可以存在多种报文结构(格式)。例如在明文传输的时候可以没有加密相关的字段,在密文传输的时候可以包括加密相关的字段。Optionally, the above-mentioned messages, such as the first message to be sent and the second message to be sent, may have various message structures (formats). For example, there may be no encryption-related fields in plaintext transmission, and encryption-related fields may be included in ciphertext transmission.
从上文可以看出,每帧报文的帧ID是相同的,帧序列计数也是相同的。但是每帧报文从多个数据传输通道的网口发送出去之前,会装载MAC地址和IP地址,所以从多个网口发出去的报文的MAC地址和IP地址是不同的,因此报文的帧ID和IP地址可以构成报文的唯一标识符。且帧序列计数也可以作为唯一标识符的组成部分。As can be seen from the above, the frame ID of each frame of message is the same, and the frame sequence count is also the same. However, before each frame of message is sent from the network ports of multiple data transmission channels, the MAC address and IP address will be loaded, so the MAC address and IP address of the message sent from multiple network ports are different, so the message The frame ID and IP address can form the unique identifier of the packet. And the frame sequence count can also be used as part of the unique identifier.
结合第二方面,在第二方面的某些实现方式中,第一待发送报文和第二待发送报文均包括:IP首部、用户数据报协议UDP首部、协议数据单元PDU首部和数据区,帧ID被装载在第一待发送报文的PDU首部和第二待发送报文的PDU首部中,IP地址被装载在第二待发送报文的IP首部中。In combination with the second aspect, in some implementations of the second aspect, the first message to be sent and the second message to be sent both include: an IP header, a user datagram protocol UDP header, a protocol data unit PDU header and a data area , the frame ID is loaded in the PDU header of the first message to be sent and the PDU header of the second message to be sent, and the IP address is loaded in the IP header of the second message to be sent.
结合第二方面,在第二方面的某些实现方式中,IP地址被装载在第二待发送报文的PDU首部中。With reference to the second aspect, in some implementations of the second aspect, the IP address is loaded in the PDU header of the second message to be sent.
结合第二方面,在第二方面的某些实现方式中,第二待发送报文还包括安全数据传输协议区。With reference to the second aspect, in some implementations of the second aspect, the second message to be sent further includes a secure data transmission protocol area.
结合第二方面,在第二方面的某些实现方式中,第二待发送报文还包括数字签名区首部和密钥区。With reference to the second aspect, in some implementations of the second aspect, the second message to be sent further includes a digital signature area header and a key area.
第三方面,提供了一种车辆通信的装置,包括用于执行第一方面或第二方面任一种可能实现方式中的方法的单元。In a third aspect, an apparatus for vehicle communication is provided, comprising a unit for executing the method in any possible implementation manner of the first aspect or the second aspect.
第四方面,提供了一种车辆通信的装置,包括处理器。该处理器与存储器耦合,可用于执行存储器中的指令或者数据,以实现上述第一方面或第二方面任一种可能实现方式中的方法。可选地,该通信装置还包括存储器。可选地,该通信装置还包括通信接口,处理器与通信接口耦合。In a fourth aspect, an apparatus for vehicle communication is provided, including a processor. The processor is coupled to the memory and can be used to execute instructions or data in the memory, so as to implement the method in any possible implementation manner of the first aspect or the second aspect. Optionally, the communication device further includes a memory. Optionally, the communication device further includes a communication interface, and the processor is coupled to the communication interface.
第五方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序(也可以称为代码,或指令),当所述计算机程序被运行时,使得计算机执行上述第一方面或第二方面任一种可能实现方式中的方法。In a fifth aspect, a computer program product is provided, the computer program product comprising: a computer program (also referred to as code, or instructions), when the computer program is executed, causes the computer to execute the first aspect or the first aspect above. The method in any possible implementation manner of the second aspect.
第六方面,提供了一种计算机可读介质,所述计算机可读介质存储有计算机程序(也可以称为代码,或指令)当其在计算机上运行时,使得计算机执行上述第一方面或第二方面任一种可能实现方式中的方法。In a sixth aspect, a computer-readable medium is provided, the computer-readable medium stores a computer program (also referred to as code, or instruction), when it runs on a computer, causing the computer to execute the above-mentioned first aspect or the first aspect. The method in any possible implementation manner of the second aspect.
附图说明Description of drawings
图1是本申请实施例适用的一种车辆的功能框图。FIG. 1 is a functional block diagram of a vehicle to which the embodiments of the present application are applied.
图2是本申请实施例适用的一种自动驾驶系统的示意图。FIG. 2 is a schematic diagram of an automatic driving system to which an embodiment of the present application is applied.
图3是本申请实施例的一种云侧指令自动驾驶车辆的应用示意图。FIG. 3 is a schematic diagram of an application of a cloud-side command to an autonomous driving vehicle according to an embodiment of the present application.
图4是本申请实施例的车辆通信装置的多数据传输通道冗余通信的示意图。FIG. 4 is a schematic diagram of redundant communication of multiple data transmission channels of a vehicle communication device according to an embodiment of the present application.
图5是本申请实施例的接收冗余报文的处理流程示意图。FIG. 5 is a schematic diagram of a processing flow of receiving redundant packets according to an embodiment of the present application.
图6是本申请实施例的接收冗余报文的处理流程示意图。FIG. 6 is a schematic diagram of a processing flow of receiving redundant packets according to an embodiment of the present application.
图7是本申请实施例的发送冗余报文的处理流程示意图。FIG. 7 is a schematic diagram of a process flow of sending redundant packets according to an embodiment of the present application.
图8是本申请实施例的一种报文帧的格式示意图。FIG. 8 is a schematic diagram of a format of a message frame according to an embodiment of the present application.
图9是本申请实施例的另一种报文帧的格式示意图。FIG. 9 is a schematic diagram of a format of another message frame according to an embodiment of the present application.
图10是本申请实施例的又一种报文帧的格式示意图。FIG. 10 is a schematic diagram of a format of another message frame according to an embodiment of the present application.
图11是本申请实施例的车辆通信装置在同一网络的连接示意图。FIG. 11 is a schematic diagram of the connection of the vehicle communication device according to the embodiment of the present application in the same network.
图12是本申请实施例的车辆通信装置在不同网络的连接示意图。FIG. 12 is a schematic diagram of the connection of the vehicle communication device according to the embodiment of the present application in different networks.
图13是本申请实施例的PDU报文格式的示意图。FIG. 13 is a schematic diagram of a PDU packet format according to an embodiment of the present application.
图14是本申请实施例的冗余报文的发送流程示意图。FIG. 14 is a schematic diagram of a flowchart of sending a redundant packet according to an embodiment of the present application.
图15是本申请实施例的冗余报文的接收流程示意图。FIG. 15 is a schematic diagram of a process of receiving a redundant packet according to an embodiment of the present application.
图16是本申请实施例的一种车辆通信装置的示意性框图。FIG. 16 is a schematic block diagram of a vehicle communication device according to an embodiment of the present application.
图17是本申请实施例的一种车辆通信装置的硬件结构示意图。FIG. 17 is a schematic diagram of a hardware structure of a vehicle communication device according to an embodiment of the present application.
图18是本申请实施例的一种车辆通信装置的示意图。FIG. 18 is a schematic diagram of a vehicle communication device according to an embodiment of the present application.
图19是本申请实施例的一种车辆通信装置的硬件结构示意图。FIG. 19 is a schematic diagram of a hardware structure of a vehicle communication device according to an embodiment of the present application.
具体实施方式detailed description
本申请实施例所提供的车辆通信方法和/或车辆通信装置可以应用于各类车辆。这些方法和/或装置既可以应用于人工驾驶,又可以应用于辅助驾驶,还可以应用于自动驾驶。下面结合附图,对本申请实施例的技术方案进行介绍。The vehicle communication method and/or the vehicle communication device provided by the embodiments of the present application can be applied to various types of vehicles. These methods and/or devices can be applied to both manual driving, assisted driving, and automatic driving. The technical solutions of the embodiments of the present application will be introduced below with reference to the accompanying drawings.
图1是本申请实施例适用的一种车辆的功能框图。其中,车辆100可以是人工驾驶车辆,或者可以将车辆100配置可以为完全或部分地自动驾驶模式。FIG. 1 is a functional block diagram of a vehicle to which the embodiments of the present application are applied. Therein, the vehicle 100 may be a human-driven vehicle, or the vehicle 100 may be configured in a fully or partially autonomous driving mode.
在一个示例中,车辆100可以在处于自动驾驶模式中的同时控制自车,并且可通过人为操作来确定车辆及其周边环境的当前状态,确定周边环境中的至少一个其他车辆的可能行为,并确定其他车辆执行可能行为的可能性相对应的置信水平,基于所确定的信息来控制车辆100。在车辆100处于自动驾驶模式中时,可以将车辆100置为在没有和人交互的情况下操作。In one example, the vehicle 100 may control the ego vehicle while in an autonomous driving mode, and may determine the current state of the vehicle and its surrounding environment through human manipulation, determine the possible behavior of at least one other vehicle in the surrounding environment, and A confidence level corresponding to the likelihood that other vehicles will perform the possible behavior is determined, and the vehicle 100 is controlled based on the determined information. When the vehicle 100 is in an autonomous driving mode, the vehicle 100 may be placed to operate without human interaction.
车辆100中可以包括各种子系统,例如,行进系统110、传感系统120、控制系统130、一个或多个外围设备140以及电源160、计算机系统150和用户接口170。Various subsystems may be included in vehicle 100 , such as travel system 110 , sensing system 120 , control system 130 , one or more peripherals 140 and power supply 160 , computer system 150 , and user interface 170 .
可选地,车辆100可以包括更多或更少的子系统,并且每个子系统可包括多个元件。另外,车辆100的每个子系统和元件可以通过有线或者无线互连。Alternatively, the vehicle 100 may include more or fewer subsystems, and each subsystem may include multiple elements. Additionally, each of the subsystems and elements of the vehicle 100 may be interconnected by wire or wirelessly.
示例性地,行进系统110可以包括用于向车辆100提供动力运动的组件。在一个实施例中,行进系统110可以包括引擎111、传动装置112、能量源113和车轮114/轮胎。其中,引擎111可以是内燃引擎、电动机、空气压缩引擎或其他类型的引擎组合;例如,汽油发动机和电动机组成的混动引擎,内燃引擎和空气压缩引擎组成的混动引擎。引擎111可以将能量源113转换成机械能量。For example, the travel system 110 may include components for providing powered motion to the vehicle 100 . In one embodiment, travel system 110 may include engine 111, transmission 112, energy source 113, and wheels 114/tires. The engine 111 may be an internal combustion engine, an electric motor, an air compression engine or other types of engine combinations; for example, a hybrid engine composed of a gasoline engine and an electric motor, or a hybrid engine composed of an internal combustion engine and an air compression engine. Engine 111 may convert energy source 113 into mechanical energy.
示例性地,能量源113可以包括汽油、柴油、其他基于石油的燃料、丙烷、其他基于压缩气体的燃料、乙醇、太阳能电池板、电池和其他电力来源。能量源113也可以为车辆100的其他系统提供能量。Illustratively, the energy source 113 may include gasoline, diesel, other petroleum-based fuels, propane, other compressed gas-based fuels, ethanol, solar panels, batteries, and other sources of electricity. The energy source 113 may also provide energy to other systems of the vehicle 100 .
示例性地,传动装置112可以包括变速箱、差速器和驱动轴;其中,传动装置112可以将来自引擎111的机械动力传送到车轮114。Illustratively, transmission 112 may include a gearbox, a differential, and a driveshaft; wherein transmission 112 may transmit mechanical power from engine 111 to wheels 114 .
在一个实施例中,传动装置112还可以包括其他器件,比如离合器。其中,驱动轴可以包括可耦合到一个或多个车轮114的一个或多个轴。In one embodiment, the transmission 112 may also include other devices, such as clutches. Among other things, the drive shafts may include one or more axles that may be coupled to one or more of the wheels 114 .
示例性地,传感系统120可以包括感测关于车辆100周边的环境的信息的若干个传感器。Illustratively, the sensing system 120 may include several sensors that sense information about the environment surrounding the vehicle 100 .
例如,传感系统120可以包括定位系统121(例如,全球定位系统(global positioning system,GPS)、北斗系统或者其他定位系统)、惯性测量单元(inertial measurement unit,IMU)122、雷达123、激光测距仪124、相机125以及车速传感器126。传感系统120还可以包括被监视车辆100的内部系统的传感器(例如,车内空气质量监测器、燃油量表、机油温度表等)。来自这些传感器中的一个或多个的传感器数据可用于检测对象及其相应特性(位置、形状、方向、速度等)。这种检测和识别是自主车辆100的安全操作的关键功能。For example, the sensing system 120 may include a positioning system 121 (eg, a global positioning system (GPS), BeiDou system, or other positioning system), an inertial measurement unit (IMU) 122, a radar 123, a laser Distance meter 124 , camera 125 and vehicle speed sensor 126 . The sensing system 120 may also include sensors that monitor the internal systems of the vehicle 100 (eg, an in-vehicle air quality monitor, a fuel gauge, an oil temperature gauge, etc.). Sensor data from one or more of these sensors can be used to detect objects and their corresponding characteristics (position, shape, orientation, velocity, etc.). This detection and identification is a critical function for the safe operation of the autonomous vehicle 100 .
其中,定位系统121可以用于估计车辆100的地理位置。IMU 122可以用于基于惯性加速度来感测车辆100的位置和朝向变化。在一个实施例中,IMU 122可以是加速度计和陀螺仪的组合。Among others, the positioning system 121 may be used to estimate the geographic location of the vehicle 100 . The IMU 122 may be used to sense position and orientation changes of the vehicle 100 based on inertial acceleration. In one embodiment, IMU 122 may be a combination of an accelerometer and a gyroscope.
示例性地,雷达123可以利用无线电信号来感测车辆100的周边环境内的物体。在一些实施例中,除了感测物体以外,雷达123还可用于感测物体的速度和/或前进方向。Illustratively, the radar 123 may utilize radio signals to sense objects within the surrounding environment of the vehicle 100 . In some embodiments, in addition to sensing objects, radar 123 may be used to sense the speed and/or heading of objects.
示例性地,激光测距仪124可以利用激光来感测车辆100所位于的环境中的物体。在一些实施例中,激光测距仪124可以包括一个或多个激光源、激光扫描器以及一个或多个检测器,以及其他系统组件。For example, the laser rangefinder 124 may utilize laser light to sense objects in the environment in which the vehicle 100 is located. In some embodiments, the laser rangefinder 124 may include one or more laser sources, laser scanners, and one or more detectors, among other system components.
示例性地,相机125可以用于捕捉车辆100的周边环境的多个图像。例如,相机125可以是静态相机或视频相机。Illustratively, camera 125 may be used to capture multiple images of the surrounding environment of vehicle 100 . For example, camera 125 may be a still camera or a video camera.
示例性地,车速传感器126可以用于测量车辆100的速度。例如,可以对车辆进行实时测速。测得的车速可以传送给控制系统130以实现对车辆的控制。Illustratively, the vehicle speed sensor 126 may be used to measure the speed of the vehicle 100 . For example, real-time speed measurement of the vehicle can be performed. The measured vehicle speed may be communicated to the control system 130 to effect control of the vehicle.
如图1所示,控制系统130为控制车辆100及其组件的操作。控制系统130可以包括各种元件,比如可以包括转向系统131、油门132、制动单元133、计算机视觉系统134、路线控制系统135以及障碍规避系统136。As shown in FIG. 1 , the control system 130 controls the operation of the vehicle 100 and its components. Control system 130 may include various elements, such as may include steering system 131 , throttle 132 , braking unit 133 , computer vision system 134 , route control system 135 , and obstacle avoidance system 136 .
示例性地,转向系统131可以操作来调整车辆100的前进方向。例如,在一个实施例中可以为方向盘系统。油门132可以用于控制引擎111的操作速度并进而控制车辆100的速度。For example, the steering system 131 may operate to adjust the heading of the vehicle 100 . For example, in one embodiment it may be a steering wheel system. The throttle 132 may be used to control the operating speed of the engine 111 and thus the speed of the vehicle 100 .
示例性地,制动单元133可以用于控制车辆100减速;制动单元133可以使用摩擦力来减慢车轮114。在其他实施例中,制动单元133可以将车轮114的动能转换为电流。制动单元133也可以采取其他形式来减慢车轮114转速从而控制车辆100的速度。Illustratively, the braking unit 133 may be used to control the deceleration of the vehicle 100 ; the braking unit 133 may use friction to slow the wheels 114 . In other embodiments, the braking unit 133 may convert the kinetic energy of the wheels 114 into electrical current. The braking unit 133 may also take other forms to slow the wheels 114 to control the speed of the vehicle 100 .
如图1所示,计算机视觉系统134可以操作来处理和分析由相机125捕捉的图像以便识别车辆100周边环境中的物体和/或特征。上述物体和/或特征可以包括交通信号、道路 边界和障碍物。计算机视觉系统134可以使用物体识别算法、运动中恢复结构(structure from motion,SFM)算法、视频跟踪和其他计算机视觉技术。在一些实施例中,计算机视觉系统134可以用于为环境绘制地图、跟踪物体、估计物体的速度等等。As shown in FIG. 1 , computer vision system 134 is operable to process and analyze images captured by camera 125 in order to identify objects and/or features in the environment surrounding vehicle 100 . Such objects and/or features may include traffic signals, road boundaries and obstacles. Computer vision system 134 may use object recognition algorithms, structure from motion (SFM) algorithms, video tracking, and other computer vision techniques. In some embodiments, the computer vision system 134 may be used to map the environment, track objects, estimate the speed of objects, and the like.
示例性地,路线控制系统135可以用于确定车辆100的行驶路线。在一些实施例中,路线控制系统135可结合来自传感器、GPS和一个或多个预定地图的数据以为车辆100确定行驶路线。Illustratively, the route control system 135 may be used to determine the route of travel of the vehicle 100 . In some embodiments, the route control system 135 may combine data from sensors, GPS, and one or more predetermined maps to determine a driving route for the vehicle 100 .
如图1所示,障碍规避系统136可以用于识别、评估和避免或者以其他方式越过车辆100的环境中的潜在障碍物。As shown in FIG. 1 , the obstacle avoidance system 136 may be used to identify, evaluate and avoid or otherwise traverse potential obstacles in the environment of the vehicle 100 .
在一个实例中,控制系统130可以增加或替换地包括除了所示出和描述的那些以外的组件。或者也可以减少一部分上述示出的组件。In one example, control system 130 may additionally or alternatively include components in addition to those shown and described. Alternatively, some of the components shown above may be reduced.
如图1所示,车辆100可以通过外围设备140与外部传感器、其他车辆、其他计算机系统或用户之间进行交互;其中,外围设备140可包括无线通信系统141、车载电脑142、麦克风143和/或扬声器144。As shown in FIG. 1, the vehicle 100 may interact with external sensors, other vehicles, other computer systems or users through peripheral devices 140; wherein the peripheral devices 140 may include a wireless communication system 141, an on-board computer 142, a microphone 143 and/or a or speaker 144.
在一些实施例中,外围设备140可以提供车辆100与用户接口170交互的手段。例如,车载电脑142可以向车辆100的用户提供信息。用户接口116还可操作车载电脑142来接收用户的输入;车载电脑142可以通过触摸屏进行操作。在其他情况中,外围设备140可以提供用于车辆100与位于车内的其它设备通信的手段。例如,麦克风143可以从车辆100的用户接收音频(例如,语音命令或其他音频输入)。类似地,扬声器144可以向车辆100的用户输出音频。In some embodiments, peripherals 140 may provide a means for vehicle 100 to interact with user interface 170 . For example, the onboard computer 142 may provide information to the user of the vehicle 100 . The user interface 116 can also operate the onboard computer 142 to receive user input; the onboard computer 142 can be operated through a touch screen. In other cases, peripheral device 140 may provide a means for vehicle 100 to communicate with other devices located within the vehicle. For example, microphone 143 may receive audio (eg, voice commands or other audio input) from a user of vehicle 100 . Similarly, speakers 144 may output audio to a user of vehicle 100 .
如图1所述,无线通信系统141可以直接地或者经由通信网络来与一个或多个设备无线通信。例如,无线通信系统141可以使用3G蜂窝通信;例如,码分多址(code division multiple access,CDMA))、EVD0、全球移动通信系统(global system for mobile communications,GSM)/通用分组无线服务(general packet radio service,GPRS),或者4G蜂窝通信,例如长期演进(long term evolution,LTE);或者,5G蜂窝通信。无线通信系统141可以利用无线上网(WiFi)与无线局域网(wireless local area network,WLAN)通信。As depicted in FIG. 1, wireless communication system 141 may wirelessly communicate with one or more devices, either directly or via a communication network. For example, wireless communication system 141 may use 3G cellular communications; eg, code division multiple access (CDMA)), EVDO, global system for mobile communications (GSM)/general packet radio service (general packet radio service, GPRS), or 4G cellular communications, such as long term evolution (LTE); or, 5G cellular communications. The wireless communication system 141 may communicate with a wireless local area network (WLAN) using wireless Internet access (WiFi).
在一些实施例中,无线通信系统141可以利用红外链路、蓝牙或者紫蜂协议(ZigBee)与设备直接通信;其他无线协议,例如各种车辆通信系统,例如,无线通信系统141可以包括一个或多个专用短程通信(dedicated short range communications,DSRC)设备,这些设备可包括车辆和/或路边台站之间的公共和/或私有数据通信。In some embodiments, the wireless communication system 141 may communicate directly with the device using an infrared link, Bluetooth, or ZigBee; other wireless protocols, such as various vehicle communication systems, for example, the wireless communication system 141 may include an or A number of dedicated short range communications (DSRC) devices, which may include public and/or private data communications between vehicles and/or roadside stations.
需要说明的是,本申请实施例所提供的通信方案主要适用于车载设备之间利用以太网进行通信的场景,可以是同一车辆的不同车载设备之间的通信,也可以是不同车辆的车载设备之间的通信。在本申请实施例中,车辆通信装置可以是上述无线通信系统141中的任意设备,也可以是集成在任意车载设备中的一个通信装置,例如可以是集成在制动单元133中的一个通信装置,不再一一列举。It should be noted that the communication solutions provided in the embodiments of the present application are mainly applicable to scenarios in which on-board devices communicate via Ethernet, which may be communication between different on-board devices of the same vehicle, or on-board devices of different vehicles. communication between. In this embodiment of the present application, the vehicle communication device may be any device in the above wireless communication system 141 , or may be a communication device integrated in any vehicle-mounted device, for example, may be a communication device integrated in the braking unit 133 , no longer list them one by one.
如图1所示,电源160可以向车辆100的各种组件提供电力。在一个实施例中,电源160可以为可再充电锂离子电池或铅酸电池。这种电池的一个或多个电池组可被配置为电源为车辆100的各种组件提供电力。在一些实施例中,电源160和能量源113可一起实现,例如一些全电动车中那样。As shown in FIG. 1 , power supply 160 may provide power to various components of vehicle 100 . In one embodiment, the power source 160 may be a rechargeable lithium-ion battery or a lead-acid battery. One or more battery packs of such a battery may be configured as a power source to provide power to various components of the vehicle 100 . In some embodiments, power source 160 and energy source 113 may be implemented together, such as in some all-electric vehicles.
示例性地,车辆100的部分或所有功能可以受计算机系统150控制,其中,计算机系统150可以包括至少一个处理器151,处理器151执行存储在例如存储器152中的非暂态计算机可读介质中的指令153。计算机系统150还可以是采用分布式方式控制车辆100的个体组件或子系统的多个计算设备。Illustratively, some or all of the functions of the vehicle 100 may be controlled by a computer system 150 , wherein the computer system 150 may include at least one processor 151 that executes execution in a non-transitory computer-readable medium stored in, for example, memory 152 . Instruction 153. Computer system 150 may also be multiple computing devices that control individual components or subsystems of vehicle 100 in a distributed fashion.
例如,处理器151可以是任何常规的处理器,诸如商业可获得的中央处理器(central processing unit,CPU)。For example, processor 151 may be any conventional processor, such as a commercially available central processing unit (CPU).
可选地,该处理器可以是诸如专用集成电路(application specific integrated circuit,ASIC)或其它基于硬件的处理器的专用设备。尽管图1功能性地图示了处理器、存储器、和在相同块中的计算机的其它元件,但是本领域的普通技术人员应该理解该处理器、计算机、或存储器实际上可以包括可以或者可以不存储在相同的物理外壳内的多个处理器、计算机或存储器。例如,存储器可以是硬盘驱动器或位于不同于计算机的外壳内的其它存储介质。因此,对处理器或计算机的引用将被理解为包括对可以或者可以不并行操作的处理器或计算机或存储器的集合的引用。不同于使用单一的处理器来执行此处所描述的步骤,诸如转向组件和减速组件的一些组件每个都可以具有其自己的处理器,所述处理器只执行与特定于组件的功能相关的计算。Alternatively, the processor may be a dedicated device such as an application specific integrated circuit (ASIC) or other hardware-based processor. Although FIG. 1 functionally illustrates a processor, memory, and other elements of the computer in the same block, one of ordinary skill in the art will understand that the processor, computer, or memory may actually include storage that may or may not be Multiple processors, computers or memories within the same physical enclosure. For example, the memory may be a hard drive or other storage medium located within an enclosure other than a computer. Thus, reference to a processor or computer will be understood to include reference to a collection of processors or computers or memories that may or may not operate in parallel. Rather than using a single processor to perform the steps described herein, some components such as the steering and deceleration components may each have their own processor that only performs computations related to component-specific functions .
在此处所描述的各个方面中,处理器可以位于远离该车辆并且与该车辆进行无线通信。在其它方面中,此处所描述的过程中的一些在布置于车辆内的处理器上执行而其它则由远程处理器执行,包括采取执行单一操纵的必要步骤。In various aspects described herein, a processor may be located remotely from the vehicle and in wireless communication with the vehicle. In other aspects, some of the processes described herein are performed on a processor disposed within the vehicle while others are performed by a remote processor, including taking steps necessary to perform a single maneuver.
在一些实施例中,存储器152可包含指令153(例如,程序逻辑),指令153可以被处理器151来执行车辆100的各种功能,包括以上描述的那些功能。存储器152也可包括额外的指令,比如包括向行进系统110、传感系统120、控制系统130和外围设备140中的一个或多个发送数据、从其接收数据、与其交互和/或对其进行控制的指令。In some embodiments, memory 152 may contain instructions 153 (eg, program logic) that may be used by processor 151 to perform various functions of vehicle 100 , including those described above. Memory 152 may also include additional instructions, such as including sending data to, receiving data from, interacting with, and/or performing data processing on one or more of travel system 110 , sensing system 120 , control system 130 , and peripherals 140 control commands.
示例性地,除了指令153以外,存储器152还可存储数据,例如,道路地图、路线信息,车辆的位置、方向、速度以及其它这样的车辆数据,以及其他信息。这种信息可在车辆100在自主、半自主和/或手动模式中操作期间被车辆100和计算机系统150使用。Illustratively, in addition to instructions 153, memory 152 may store data such as road maps, route information, vehicle location, direction, speed, and other such vehicle data, among other information. Such information may be used by the vehicle 100 and the computer system 150 during operation of the vehicle 100 in autonomous, semi-autonomous and/or manual modes.
如图1所示,用户接口170可以用于向车辆100的用户提供信息或从其接收信息。可选地,用户接口170可以包括在外围设备140的集合内的一个或多个输入/输出设备,例如,无线通信系统141、车载电脑142、麦克风143和扬声器144。As shown in FIG. 1 , user interface 170 may be used to provide information to or receive information from a user of vehicle 100 . Optionally, user interface 170 may include one or more input/output devices within the set of peripheral devices 140 , eg, wireless communication system 141 , onboard computer 142 , microphone 143 , and speaker 144 .
在本申请的实施例中,计算机系统150可以基于从各种子系统(例如,行进系统110、传感系统120和控制系统130)以及从用户接口170接收的输入来控制车辆100的功能。例如,计算机系统150可以利用来自控制系统130的输入以便控制制动单元133来避免由传感系统120和障碍规避系统136检测到的障碍物。在一些实施例中,计算机系统150可操作来对车辆100及其子系统的许多方面提供控制。In embodiments of the present application, computer system 150 may control functions of vehicle 100 based on input received from various subsystems (eg, travel system 110 , sensing system 120 , and control system 130 ) and from user interface 170 . For example, computer system 150 may utilize input from control system 130 to control braking unit 133 to avoid obstacles detected by sensing system 120 and obstacle avoidance system 136 . In some embodiments, computer system 150 is operable to provide control of various aspects of vehicle 100 and its subsystems.
可选地,上述这些组件中的一个或多个可与车辆100分开安装或关联。例如,存储器152可以部分或完全地与车辆100分开存在。上述组件可以按有线和/或无线方式来通信地耦合在一起。Alternatively, one or more of these components described above may be installed or associated with the vehicle 100 separately. For example, memory 152 may exist partially or completely separate from vehicle 100 . The above-described components may be communicatively coupled together in a wired and/or wireless manner.
可选地,上述组件只是一个示例,实际应用中,上述各个模块中的组件有可能根据实际需要增添或者删除,图1不应理解为对本申请实施例的限制。Optionally, the above component is just an example. In practical applications, components in each of the above modules may be added or deleted according to actual needs, and FIG. 1 should not be construed as a limitation on the embodiments of the present application.
可选地,车辆100可以是在道路行进的自动驾驶汽车,可以识别其周围环境内的物体 以确定对当前速度的调整。物体可以是其它车辆、交通控制设备、或者其它类型的物体。在一些示例中,可以独立地考虑每个识别的物体,并且基于物体的各自的特性,诸如它的当前速度、加速度、与车辆的间距等,可以用来确定自动驾驶汽车所要调整的速度。Alternatively, the vehicle 100 may be a self-driving car traveling on a road and may recognize objects in its surroundings to determine an adjustment to the current speed. The objects may be other vehicles, traffic control devices, or other types of objects. In some examples, each identified object may be considered independently, and based on the object's respective characteristics, such as its current speed, acceleration, distance from the vehicle, etc., may be used to determine the speed at which the autonomous vehicle is to adjust.
可选地,车辆100或者与车辆100相关联的计算设备(如图1的计算机系统150、计算机视觉系统134、存储器152)可以基于所识别的物体的特性和周围环境的状态(例如,交通、雨、道路上的冰等等)来预测所述识别的物体的行为。Alternatively, the vehicle 100 or a computing device associated with the vehicle 100 (eg, computer system 150, computer vision system 134, memory 152 of FIG. rain, ice on the road, etc.) to predict the behavior of the identified object.
可选地,每一个所识别的物体都依赖于彼此的行为,因此,还可以将所识别的所有物体全部一起考虑来预测单个识别的物体的行为。车辆100能够基于预测的所述识别的物体的行为来调整它的速度。换句话说,自动驾驶汽车能够基于所预测的物体的行为来确定车辆将需要调整到(例如,加速、减速、或者停止)稳定状态。在这个过程中,也可以考虑其它因素来确定车辆100的速度,诸如,车辆100在行驶的道路中的横向位置、道路的曲率、静态和动态物体的接近度等等。Optionally, each of the identified objects is dependent on the behavior of the other, so it is also possible to predict the behavior of a single identified object by considering all of the identified objects together. The vehicle 100 can adjust its speed based on the predicted behavior of the identified object. In other words, the self-driving car can determine that the vehicle will need to adjust (eg, accelerate, decelerate, or stop) to a steady state based on the predicted behavior of the object. In this process, other factors may also be considered to determine the speed of the vehicle 100, such as the lateral position of the vehicle 100 in the road being traveled, the curvature of the road, the proximity of static and dynamic objects, and the like.
除了提供调整自动驾驶汽车的速度的指令之外,计算设备还可以提供修改车辆100的转向角的指令,以使得自动驾驶汽车遵循给定的轨迹和/或维持与自动驾驶汽车附近的物体(例如,道路上的相邻车道中的轿车)的安全横向和纵向距离。In addition to providing instructions to adjust the speed of the self-driving car, the computing device may also provide instructions to modify the steering angle of the vehicle 100 so that the self-driving car follows a given trajectory and/or maintains contact with objects in the vicinity of the self-driving car (eg, , cars in adjacent lanes on the road) safe lateral and longitudinal distances.
上述车辆100可以为轿车、卡车、摩托车、公共汽车、船、飞机、直升飞机、割草机、娱乐车、游乐场车辆、施工设备、电车、高尔夫球车、火车、和手推车等,本申请实施例不做特别的限定。The above-mentioned vehicle 100 can be a car, a truck, a motorcycle, a bus, a boat, an airplane, a helicopter, a lawn mower, a recreational vehicle, a playground vehicle, construction equipment, a tram, a golf cart, a train, a cart, etc. The application examples are not particularly limited.
在一种可能的实现方式中,上述图1所示的车辆100可以是自动驾驶车辆,下面对自动驾驶系统的进行详细描述。In a possible implementation manner, the vehicle 100 shown in FIG. 1 may be an automatic driving vehicle, and the automatic driving system will be described in detail below.
图2是本申请实施例适用的一种自动驾驶系统的示意图。FIG. 2 is a schematic diagram of an automatic driving system to which an embodiment of the present application is applied.
如图2所示的自动驾驶系统包括计算机系统201,其中,计算机系统201包括处理器203,处理器203和系统总线205耦合。处理器203可以是一个或者多个处理器,其中,每个处理器都可以包括一个或多个处理器核。显示适配器207(video adapter),显示适配器可以驱动显示器209,显示器209和系统总线205耦合。系统总线205可以通过总线桥211和输入输出(I/O)总线213耦合,I/O接口215和I/O总线耦合。I/O接口215和多种I/O设备进行通信,比如,输入设备217(如:键盘,鼠标,触摸屏等),媒体盘221(media tray),(例如,CD-ROM,多媒体接口等)。收发器223可以发送和/或接受无线电通信信号,摄像头255可以捕捉景田和动态数字视频图像。其中,和I/O接口215相连接的接口可以是USB端口225。The automatic driving system shown in FIG. 2 includes a computer system 201 , wherein the computer system 201 includes a processor 203 , and the processor 203 is coupled with a system bus 205 . The processor 203 may be one or more processors, wherein each processor may include one or more processor cores. A display adapter 207 (video adapter), which can drive a display 209, is coupled to the system bus 205. The system bus 205 may be coupled to an input output (I/O) bus 213 through a bus bridge 211, and an I/O interface 215 may be coupled to the I/O bus. I/O interface 215 communicates with various I/O devices, such as input device 217 (eg, keyboard, mouse, touch screen, etc.), media tray 221 (media tray), (eg, CD-ROM, multimedia interface, etc.) . The transceiver 223 can send and/or receive radio communication signals, and the camera 255 can capture landscape and dynamic digital video images. The interface connected to the I/O interface 215 may be the USB port 225 .
其中,处理器203可以是任何传统处理器,比如,精简指令集计算(reduced instruction set computer,RISC)处理器、复杂指令集计算(complex instruction set computer,CISC)处理器或上述的组合。The processor 203 may be any conventional processor, such as a reduced instruction set computing (reduced instruction set computer, RISC) processor, a complex instruction set computing (complex instruction set computer, CISC) processor or a combination of the above.
可选地,处理器203可以是诸如专用集成电路(ASIC)的专用装置;处理器203可以是神经网络处理器或者是神经网络处理器和上述传统处理器的组合。Alternatively, the processor 203 may be a dedicated device such as an application specific integrated circuit (ASIC); the processor 203 may be a neural network processor or a combination of a neural network processor and the above-mentioned conventional processors.
可选地,在一些实施例中,计算机系统201可位于远离自动驾驶车辆的地方,并且可与自动驾驶车辆无线通信。在其它方面,本申请所述的一些过程在设置在自动驾驶车辆内的处理器上执行,其它由远程处理器执行,包括采取执行单个操纵所需的动作。Alternatively, in some embodiments, computer system 201 may be located remotely from the autonomous vehicle and may communicate wirelessly with the autonomous vehicle. In other aspects, some of the processes described herein are performed on a processor disposed within the autonomous vehicle and others are performed by a remote processor, including taking actions required to perform a single maneuver.
计算机系统201可以通过网络接口229和软件部署服务器249通信。网络接口229可 以是硬件网络接口,比如,网卡。网络227可以是外部网络,比如,因特网,也可以是内部网络,比如以太网或者虚拟私人网络(virtual private network,VPN)。可选地,网络227还可以是无线网络,比如WiFi网络,蜂窝网络等。 Computer system 201 may communicate with software deployment server 249 through network interface 229 . Network interface 229 may be a hardware network interface, such as a network card. The network 227 may be an external network, such as the Internet, or an internal network, such as an Ethernet network or a virtual private network (VPN). Optionally, the network 227 may also be a wireless network, such as a WiFi network, a cellular network, and the like.
需要说明的是,本申请实施例所提供的通信方案主要适用于车载设备之间利用以太网进行通信的场景,可以是同一车辆的不同车载设备之间的通信,也可以是不同车辆的车载设备之间的通信。在本申请实施例中,车辆通信装置可以是独立于车载设备之外的通信装置,也可以是集成在任意车载设备中的通信装置。It should be noted that the communication solutions provided in the embodiments of the present application are mainly applicable to scenarios in which on-board devices communicate via Ethernet, which may be communication between different on-board devices of the same vehicle, or on-board devices of different vehicles. communication between. In this embodiment of the present application, the vehicle communication device may be a communication device independent of the in-vehicle device, or may be a communication device integrated in any in-vehicle device.
如图2所示,硬盘驱动接口和系统总线205耦合,硬件驱动器接口231可以与硬盘驱动器233相连接,系统内存235和系统总线205耦合。运行在系统内存235的数据可以包括操作系统237和应用程序243。其中,操作系统237可以包括解析器(shell)239和内核(kernel)241。shell 239是介于使用者和操作系统之内核(kernel)间的一个接口。shell可以是操作系统最外面的一层;shell可以管理使用者与操作系统之间的交互,比如,等待使用者的输入,向操作系统解释使用者的输入,并且处理各种各样的操作系统的输出结果。内核241可以由操作系统中用于管理存储器、文件、外设和系统资源的那些部分组成。直接与硬件交互,操作系统内核通常运行进程,并提供进程间的通信,提供CPU时间片管理、中断、内存管理、IO管理等等。应用程序243包括控制汽车自动驾驶相关的程序,比如,管理自动驾驶的汽车和路上障碍物交互的程序,控制自动驾驶汽车路线或者速度的程序,控制自动驾驶汽车和路上其他自动驾驶汽车交互的程序。应用程序243也存在于软件部署服务器249的系统上。在一个实施例中,在需要执行自动驾驶相关程序247时,计算机系统201可以从软件部署服务器249下载应用程序。As shown in FIG. 2 , the hard disk drive interface is coupled with the system bus 205 , the hardware drive interface 231 can be connected with the hard disk drive 233 , and the system memory 235 is coupled with the system bus 205 . Data running in system memory 235 may include operating system 237 and application programs 243 . The operating system 237 may include a parser (shell) 239 and a kernel (kernel) 241 . The shell 239 is an interface between the user and the kernel of the operating system. The shell can be the outermost layer of the operating system; the shell can manage the interaction between the user and the operating system, for example, waiting for user input, interpreting user input to the operating system, and processing various operating systems output result. Kernel 241 may consist of those parts of the operating system that manage memory, files, peripherals, and system resources. Interacting directly with hardware, the operating system kernel usually runs processes and provides inter-process communication, providing CPU time slice management, interrupts, memory management, IO management, and more. Application 243 includes programs that control the autonomous driving of the car, for example, programs that manage the interaction of the autonomous car with obstacles on the road, programs that control the route or speed of the autonomous car, and programs that control the interaction of the autonomous car with other autonomous vehicles on the road. . Application 243 also exists on the system of software deployment server 249 . In one embodiment, the computer system 201 may download the application program from the software deployment server 249 when the autonomous driving related program 247 needs to be executed.
例如,应用程序243还可以是自动驾驶汽车和路上车道线交互的程序,也就是说可以实时跟踪车道线的程序。For example, the application program 243 may also be a program for the autonomous vehicle to interact with the road lane lines, that is, a program that can track the lane lines in real time.
例如,应用程序243还可以是控制自动驾驶车辆进行自动泊车的程序。For example, the application program 243 may also be a program for controlling the self-driving vehicle to perform automatic parking.
示例性地,传感器253可以与计算机系统201关联,传感器253可以用于探测计算机201周围的环境。Illustratively, sensors 253 may be associated with computer system 201 , and sensors 253 may be used to detect the environment surrounding computer 201 .
举例来说,传感器253可以探测路上的车道,比如可以探测到车道线,并能够在车辆移动(如正在行驶)过程中实时跟踪到车辆前方一定范围内的车道线变化。又例如,传感器253可以探测动物,汽车,障碍物和人行横道等,进一步传感器还可以探测上述动物,汽车,障碍物和人行横道等物体周围的环境,比如:动物周围的环境,例如,动物周围出现的其他动物,天气条件,周围环境的光亮度等。For example, the sensor 253 can detect the lane on the road, such as the lane line, and can track the change of the lane line within a certain range in front of the vehicle in real time when the vehicle is moving (eg, while driving). For another example, the sensor 253 can detect animals, cars, obstacles and pedestrian crossings, etc., and further sensors can also detect the environment around objects such as the above-mentioned animals, cars, obstacles and pedestrian crossings, such as: the environment around animals, for example, the environment around animals Other animals, weather conditions, ambient light levels, etc.
可选地,如果计算机201位于自动驾驶的汽车上,传感器可以是摄像头,红外线感应器,化学检测器,麦克风等。Alternatively, if the computer 201 is located in an autonomous vehicle, the sensors may be cameras, infrared sensors, chemical detectors, microphones, and the like.
示例性地,在车道线跟踪的场景中,传感器253可以用于探测车辆前方的车道线,从而使得车辆能够感知在行进过程中车道的变化,以据此对车辆的行驶进行实时规划和调整。Exemplarily, in the scenario of lane line tracking, the sensor 253 can be used to detect the lane line in front of the vehicle, so that the vehicle can perceive the change of the lane during traveling, so as to plan and adjust the driving of the vehicle in real time accordingly.
示例性地,在自动泊车的场景中,传感器253可以用于探测车辆周围的库位和周边障碍物的尺寸或者位置,从而使得车辆能够感知库位和周边障碍物的距离,在泊车时进行碰撞检测,防止车辆与障碍物发生碰撞。Exemplarily, in the scenario of automatic parking, the sensor 253 can be used to detect the size or position of the storage space and surrounding obstacles around the vehicle, so that the vehicle can perceive the distance between the storage space and surrounding obstacles, and when parking Collision detection is performed to prevent vehicles from colliding with obstacles.
在一个示例中,图1所示的计算机系统150还可以从其它计算机系统接收信息或转移 信息到其它计算机系统。或者,从车辆100的传感系统120收集的传感器数据可以被转移到另一个计算机对此数据进行处理,下面以图3为例进行介绍。In one example, the computer system 150 shown in Figure 1 may also receive information from or transfer information to other computer systems. Alternatively, the sensor data collected from the sensor system 120 of the vehicle 100 may be transferred to another computer for processing the data, which will be described below by taking FIG. 3 as an example.
图3是本申请实施例的一种云侧指令自动驾驶车辆的应用示意图。如图3所示,来自计算机系统312的数据可以经由网络被传送到云侧的服务器320用于进一步的处理。网络以及中间节点可以包括各种配置和协议,包括因特网、万维网、内联网、虚拟专用网络、广域网、局域网、使用一个或多个公司的专有通信协议的专用网络、以太网、WiFi和HTTP、以及前述的各种组合;这种通信可以由能够传送数据到其它计算机和从其它计算机传送数据的任何设备,诸如调制解调器和无线接口。FIG. 3 is a schematic diagram of an application of a cloud-side command to an autonomous driving vehicle according to an embodiment of the present application. As shown in FIG. 3, data from computer system 312 may be transmitted via a network to server 320 on the cloud side for further processing. Networks and intermediate nodes may include various configurations and protocols, including the Internet, the World Wide Web, Intranets, Virtual Private Networks, Wide Area Networks, Local Area Networks, private networks using one or more of the company's proprietary communication protocols, Ethernet, WiFi and HTTP, and various combinations of the foregoing; such communications may be by any device capable of transferring data to and from other computers, such as modems and wireless interfaces.
在一个示例中,服务器320可以包括具有多个计算机的服务器,例如负载均衡服务器群,为了从计算机系统312接收、处理并传送数据的目的,其与网络的不同节点交换信息。该服务器可以被类似于计算机系统312配置,具有处理器330、存储器340、指令350、和数据360。In one example, server 320 may include a server having multiple computers, such as a load balancing server farm, that exchange information with different nodes of the network for the purpose of receiving, processing, and transmitting data from computer system 312 . The server may be configured similarly to computer system 312 , with processor 330 , memory 340 , instructions 350 , and data 360 .
示例性地,服务器320的数据360可以包括车辆周围道路情况的相关信息。例如,服务器320可以接收、检测、存储、更新、以及传送与车辆道路情况的相关信息。Illustratively, the data 360 of the server 320 may include information about road conditions around the vehicle. For example, server 320 may receive, detect, store, update, and transmit information related to vehicle road conditions.
例如,车辆周围道路情况的相关信息包括与车辆周围的其它车辆信息以及障碍物信息。For example, the relevant information of the road conditions around the vehicle includes other vehicle information and obstacle information around the vehicle.
现有的一些车辆通信方式要么需要点对点的复杂连线且传输能力过于局限(例如CIP),要么需要涉及复杂的通信协议(例如SOME/IP),且均无法满足冗余通信的需求。也就是说,对于冗余通信,现有技术无法很好的实现报文同步,以及无法对冗余报文进行甄别。虽然可以采用现有的通信领域的基于时间同步的通信方式来实现实时传输,但这种方式过于复杂繁琐,且对于冗余报文的甄别依然难以适应车辆通信的特殊要求。Some existing vehicle communication methods either require complex point-to-point connections with too limited transmission capability (eg CIP), or involve complex communication protocols (eg SOME/IP), and none of them can meet the requirements of redundant communication. That is to say, for redundant communication, the prior art cannot well realize packet synchronization, and cannot discriminate redundant packets. Although the existing communication method based on time synchronization in the communication field can be used to realize real-time transmission, this method is too complicated and cumbersome, and the screening of redundant messages is still difficult to meet the special requirements of vehicle communication.
针对上述技术问题,本申请实施例提供一种车辆冗余通信的方案,既能够实现车辆的冗余数据的实时传输,又易于实现。主要通过设置多网口冗余通信装置,实现报文的冗余发送和接收,以及通过为报文设置唯一标识符和/或设置报文编号,实现报文的识别,从而保证了报文的同步发送和实现报文的甄别。本申请技术方案相比于基于时间同步的通信方式,不要求接收设备和发送设备的时间同步,同时避免了不同设备的时间精度不同和时间误差等导致的报文甄别错误,也就是说,对于车载设备的精度要求没有过于严格的要求,完全不需要对齐时间,所以适用于现有的车辆中的车载设备。In view of the above technical problems, the embodiments of the present application provide a solution for vehicle redundant communication, which can realize real-time transmission of redundant data of vehicles and is easy to implement. Mainly by setting up redundant communication devices of multiple network ports to realize redundant sending and receiving of messages, and by setting unique identifiers and/or setting message numbers for messages to realize message identification, thus ensuring message integrity. Synchronous transmission and identification of packets. Compared with the communication method based on time synchronization, the technical solution of the present application does not require time synchronization between the receiving device and the sending device, and at the same time avoids packet discrimination errors caused by different time precisions and time errors of different devices. The accuracy requirements of the on-board equipment are not too strict, and the alignment time is not required at all, so it is suitable for on-board equipment in existing vehicles.
图4是本申请实施例的车辆通信装置的多数据传输通道冗余通信的示意图。如图4所示该车辆通信装置接入网络中通讯时,采用双路以太网接口收发数据,在链路上实现传输数据冗余。每一路以太网具有独立的介质访问控制(media access control,MAC)地址、端口物理层(physical layer,PHY)芯片以及独立的以太网接口(ethernet interface,ETH)。FIG. 4 is a schematic diagram of redundant communication of multiple data transmission channels of a vehicle communication device according to an embodiment of the present application. As shown in FIG. 4 , when the vehicle communication device is connected to the network for communication, the dual-channel Ethernet interface is used to send and receive data, and the data transmission redundancy is realized on the link. Each Ethernet channel has an independent media access control (MAC) address, a port physical layer (PHY) chip, and an independent Ethernet interface (ethernet interface, ETH).
该车辆通信装置与车载设备的微控制单元(microcontroller unit,MCU)连接,使得可以实现车载设备之间的通信。需要说明的是,可以是同一车辆的不同车载设备之间进行通信,也可以是不同车辆的车载设备之间进行通信。The vehicle communication device is connected with a microcontroller unit (MCU) of the vehicle-mounted device, so that the communication between the vehicle-mounted devices can be realized. It should be noted that the communication may be performed between different in-vehicle devices of the same vehicle, or the communication may be performed between in-vehicle devices of different vehicles.
可选地,车载设备可以理解为车载终端设备,在本申请实施例中主要是指具有通信功能的、可以完成一定功能的车载设备,例如,图1所示传感系统120中的各个设备、控制系统130中的各个子系统以及各个子系统中的设备、外围设备140中的各个设备、计算机系统150等等。但应理解,图1只是一种示例,车载设备还可以包括各类可以用于控制车 辆的单元、系统中的任意设备,例如,车辆接口控制单元(vehicle interface unit,VIU)、车辆识别单元(vehicle integration unit,VIU)、车辆动态控制(vehicle dynamics contral)设备、电子控制单元(electronic control unit,ECU)、电子转向控制系统(electrical power steering,EPS)、电子制动控制系统(electronically controlled brake system,EBS)、制动防抱死控制系统(antilock brake system,ABS)等等。Optionally, the in-vehicle device can be understood as an in-vehicle terminal device, and in this embodiment of the present application, it mainly refers to an in-vehicle device that has a communication function and can perform certain functions. For example, each device in the sensing system 120 shown in FIG. The various subsystems in the control system 130 and the devices in the various subsystems, the various devices in the peripheral devices 140, the computer system 150, and the like. However, it should be understood that FIG. 1 is only an example, and the in-vehicle device may also include various types of units that can be used to control the vehicle, any device in the system, for example, a vehicle interface control unit (VIU), a vehicle identification unit ( vehicle integration unit (VIU), vehicle dynamics control (vehicle dynamics control) equipment, electronic control unit (ECU), electronic power steering (EPS), electronically controlled brake system (electronically controlled brake system) , EBS), anti-lock brake control system (antilock brake system, ABS) and so on.
还需说明的是,车辆通信装置可以是独立于车载设备之外的装置,也可以是集成在车载设备内部(即是车载设备的一部分)的装置。例如车辆通信装置可以是图1所示无线通信系统141中的装置,又例如,车辆通信装置可以是集成在上述任意一种车载设备之中。It should also be noted that the vehicle communication device may be a device independent of the in-vehicle device, or may be a device integrated inside the in-vehicle device (that is, a part of the in-vehicle device). For example, the vehicle communication device may be a device in the wireless communication system 141 shown in FIG. 1 , or, for example, the vehicle communication device may be integrated into any of the above-mentioned in-vehicle devices.
如图4所示,车载设备的MCU可以依次通过车辆通信装置中的MAC0、PHY0以及网口0发送数据(报文),还可以依次通过网口0、PHY0以及MAC0接收数据(报文)。车载设备的MCU还以依次通过车辆通信装置中的MAC1、PHY1以及网口1发送数据(报文),还可以依次通过网口1、PHY1以及MAC1接收数据(报文)。As shown in Figure 4, the MCU of the in-vehicle device can send data (messages) through MAC0, PHY0 and network port 0 in the vehicle communication device in sequence, and can also receive data (messages) through network ports 0, PHY0 and MAC0 in sequence. The MCU of the in-vehicle device also sends data (messages) through MAC1, PHY1 and network port 1 in the vehicle communication device in sequence, and can also receive data (messages) through network port 1, PHY1 and MAC1 in sequence.
也就是说,图4所示的车辆通信装置包括两个数据传输通道,其中一个数据传输通道包括上述MAC0、PHY0以及网口0,另一个数据传输通道包括上述MAC1、PHY1以及网口1。That is, the vehicle communication device shown in FIG. 4 includes two data transmission channels, wherein one data transmission channel includes the above-mentioned MAC0, PHY0 and network port 0, and the other data transmission channel includes the above-mentioned MAC1, PHY1 and network port 1.
可选地,两路数据传输通道能够独立处理收发数据或合并处理收发数据。Optionally, the two data transmission channels can independently process the transceiving data or process the transceiving data in combination.
可选地,可以给每帧报文定义帧标识(identity,ID),也就是说,每帧报文都具有唯一的帧ID,然后就可以利用图4所示两个数据传输通道将带有同一帧ID的报文发送到目标设备/装置(接收报文的设备/装置)。Optionally, a frame identification (identity, ID) can be defined for each frame of message, that is, each frame of message has a unique frame ID, and then the two data transmission channels shown in FIG. A message with the same frame ID is sent to the target device/device (the device/device that received the message).
可选地,还可以对发送的报文进行计数,也就是说,对每帧报文进行编号,或者可以理解为设置报文帧的时间顺序标识。Optionally, the sent packets may also be counted, that is, the packets of each frame may be numbered, or it may be understood as setting the time sequence identifier of the packet frames.
可选地,可以定义帧序列计数(sequence counter),将帧序列计数作为报文的顺序识别码。可以在发送报文的一端进行累加,每发送一帧报文,帧序列计数器累加1。Optionally, a frame sequence count (sequence counter) can be defined, and the frame sequence count can be used as the sequence identifier of the message. It can be accumulated at one end of the sending message, and the frame sequence counter will increase by 1 every time a frame is sent.
需要说明的是,在本申请实施例中,帧序列计数用于表示发送报文的先后顺序,可以理解为是发送报文的时间次序(顺序)。例如某个报文帧序列计数为5相当于该报文是第5次发送的,假设另外一个报文的帧序列计数为7相当于该报文是第7次发送的,还可以知道该报文是在帧序列计数为5的报文发送之后发送的,可以看作是,帧序列计数为7的报文的发送时间晚于帧序列计数为5的报文。应理解,上述只是为了说明帧序列计数的含义的一种示例,不存在限定。It should be noted that, in this embodiment of the present application, the frame sequence count is used to indicate the sequence of sending packets, which can be understood as the time sequence (sequence) of sending packets. For example, a frame sequence count of 5 in a message means that the message is sent for the 5th time. If the frame sequence count of another message is 7, it means that the message is sent for the 7th time. The message is sent after the message with the frame sequence count of 5 is sent. It can be considered that the message with the frame sequence count of 7 is sent later than the message with the frame sequence count of 5. It should be understood that the above is only an example for illustrating the meaning of the frame sequence count, and there is no limitation.
可选地,在本申请实施例中,数据装载可以按照互联网协议(internet protocol,IP)首部、用户数据报协议(user datagram protocol,UDP)首部和协议数据单元(protocol data unit,PDU)的顺序进行装载。PDU数据由协议栈或应用程序装载,主要负责帧序列计数和帧ID已经传输数据的装载。Optionally, in this embodiment of the present application, data loading may be in the order of an internet protocol (internet protocol, IP) header, a user datagram protocol (user datagram protocol, UDP) header, and a protocol data unit (protocol data unit, PDU) to load. The PDU data is loaded by the protocol stack or the application program, and is mainly responsible for the frame sequence count and frame ID transmission data loading.
可选地,当PDU报文准备好后,可以将其传递给发送层,然后通过两路数据通道同时发送出去。当PDU传递至UDP和IP层发送时,由协议栈装载IP首部和UDP首部。这样在报文发送至网络中,由IP首部和帧ID组成一个唯一标识的报文。Optionally, when the PDU message is ready, it can be passed to the sending layer, and then sent out simultaneously through two data channels. When the PDU is passed to the UDP and IP layers for transmission, the IP header and the UDP header are loaded by the protocol stack. In this way, when the message is sent to the network, a uniquely identified message is composed of the IP header and the frame ID.
可选地,为了进行数据链路的隔离,可以将车辆通信装置的两个网口分配在不同的网段中。可选地,可以使得网口0与网口1的目的地址也处于不同的网段。Optionally, in order to isolate the data link, the two network ports of the vehicle communication device may be allocated in different network segments. Optionally, the destination addresses of network port 0 and network port 1 may also be in different network segments.
当报文经过交换机等网络设备投递到接收端。接收端就可以根据设定的端口对报文进 行监听接收。When the packet is delivered to the receiver through a network device such as a switch. The receiver can monitor and receive the message according to the set port.
可选地,车载通信装置可以按照固定的周期发送报文。也就是说,在同一时刻会有两个报文被发送端的车辆通信装置由两个网口同时发送至网络中。该两帧报文装载有相同的PDU内容、帧序列计数和帧ID,且UDP首部相同。但是该两帧报文的IP首部不同。由于该两帧报文是由不同的网口发出的,所以被装载了不同源IP地址和MAC地址,由于设定的目的地址也不同,所以IP首部的目的IP地址和目的MAC地址也不相同。Optionally, the in-vehicle communication device may send messages according to a fixed period. That is to say, at the same time, there will be two messages sent to the network by the vehicle communication device of the sending end through the two network ports at the same time. The two frame messages are loaded with the same PDU content, frame sequence count and frame ID, and the same UDP header. However, the IP headers of the two frames are different. Since the two frames are sent from different network ports, they are loaded with different source IP addresses and MAC addresses. Since the set destination addresses are also different, the destination IP address and destination MAC address of the IP header are also different. .
当图4所示车辆通信装置进行报文接收的时候,或者可以理解为当图4所示车辆通信装置为接收端的车辆通信装置时,可以从网口0和网口1分别接收报文,并根据接收到的报文的帧ID和帧序列计数对报文进行选择,具体对于接收报文的处理过程会在图5中进行介绍。When the vehicle communication device shown in FIG. 4 receives a message, or it can be understood that when the vehicle communication device shown in FIG. 4 is the vehicle communication device of the receiving end, the message can be received from the network port 0 and the network port 1 respectively, and the The packet is selected according to the frame ID and frame sequence count of the received packet, and the specific processing process of the received packet will be introduced in FIG. 5 .
图5是本申请实施例的接收冗余报文的处理流程示意图。下面对图5所示各个步骤进行介绍。FIG. 5 is a schematic diagram of a processing flow of receiving redundant packets according to an embodiment of the present application. The steps shown in FIG. 5 are described below.
510、接收报文。510. Receive a message.
可选地,接收的报文可以包括校验字段和唯一标识符,其中,唯一标识符可以包括帧标识ID和IP地址。Optionally, the received packet may include a check field and a unique identifier, where the unique identifier may include a frame identification ID and an IP address.
可选地,可以从多个(例如两个)数据传输通道的网口接收报文(例如接收第一报文),多个数据传输通道的接收过程是相互独立的。Optionally, packets may be received (eg, receiving the first packet) from network ports of multiple (eg, two) data transmission channels, and the receiving processes of the multiple data transmission channels are independent of each other.
需要说明的是,每个数据传输通道均可以包括其各自的MAC、PHY和网口,当为两个数据传输通道时,可以采用于图4所示相同的数据传输通道的结构。It should be noted that each data transmission channel may include its own MAC, PHY and network port. When there are two data transmission channels, the same data transmission channel structure shown in FIG. 4 may be used.
可以看出,步骤510对于接收的报文的数量不存在限定。It can be seen that, in step 510, there is no limit to the number of received packets.
可选地,唯一标识符还可以包括帧序列计数,帧序列计数用于表示接收的报文(例如第一报文)在被发送时的发发送次序。Optionally, the unique identifier may further include a frame sequence count, where the frame sequence count is used to indicate the sending and sending order of the received packets (eg, the first packet) when they are sent.
还需要说明的是,在本申请中,报文的发送次序可以理解为发送报文的先后顺序,并不是报文的实际发送时间。换而言之,在现有的通讯中是用时间戳作为报文的发送时间顺序的,这是实际发送时间的先后,而在本申请中只是报文发送次序的先后,并不对应实际时间,可以将其看作是对每个发送报文的排序。正是由于通过发送次序来区分报文的新鲜度,而不需要对应实际的时间,才使得本申请的方案不需要严格要求所有设备的时间同步。It should also be noted that, in this application, the sending order of the packets can be understood as the sequence of sending the packets, not the actual sending time of the packets. In other words, in the existing communication, the time stamp is used as the order of the sending time of the message, which is the order of the actual sending time, but in this application, it is only the order of the sending of the message, which does not correspond to the actual time. , which can be thought of as an ordering of each sent message. It is precisely because the freshness of the packets is distinguished by the sending order without corresponding to the actual time, so that the solution of the present application does not need to strictly require the time synchronization of all devices.
520、检查报文,当检查结果为“通过”时,转为执行步骤540;当检查结果为“未通过”时,执行步骤530。520. Check the message, when the check result is "pass", go to step 540; when the check result is "fail", go to step 530.
可选地,可以根据接收到的报文(例如第一报文)的校验字段,检查报文是否正确,当报文正确的时候对报文进行进一步处理,当报文存在错误的时候,可以将报文丢弃。也就是说,当报文正确的时候认为检查结果为“通过”,对报文进行进一步处理(例如转为执行步骤540);当报文错误的时候认为检查结果为“未通过”,将报文丢弃(执行步骤530)。这是因为,为了保证接收到的报文所承载的数据是正确的,往往会设置校验字段,该校验字段与承载的内容存在对应关系,因此,当接收到的报文存在错误时,根据承载的数据推算出的校验字段与发送报文时承载的校验字段就会不一致,就可以认为该报文存在错误,就可以将报文进行丢弃。Optionally, it is possible to check whether the message is correct according to the check field of the received message (for example, the first message), and further process the message when the message is correct, and when there is an error in the message, Packets can be discarded. That is to say, when the message is correct, the check result is considered to be "passed", and the message is further processed (for example, go to step 540); when the message is wrong, the check result is considered to be "failed", and the message The message is discarded (step 530 is executed). This is because, in order to ensure that the data carried by the received message is correct, a check field is often set, and the check field has a corresponding relationship with the content carried. Therefore, when there is an error in the received message, The check field calculated according to the carried data will be inconsistent with the check field carried when the message is sent, it can be considered that the message has errors, and the message can be discarded.
530、丢弃报文。530. Discard the packet.
可选地,可以将接收的报文(例如第一报文)中没有通过校验(检查)的报文进行丢 弃。Optionally, the received packets (for example, the first packet) that do not pass the verification (check) may be discarded.
需要说明的是,步骤530可以不执行,也就是说,报文的丢弃,可以考虑也可以不考虑。It should be noted that step 530 may not be executed, that is, the discarding of the packet may or may not be considered.
540、存储报文。540. Store the message.
可选地,当接收到的报文通过检查后,可以将报文进行存储。结合图4所示场景举例说明如下。Optionally, after the received message passes the inspection, the message may be stored. The following is an example of the scenario shown in FIG. 4 .
例如可以将从网口0和网口1接收的第一报文传送至应用程序的两个独立的缓存区,应用程序会给每一个帧ID在对应的网口下分别创建一个独立的缓存空间。当接受到报文后,将这些报文根据帧ID投送到对应缓存区间储存。每一个帧ID只分配一个对应大小的缓存空间,在每个缓存空间接收的报文都会被覆盖存储。即当前最新接收到的报文会覆盖上一次存在该缓存区的报文。For example, the first packet received from network port 0 and network port 1 can be sent to two independent buffer areas of the application program, and the application program will create a separate buffer space for each frame ID under the corresponding network port. . After receiving the packets, the packets are sent to the corresponding buffer area for storage according to the frame ID. Each frame ID is only allocated a buffer space of the corresponding size, and the packets received in each buffer space will be overwritten and stored. That is, the latest received message will overwrite the last message in the buffer.
550、读取报文。550. Read the message.
可选地,当需要读取报文时,可以根据从报文的缓存区(存储区),读取相应帧ID的缓存区所存储的报文。Optionally, when a message needs to be read, the message stored in the buffer area of the corresponding frame ID can be read according to the buffer area (storage area) of the slave message.
可选地,可以是在获取到读取请求的之后执行步骤550和步骤560。该读取请求可以包括待读取报文的帧ID。Optionally, steps 550 and 560 may be performed after the read request is obtained. The read request may include the frame ID of the message to be read.
可选地,在获取读取请求后,可以根据读取请求中指定的待读取报文的帧ID找到对应的缓存空间,然后从缓存空间中读取里面存储的报文。Optionally, after obtaining the read request, a corresponding buffer space can be found according to the frame ID of the to-be-read message specified in the read request, and then the message stored in the buffer space is read.
可选地,可以读取出帧ID对应的缓存空间中的至少一个存储的报文,该至少一个存储的报文中包括上述第一报文。需要说明的是,在步骤510和步骤520的执行过程中,通过检查的第一报文会被存储,所以此处存储在每个帧ID的缓存空间中的报文就包括了上述通过检查的第一报文,因此也可以理解为,每个帧ID的缓存空间中存储有至少一个第一报文。但应理解,缓存空间中也可以没有报文,这种情况相当于会读取失败,或者是返回一个没有报文的指示。Optionally, at least one stored message in the buffer space corresponding to the frame ID may be read, and the at least one stored message includes the above-mentioned first message. It should be noted that, during the execution of steps 510 and 520, the first packet that passes the inspection will be stored, so the packets stored in the buffer space of each frame ID here include the above-mentioned packets that have passed the inspection. Therefore, it can also be understood that at least one first packet is stored in the buffer space of each frame ID. However, it should be understood that there may also be no message in the buffer space, which is equivalent to a read failure, or an indication that there is no message is returned.
560、选择报文,当报文未被选中时执行步骤530,当报文被选中时执行步骤510。560. Select a message, and perform step 530 when the message is not selected, and perform step 510 when the message is selected.
可选地,可以根据存储的报文的上述帧序列计数,从这至少一个存储的报文中选择出合适的报文作为第二报文,第二报文可以理解为响应读取请求所读取出来的报文,或者可以理解为返回给读取请求的发起者的报文。Optionally, according to the above-mentioned frame sequence count of the stored message, a suitable message can be selected from the at least one stored message as the second message, and the second message can be understood as the read request in response to the read request. The extracted message, or it can be understood as the message returned to the initiator of the read request.
也就是说,当应用程序通过接口函数读取指定帧ID报文时,程序在对应的帧ID缓存区获取来自不同网口的报文。并且按照设定的仲裁逻辑进行冗余报文仲裁,仲裁获胜的报文,通过接口函数返回给用户应用层。在报文读取时会保护该缓冲区,对缓冲区进行加锁互斥处理,当读取过程中有写入请求,则将该请求挂起,当数据拷贝完成立即释放,并写入新接收的报文。That is to say, when the application program reads the specified frame ID message through the interface function, the program obtains the message from different network ports in the corresponding frame ID buffer area. And according to the set arbitration logic, redundant message arbitration is performed, and the message that wins the arbitration is returned to the user application layer through the interface function. When the message is read, the buffer will be protected, and the buffer will be locked and mutually exclusive. When there is a write request during the reading process, the request will be suspended. When the data copy is completed, it will be released immediately, and new received message.
可选地,可以根据报文的帧序列计数,选择较大帧序列计数的报文,例如可以选择缓存空间中帧序列计数的值最大的报文作为上述第二报文。Optionally, a packet with a larger frame sequence count may be selected according to the frame sequence count of the packet, for example, a packet with the largest frame sequence count value in the buffer space may be selected as the second packet.
可选地,可以设置报文的帧序列计数的值可以取从0至最大值之间的值,当计数达到最大值时继续从0开始计数,因此,当同时存在最大值和0时,认为0是较大的计数。Optionally, the value of the frame sequence count of the message can be set to take a value from 0 to the maximum value. When the count reaches the maximum value, it continues to count from 0. Therefore, when the maximum value and 0 exist at the same time, it is considered that 0 is the larger count.
需要说明的是,图5所示各个步骤并不需要完全执行,例如可以只执行步骤510至步骤540,也就是说,为每一帧报文设置独立的缓存空间,并将报文进行存储。而步骤550 和步骤560是在需要进行报文读取的时候(接收到读取请求的时候)才会执行的。或者可以理解为,步骤550和步骤560是读取报文的过程,不是接收报文的过程,而步骤510至步骤540才是接收报文的过程。还可以理解为,步骤510至步骤540是每次需要接收报文的时候执行的,而步骤550和步骤560是每次需要读取报文的时候执行的。It should be noted that each step shown in FIG. 5 does not need to be completely executed, for example, only steps 510 to 540 may be executed, that is, an independent buffer space is set for each frame of message, and the message is stored. Steps 550 and 560 are executed only when the message needs to be read (when a read request is received). Or it can be understood that step 550 and step 560 are the process of reading the message, not the process of receiving the message, and steps 510 to 540 are the process of receiving the message. It can also be understood that steps 510 to 540 are executed every time a message needs to be received, and steps 550 and 560 are executed every time a message needs to be read.
可选地,还可以将至少一个第一报文中未被选中的报文丢弃。也就是说,在读取报文的时候,丢弃没有被选中的报文,这样可以释放缓存空间,降低存储开销。Optionally, an unselected packet in the at least one first packet may also be discarded. That is to say, when reading a message, discard the unselected message, which can free up buffer space and reduce storage overhead.
可选地,为了使得接收报文和读取报文不会互相影响,可以在接收报文的过程中不响应读取请求,在读取报文的过程中暂停存储报文,可以理解为,可以使得步骤540和步骤550不同时执行。Optionally, in order to prevent the received message and the read message from affecting each other, it is possible to not respond to the read request during the process of receiving the message, and to suspend the storage of the message during the process of reading the message, which can be understood as: Steps 540 and 550 may not be performed simultaneously.
从上文可知,多个数据传输通道的收发报文是相互独立的,下面结合图6,以两个数据传输通道为例进行介绍。It can be seen from the above that the messages sent and received by multiple data transmission channels are independent of each other. In the following, with reference to FIG. 6 , two data transmission channels are used as an example for introduction.
图6是本申请实施例的接收冗余报文的处理流程示意图。下面对图6所示各个步骤进行介绍。FIG. 6 is a schematic diagram of a processing flow of receiving redundant packets according to an embodiment of the present application. Each step shown in FIG. 6 will be introduced below.
需要说明的是,图5可以看作是对于处理流程的概括性描述,而图6则相当于当有两个网口分别接收报文的时候的处理流程,从图6中可以看出两路报文的处理过程是独立的,只有在根据帧序列选择报文的时候,两路可以共享帧序列,从而从接收的报文中选择报文。还应理解,由于两路数据通道对于报文的处理过程是独立的,所以不存在先后顺序的限制。It should be noted that Figure 5 can be regarded as a general description of the processing flow, while Figure 6 is equivalent to the processing flow when two network ports receive packets respectively. It can be seen from Figure 6 that the two The processing of the message is independent. Only when the message is selected according to the frame sequence, the two channels can share the frame sequence, so as to select the message from the received message. It should also be understood that since the two data channels are independent in the processing of the packets, there is no restriction on the sequence.
511、网口0接收报文。511. The network port 0 receives the packet.
可选地,可以采用步骤510所提供的方法执行步骤511。Optionally, step 511 may be performed by using the method provided in step 510 .
512、网口1接收报文。512. The network port 1 receives the packet.
可选地,可以采用步骤510所提供的方法执行步骤512。Optionally, step 512 may be performed using the method provided in step 510 .
521、检查报文。521. Check the message.
可选地,可以采用步骤520所提供的方法执行步骤521。Optionally, step 521 may be performed by using the method provided in step 520 .
522、检查报文。522. Check the message.
可选地,可以采用步骤520所提供的方法执行步骤522。Optionally, step 522 may be performed using the method provided in step 520 .
531、丢弃报文。531. Discard the packet.
可选地,可以采用步骤530所提供的方法执行步骤531。Optionally, step 531 may be performed using the method provided in step 530 .
532、丢弃报文。532. Discard the packet.
可选地,可以采用步骤530所提供的方法执行步骤532。Optionally, step 532 may be performed using the method provided in step 530 .
541、存储报文。541. Store the message.
可选地,可以采用步骤540所提供的方法执行步骤541。Optionally, step 541 may be performed using the method provided in step 540 .
542、存储报文。542. Store the message.
可选地,可以采用步骤540所提供的方法执行步骤542。Optionally, step 542 may be performed using the method provided in step 540 .
551、读取报文。551. Read the message.
可选地,可以采用步骤550所提供的方法执行步骤551。Optionally, step 551 may be performed using the method provided in step 550 .
552、读取报文。552. Read the message.
可选地,可以采用步骤550所提供的方法执行步骤552。Optionally, step 552 may be performed using the method provided in step 550 .
561、选择报文,并将未被选中的报文丢弃。561. Select packets, and discard unselected packets.
可选地,可以采用步骤560所提供的方法执行步骤561。Optionally, step 561 may be performed by using the method provided in step 560 .
562、选择报文,并将未被选中的报文丢弃。562. Select packets, and discard unselected packets.
可选地,可以采用步骤560所提供的方法执行步骤562。Optionally, step 562 may be performed using the method provided in step 560 .
需要说明的是,两个数据传输通道在执行上述各个步骤是相互独立的,只有在选择报文时(即步骤561和步骤562)时可以共享帧序列计数。It should be noted that the two data transmission channels are independent of each other when performing the above steps, and the frame sequence count can be shared only when a packet is selected (ie, step 561 and step 562).
图7是本申请实施例的发送冗余报文的处理流程示意图。下面对图7的各个步骤进行介绍。FIG. 7 is a schematic diagram of a process flow of sending redundant packets according to an embodiment of the present application. Each step of FIG. 7 will be introduced below.
701、将第一待发送报文进行数据装载,该第一待发送报文包括帧ID。701. Perform data loading on a first message to be sent, where the first message to be sent includes a frame ID.
需要说明的是,上文所述第一报文(图5、图6所示)是指接收端的车辆通信装置所接收到的报文,而步骤701所述第一待发送报文是发送端的车辆通信装置在发送报文前生成的报文。It should be noted that the above-mentioned first message (shown in Fig. 5 and Fig. 6 ) refers to the message received by the vehicle communication device at the receiving end, and the first message to be sent in step 701 is the message of the sending end A message generated by the vehicle communication device before sending the message.
可选地,可以在第一待发送报文中装载待发送的数据,以及在其首部装载帧ID。Optionally, the data to be sent may be loaded in the first message to be sent, and the frame ID may be loaded in the header of the first message to be sent.
需要说明的是,对于具体将数据、帧ID、帧序列计数等装载在报文的哪个位置会在下文详细介绍,在此不再展开。It should be noted that the specific location where the data, frame ID, frame sequence count, etc. are loaded in the message will be described in detail below, and will not be expanded here.
702、将第一待发送报文传递给多个数据传输通道,该多个数据传输通道的IP地址互不相同。702. Deliver the first message to be sent to multiple data transmission channels, where IP addresses of the multiple data transmission channels are different from each other.
703、为第一待发送报文装载上述多个数据传输通道的IP地址,得到多个第二待发送报文。703. Load the IP addresses of the above-mentioned multiple data transmission channels into the first packet to be sent, to obtain multiple second packets to be sent.
可选地,当第一待发送报文传送到不同的数据传输通道后,可以分别把数据传输通道的IP地址装载进第一待发送报文,从而得到第二待发送报文。也就是说,第二待发送报文是在第一待发送报文的基础上装载了IP地址得到的。Optionally, after the first message to be sent is transmitted to different data transmission channels, the IP addresses of the data transmission channel may be loaded into the first message to be sent, thereby obtaining the second message to be sent. That is to say, the second message to be sent is obtained by loading the IP address on the basis of the first message to be sent.
需要说明的是,上文所述第二报文(图5、图6所示)是指接收端的车辆通信装置在读取报文时,从帧ID的缓存空间中读取到的报文,而步骤703所述第二待发送报文是发送端的车辆通信装置在发送报文前,在第一待发送报文的基础上经过进一步处理得到的报文。It should be noted that the above-mentioned second message (shown in Figure 5 and Figure 6 ) refers to the message read from the buffer space of the frame ID when the vehicle communication device at the receiving end reads the message. The second message to be sent in step 703 is a message obtained by further processing on the basis of the first message to be sent by the vehicle communication device at the sending end before sending the message.
可选地,还可以为第一待发送报文装载帧序列计数,使得第二待发送报文中包括帧序列计数。对于帧序列计数的含义、用途、设置方法等可以参照上文相关介绍,为了简洁,不再重复。还应理解,帧序列计数的装载可以在步骤701值步骤703之前、期间、之后的任意时刻,只要在执行步骤704之前执行即可,不存在其他限定。Optionally, the frame sequence count may also be loaded for the first message to be sent, so that the second message to be sent includes the frame sequence count. For the meaning, purpose, setting method, etc. of the frame sequence count, please refer to the relevant introduction above, and for the sake of brevity, it will not be repeated. It should also be understood that the loading of the frame sequence count can be performed at any time before, during, or after step 701 and step 703, as long as it is performed before step 704 is performed, and there is no other limitation.
704、在同一个发送周期内,发送多个第二待发送报文。704. In the same sending period, send multiple second messages to be sent.
可选地,在发送第二待发送报文时,可以从多个数据传输通道的每个数据传输通道的网口发送第二待发送报文。Optionally, when sending the second message to be sent, the second message to be sent may be sent from the network port of each data transmission channel of the multiple data transmission channels.
需要说明的是,在同一个发送周期内发送报文可以理解为同时发送报文。第二待发送报文中装载的数据、帧ID相同,但是IP地址不同。It should be noted that, sending a message in the same sending period can be understood as sending a message at the same time. The data and frame IDs loaded in the second message to be sent are the same, but the IP addresses are different.
图8是本申请实施例的一种报文帧的格式示意图。如图8所示,一帧报文的长度小于或等于1500字节。FIG. 8 is a schematic diagram of a format of a message frame according to an embodiment of the present application. As shown in Figure 8, the length of one frame of message is less than or equal to 1500 bytes.
可选地,报文帧可以包括:IP首部(header)、UDP首部、PDU首部、数字签名区(signature optional)首部、数据(data)区、安全数据传输协议区、密钥区。Optionally, the message frame may include: an IP header (header), a UDP header, a PDU header, a digital signature area (signature optional) header, a data (data) area, a secure data transmission protocol area, and a key area.
标准的IP首部包括20个字节,标准的UDP首部包括8个字节,如图8中所示,IP 首部和UDP首部共计28个字节。The standard IP header includes 20 bytes, and the standard UDP header includes 8 bytes. As shown in FIG. 8 , the IP header and the UDP header have a total of 28 bytes.
PDU首部包括32个字节,在本申请是实施例中,在PDU首部加入了报文序列计数、帧ID两个量,对于其他PDU的组成部分可以采用与现有的PDU首部相同的设置,例如可以在PDU中设置数据类型、数据长度、帧校验序列等,具体的内容会在图13中进行介绍,在此不再展开。The PDU header includes 32 bytes. In the embodiment of this application, two quantities of message sequence count and frame ID are added to the PDU header. For other PDU components, the same settings as the existing PDU header can be used. For example, the data type, data length, frame check sequence, etc. can be set in the PDU. The specific content will be introduced in FIG. 13 and will not be expanded here.
可选地,帧ID是PDU用户数据结构的唯一标识符,在协议栈中具有唯一性。Optionally, the frame ID is a unique identifier of the PDU user data structure, which is unique in the protocol stack.
可选地,帧ID可以与源IP一起构成PDU内唯一的标识符。Optionally, the frame ID may together with the source IP form a unique identifier within the PDU.
可选地,报文序列计数是对发送报文进行计数,将该报文序列计数从0开始计数,每发送一个PDU报文,该报文计数累加1,当计数到最大值时重新从0开始。Optionally, the message sequence count is to count the sent messages, and the message sequence count starts from 0. Every time a PDU message is sent, the message count is accumulated by 1, and when the count reaches the maximum value, it starts from 0 again. Start.
可选地,可以为每一个帧ID都设置一个独立的报文序列计数。Optionally, an independent packet sequence count can be set for each frame ID.
可选地,PDU报文首部包括校验字段,例如可以包括帧校验序列(frame check sequence,FCS)。Optionally, the header of the PDU packet includes a check field, for example, a frame check sequence (frame check sequence, FCS).
数字签名区包括首部和密钥区,其中,数字签名区的首部位于PDU首部之后,密钥区位于报文帧的结束端,首部和密钥区的字节长度均不是固定的,可以根据实际情况设置。The digital signature area includes a header and a key area. The header of the digital signature area is located after the PDU header, and the key area is located at the end of the message frame. The byte lengths of the header and the key area are not fixed. situation settings.
可选地,数字签名区可以用于传输加密的公钥。可以任意选取不同安全等级的加密算法对报文进行加密。例如RSA安全加密算法、HAL安全加密算法,以及可以自定义校验加密算法。Optionally, the digital signature area can be used to transmit encrypted public keys. Encryption algorithms of different security levels can be arbitrarily selected to encrypt packets. For example, RSA security encryption algorithm, HAL security encryption algorithm, and custom verification encryption algorithm.
数据(data)区是指用于传输数据的区域。报文长度(数据的字节长度与上述各个部分的字节长度的总和)不超过网络传输的要求,例如可以设置为报文的字节长度小于或等于1500。The data area refers to an area for transferring data. The packet length (the sum of the byte length of the data and the byte lengths of the above-mentioned parts) does not exceed the requirements of network transmission. For example, the byte length of the packet can be set to be less than or equal to 1500.
可选地,每一个报文的数据区可以根据实际使用的字节数自定义长度。报文长度装载在PDU首部的报文长度字段内。以便做接收确认。数据区根据传输数据类型需要可以自定义信号量的类型,例如按位偏移定义信号,或字节偏移定义不同的信号。Optionally, the length of the data area of each message can be customized according to the actual number of bytes used. The message length is loaded in the message length field of the PDU header. for receipt confirmation. The data area can customize the type of semaphore according to the type of transmission data, such as defining signals by bit offset, or defining different signals by byte offset.
需要说明的是,数据区可以根据传输数据的需要,选择密文传输或明文传输。It should be noted that, in the data area, ciphertext transmission or plaintext transmission can be selected according to the needs of data transmission.
安全数据传输协议(safe data transmit protocol)区用于储存安全传输的校验信息。安全传输数据区支持不同的安全数据传输协议,例如可以采用SDTV2协议。安全数据传输协议区可以包括16个字节。The safe data transmit protocol area is used to store verification information for safe transmission. The secure transmission data area supports different secure data transmission protocols, for example, the SDTV2 protocol can be used. The secure data transfer protocol area may include 16 bytes.
需要说明的是,图8只是报文帧格式的一个示例,也可以采用其他的报文帧格式,例如可以采用图9或图10所示的报文帧的格式。It should be noted that FIG. 8 is only an example of the message frame format, and other message frame formats may also be used, for example, the message frame formats shown in FIG. 9 or FIG. 10 may be used.
图9是本申请实施例的另一种报文帧的格式示意图。如图9所示,一帧报文的长度小于或等于1500字节。FIG. 9 is a schematic diagram of a format of another message frame according to an embodiment of the present application. As shown in Figure 9, the length of one frame of message is less than or equal to 1500 bytes.
可选地,图9所示报文帧可以包括:IP首部、UDP首部、PDU首部、数据区、安全数据传输协议区。图9可以看作是只对报文进行加密但不对安全传输进行校验的一种报文形式,或者可以理解为一种密文传输的方式。Optionally, the message frame shown in FIG. 9 may include: an IP header, a UDP header, a PDU header, a data area, and a secure data transmission protocol area. FIG. 9 can be regarded as a message form that only encrypts the message but does not verify the secure transmission, or can be understood as a way of cipher text transmission.
图10是本申请实施例的又一种报文帧的格式示意图。如图10所示,一帧报文的长度小于或等于1500字节。FIG. 10 is a schematic diagram of a format of another message frame according to an embodiment of the present application. As shown in Figure 10, the length of a frame is less than or equal to 1500 bytes.
可选地,图10所示报文帧可以包括:IP首部、UDP首部、PDU首部、数字签名区首部、数据区、密钥区。Optionally, the message frame shown in FIG. 10 may include: an IP header, a UDP header, a PDU header, a digital signature area header, a data area, and a key area.
需要说明的是,图9和图10只是另外两种报文格式的示例,也可以存在其他情况, 例如可以既没有安全数据传输协议,又没有数字签名认证要求。也就是说,报文还可以只包括:IP首部、UDP首部、PDU首部和数据区,数据区的数据长度可以为0-1440个字节。It should be noted that FIG. 9 and FIG. 10 are only examples of the other two message formats, and other situations may exist, for example, there may be neither a secure data transmission protocol nor a digital signature authentication requirement. That is to say, the message may also only include: an IP header, a UDP header, a PDU header and a data area, and the data length of the data area may be 0-1440 bytes.
图11是本申请实施例的车辆通信装置在同一网络的连接示意图。如图11所示,设备#1和设备#2均为车载设备,二者均包括车辆通信装置,但应理解,二者也可以是独立的车辆通信装置。二者之间通过多个交换机分两路连接。FIG. 11 is a schematic diagram of the connection of the vehicle communication device according to the embodiment of the present application in the same network. As shown in FIG. 11 , both the device #1 and the device #2 are in-vehicle devices, both of which include a vehicle communication device, but it should be understood that the two may also be independent vehicle communication devices. The two are connected in two ways through multiple switches.
可选地,设备#1和设备#2之间的第一路中包括N个交换机,N为正整数,设备#1和设备#2之间的第二路中包括M个交换机,M为正整数。为了对两路中的交换机进行区分,将第一路中的N个交换机从1至N进行编号,将第二路中的交换机从N+1到N+M进行编号。Optionally, the first path between device #1 and device #2 includes N switches, where N is a positive integer, and the second path between device #1 and device #2 includes M switches, where M is positive Integer. In order to distinguish the switches in the two channels, the N switches in the first channel are numbered from 1 to N, and the switches in the second channel are numbered from N+1 to N+M.
需要说明的是,图11所示是在同一网络中,所以上述两路是指同一网络中的两路,并不是两个网络。最直观的区别在于,图11所示的两路的交换机之间是有连接的,例如交换机#1与交换机#N+1连接,这种方式能够防止交换机故障或链路故障导致的通讯丢失。It should be noted that, as shown in FIG. 11 , it is in the same network, so the above two channels refer to two channels in the same network, not two networks. The most intuitive difference is that the two switches shown in Figure 11 are connected, for example, switch #1 is connected to switch #N+1, which can prevent communication loss caused by switch failure or link failure.
可选地,设备#1和设备#2分别具有两个网口,该两个网口的IP地址不同,且传输过程中是隔开的。Optionally, the device #1 and the device #2 respectively have two network ports, and the IP addresses of the two network ports are different and separated during transmission.
图12是本申请实施例的车辆通信装置在不同网络的连接示意图。如图12所示,设备#1、设备#2和设备#3均为车载设备,三者均包括车辆通信装置,但应理解,三者也可以是独立的车辆通信装置。设备#1、设备#2和设备#3分别接入到网络A和网络B两个网络中。FIG. 12 is a schematic diagram of the connection of the vehicle communication device according to the embodiment of the present application in different networks. As shown in FIG. 12 , device #1, device #2, and device #3 are all in-vehicle devices, and all three include a vehicle communication device, but it should be understood that the three may also be independent vehicle communication devices. Device #1, Device #2, and Device #3 are connected to two networks, Network A and Network B, respectively.
可选地,网络A中包括多个交换机,可以用交换机Ai进行编号,其中i为正整数。Optionally, network A includes multiple switches, which may be numbered by switches Ai, where i is a positive integer.
可选地,网络B中包括多个交换机,可以用交换机Bj进行编号,其中j为正整数。Optionally, network B includes multiple switches, which may be numbered by switches Bj, where j is a positive integer.
需要说明的是,图12所示是在不同网络中,所以上述网络A和网络B是不同的网络。最直观的区别在于,图12所示的网络A和网络B的交换机之间是隔离的,例如交换机A1与网络B中的任意交换机都没有连接。It should be noted that FIG. 12 shows different networks, so the above-mentioned network A and network B are different networks. The most intuitive difference is that the switches of network A and network B shown in Figure 12 are isolated, for example, switch A1 is not connected to any switch in network B.
还需要说明的是,图12只是一种示例,但是对于设备的数量、网络的数量、网络中交换机的数量等等均不存在限定。It should also be noted that FIG. 12 is only an example, but there is no limitation on the number of devices, the number of networks, the number of switches in the network, and the like.
在图12所示场景中,设备#1、设备#2和设备#3的一个网络口接入到网络A中,另一个网口接入到网络B中。设备#1、设备#2和设备#3可以同时将数据由两路网口按照本申请实施例所定义的报文格式将相同的报文发送至两个网络中。另一个设备的两个网口也接入到网络中,即可完成对报文的接收和仲裁。无论哪一网口的报文优先抵达均可以完成本周期的传输,充分利用了冗余网络中的数据链路特性,提高整个网络中数据的传输时效和可靠性。In the scenario shown in FIG. 12 , one network port of device #1, device #2, and device #3 is connected to network A, and the other network port is connected to network B. The device #1, the device #2, and the device #3 can simultaneously send data to the two networks through the two network ports according to the message format defined in the embodiment of the present application. The two network ports of another device are also connected to the network, and the packet reception and arbitration can be completed. No matter which network port packets arrive first, the transmission of the current cycle can be completed, making full use of the data link characteristics in the redundant network, and improving the transmission timeliness and reliability of data in the entire network.
下面对接收和发送报文的过程进行举例说明。The following describes the process of receiving and sending a message with an example.
首先是对网络拓扑及数据流的设置。将车载设备的两个网口的IP分别分配在不同的网段内,并且将两个网口均接入交换机网络中(包括图11所示网络和图12所示网络)。The first is to set the network topology and data flow. The IPs of the two network ports of the in-vehicle device are allocated to different network segments, and both network ports are connected to the switch network (including the network shown in Figure 11 and the network shown in Figure 12).
假设将设备#1的网口1的IP配置为10.0.0.10/21,将设备#1的网口0的IP配置为10.0.8.10/21,将设备#2的网口1的IP配置为10.0.0.20/21,将设备#2的网口0的IP配置为10.0.8.20/21。Assume that the IP of network port 1 of device #1 is configured as 10.0.0.10/21, the IP of network port 0 of device #1 is configured as 10.0.8.10/21, and the IP of network port 1 of device #2 is configured as 10.0 .0.20/21, configure the IP of network port 0 of device #2 as 10.0.8.20/21.
当车载设备发送报文时,车载设备可以在同一个通讯周期内同时从网口1和网口0发 送相同的PDU报文。该PDU报文的帧ID与帧序列计数相同。该PDU报文的UDP首部由系统装载记录源端口与目的端口及报文长度。通过实现方式的不同源端口可能不同,但是目的端口值相同。数据长度亦相同。该PDU报文从网口1和网口0发出去之前IP首部由该网口的协议栈按照该网口的IP信息进行装载,因此两个网口发送出去的PDU报文的IP首部内容不同。When the in-vehicle device sends a message, the in-vehicle device can send the same PDU message from network port 1 and network port 0 at the same time in the same communication cycle. The frame ID of this PDU is the same as the frame sequence count. The UDP header of the PDU message is loaded by the system to record the source port, destination port and message length. The source port may be different by implementation, but the destination port value is the same. The data length is also the same. Before the PDU message is sent from network port 1 and network port 0, the IP header of the network port is loaded by the protocol stack of the network port according to the IP information of the network port. Therefore, the contents of the IP header of the PDU message sent by the two network ports are different. .
当车载设备从网口1和网口0接收到报文时,网口1和网口0所在的数据传输通道可以独立对于接收的报文进行处理,例如,可以独立地检查报文,以及根据检查结果决定丢弃报文或存储报文。When the in-vehicle device receives a message from network port 1 and network port 0, the data transmission channel where network port 1 and network port 0 are located can independently process the received message. As a result of the check, it is decided to discard the packet or store the packet.
图13是本申请实施例的PDU报文格式的示意图。如图13所示,PDU报文帧包括:帧首部和数据区,其中帧首部包括32个字节,数据区可以包括小于或等于1440个字节的数据。FIG. 13 is a schematic diagram of a PDU packet format according to an embodiment of the present application. As shown in Figure 13, the PDU message frame includes: a frame header and a data area, wherein the frame header includes 32 bytes, and the data area may include data less than or equal to 1440 bytes.
帧首部包括帧序列计数(sequence counter)、帧ID、协议版本(protocol version)、数据类型(data type)、数据长度(data length)、保留字段(reserve)、保留字段01、保留字段02、保留字段03、数据区(data)、帧校验序列。The frame header includes frame sequence count (sequence counter), frame ID, protocol version (protocol version), data type (data type), data length (data length), reserved field (reserve), reserved field 01, reserved field 02, reserved Field 03, data area (data), frame check sequence.
帧序列计数是由发送端的车辆通信装置来进行计数和更新的,接收端的车辆通信设备则主要可以利用帧序列计数来读取报文。The frame sequence count is counted and updated by the vehicle communication device at the sending end, and the vehicle communication device at the receiving end can mainly use the frame sequence count to read the message.
帧序列计数从0开始累加,发送端的车辆通信装置每发送一帧报文,帧序列计数累加1,当达到最大值后归零(即当大于或等于预设阈值时归零),重新从零开始计数。The frame sequence count starts to accumulate from 0. Every time the vehicle communication device at the sending end sends a frame, the frame sequence count increases by 1. When the maximum value is reached, it returns to zero (that is, it returns to zero when it is greater than or equal to the preset threshold), and then starts from zero again. Start counting.
可选地,预设阈值(最大值)可以设置为0xFFFF FFFF。Optionally, the preset threshold (maximum value) can be set to 0xFFFF FFFF.
需要说明的是,在本申请实施例中,主要利用帧序列计数来辅助读取报文,使得可以选择更新(时间较晚)的报文,该报文选择规则非常适用于车辆通信的这一特殊应用场景,而这种方法在常见的通信(例如手机等终端之间的通信)并不适用,因为常见的通信场景涉及的数据量非常庞大,如果采用计数的方式很容易出现,帧序列已经达到最大值,却还有数据没有办法存储的情况,导致数据丢失等等问题。且本申请中需要为每个帧ID配置独立的缓存空间,这也是常见的通信场景无法满足的。正因为上述原因,在常见的通信场景中目前均采用时间同步的方式,而无法采用计数的方式。如果将基于时间同步的通信方式应用到车领域通信,则相比于本申请的方案会非常繁琐,没有本申请的方案简洁和易于实现。It should be noted that, in the embodiment of the present application, the frame sequence count is mainly used to assist in reading the message, so that the updated (late time) message can be selected. The message selection rule is very suitable for this aspect of vehicle communication. Special application scenarios, and this method is not suitable for common communication (such as communication between terminals such as mobile phones), because the amount of data involved in common communication scenarios is very large, if the counting method is used, it is easy to appear, and the frame sequence has When the maximum value is reached, there is still a situation where the data cannot be stored, resulting in data loss and other problems. Moreover, in this application, it is necessary to configure an independent buffer space for each frame ID, which is also unsatisfactory in common communication scenarios. Because of the above reasons, in common communication scenarios, the time synchronization method is currently used, and the counting method cannot be used. If the communication method based on time synchronization is applied to the communication in the vehicle field, it will be very complicated compared to the solution of the present application, which is not as concise and easy to implement as the solution of the present application.
可选地,接收端的车辆通信装置可以根据帧序列计数对报文新鲜度进行仲裁,帧序列计数值越大数据越新鲜。当接收端的车辆通信装置的两个独立网口接收到的数据帧序列计数不一致时,选取帧序列计数值较大的报文进行解析,而帧序列计数值较小的报文则可以丢弃。假设两个网口帧序列计数值相同,则可以设置为选取指定默认网口的报文进行解析。例如可以指定在数值相同的时候选择网口0的报文,或者可以指定在数值相同的时候选择网口1的报文,或者可以指定在数值相同的时候选择网口0和网口1中较早到达的网口的报文,或者可以指定在数值相同的时候选择网口0和网口1中较晚到达的网口的报文,等等,不再一一列举。Optionally, the vehicle communication device at the receiving end may arbitrate the freshness of the message according to the frame sequence count, and the larger the frame sequence count value, the fresher the data. When the data frame sequence counts received by the two independent network ports of the vehicle communication device at the receiving end are inconsistent, the packet with a larger frame sequence count value is selected for analysis, and the packet with a smaller frame sequence count value can be discarded. Assuming that the frame sequence count values of the two network ports are the same, you can set it to select the packets of the specified default network port for parsing. For example, you can specify to select the packets of network port 0 when the values are the same, or you can specify to select the packets of network port 1 when the values are the same, or you can specify that when the values are the same, you can select the network port 0 and the network port 1. The packets of the network port that arrive early, or you can specify to select the packets of the network port that arrives later among network port 0 and network port 1 when the values are the same, and so on, and will not be listed one by one.
可选地,可以设置报文的唯一标识符包括报文的帧ID和源IP。从上文可以看出,每帧报文的帧ID与帧序列计数是相同的。但是每帧报文从多个数据传输通道的网口发送出去之前,会装载MAC地址和IP地址,所以从多个网口发出去的报文的MAC地址和IP 地址是不同的,因此报文的帧ID和IP地址可以构成报文的唯一标识符。且帧序列计数也可以作为唯一标识符的组成部分。Optionally, the unique identifier of the packet can be set to include the frame ID and source IP of the packet. As can be seen from the above, the frame ID of each frame of message is the same as the frame sequence count. However, before each frame of message is sent from the network ports of multiple data transmission channels, the MAC address and IP address will be loaded, so the MAC address and IP address of the message sent from multiple network ports are different, so the message The frame ID and IP address can form the unique identifier of the packet. And the frame sequence count can also be used as part of the unique identifier.
协议版本主要用于定义PDU版本信息,以确定其兼容性。The protocol version is mainly used to define the PDU version information to determine its compatibility.
数据类型是指PDU通讯数据类型,通常定义为过程数据和消息数据。The data type refers to the PDU communication data type, which is usually defined as process data and message data.
数据长度可以理解为数据帧长度,是指实际PDU报文的数据场长度,不包含20字节的报文头。The data length can be understood as the length of the data frame, which refers to the length of the data field of the actual PDU message, excluding the 20-byte header.
帧校验序列是指用于校验PDU首部的协议序列。可选地,可以采用通用FCS进行循环冗余校验(cyclic redundancy check,CRC)校验。The frame check sequence refers to the protocol sequence used to check the PDU header. Optionally, a cyclic redundancy check (cyclic redundancy check, CRC) check may be performed using a general-purpose FCS.
数据区的数据大小可以为0~1440字节,也就是说,数据大小只要不超过PDU报文总的字节长度限制即可,且需要将报文总字节长度的限制扣除报文首部的长度。可选地,信号表映射可以由附录中子协议定义。The data size of the data area can be 0 to 1440 bytes, that is to say, the data size does not exceed the total byte length limit of the PDU message, and the limit of the total byte length of the message needs to be deducted from the header of the message. length. Optionally, the signal table mapping may be defined by the appendix neutron subprotocol.
可选地,如果使用安全数据传输协议和安全加密,则数据区可以包括上述安全传输校验区、数字签名区和密钥区。Optionally, if a secure data transmission protocol and secure encryption are used, the data area may include the above-mentioned secure transmission check area, digital signature area and key area.
图14是本申请实施例的冗余报文的发送流程示意图。下面对图14各个步骤进行介绍。FIG. 14 is a schematic diagram of a flowchart of sending a redundant packet according to an embodiment of the present application. Each step of FIG. 14 is described below.
1401、发布报文。1401. Publish a message.
可以理解为,当需要发送报文的时候,将报文发布出来。当车载设备的车辆通信装置需要发送指定的PDU报文时,PDU的数据区在应用程序中装载。以PDU 101为例,对PDU 101而言,数据来自车载设备的MCU。当将这些数据装载在数据区后,就可以将报文分别传递到不同的数据传输通道,由数据传输通道执执行后续的装载帧ID、装载帧序列计数、发送报文等操作。It can be understood that when a message needs to be sent, the message is published. When the vehicle communication device of the in-vehicle equipment needs to send the specified PDU message, the data area of the PDU is loaded in the application program. Taking the PDU 101 as an example, for the PDU 101, the data comes from the MCU of the in-vehicle equipment. After these data are loaded in the data area, the message can be transmitted to different data transmission channels respectively, and the data transmission channel performs subsequent operations such as loading frame ID, loading frame sequence count, and sending message.
可选地,当数据区装载好后,可以继续装载报文的帧首部的信息,以及可以根据当前帧首部信息,计算FCS,从而完成数据装载,之后可以把打包好的报文传送至不同网络传输通道的协议栈。在协议栈中加入各自网口的IP首部及MAC地址信息。Optionally, after the data area is loaded, the information of the frame header of the message can be loaded continuously, and the FCS can be calculated according to the current frame header information, so as to complete the data loading, and then the packaged message can be transmitted to different networks. The protocol stack of the transport channel. Add the IP header and MAC address information of the respective network ports into the protocol stack.
可选地,可以利用定时器进行出发报文的发发送,等待定时器的触发,当定时器触发后,报文从不同数据传输通道的不同网口同时发送出去,并且帧序列计数值累加1。无论发送失败与否,帧序列计数都在发送行为执行后累加,不受发送成功与否的影响。也就是说,步骤1411和步骤1421的循环计数操作是再每次发送行为执行之后进行操作的。Optionally, a timer can be used to send outgoing packets and wait for the timer to be triggered. When the timer is triggered, the packets are sent from different network ports of different data transmission channels at the same time, and the frame sequence count value is accumulated by 1. . Regardless of whether the transmission fails or not, the frame sequence count is accumulated after the execution of the transmission behavior and is not affected by the success or failure of the transmission. That is to say, the loop counting operations in steps 1411 and 1421 are performed after each sending behavior is performed.
1411、网口0循环计数。1411. The network port 0 cycle counts.
可选地,网口0可以利用计数器对发送报文的次数进行循环计数。Optionally, network port 0 may use a counter to cyclically count the number of times the packet is sent.
1421、网口1循环计数。1421. The network port 1 cycle counts.
可选地,网口0可以利用计数器对发送报文的次数进行循环计数。Optionally, network port 0 may use a counter to cyclically count the number of times the packet is sent.
需要说明的是,步骤1411-1415是网口0所在的数据传输通道执行的操作,步骤1421-1424是网口1所在的数据传输通道执行的操作,两个数据传输通道的操作是互相独立的。It should be noted that steps 1411-1415 are operations performed by the data transmission channel where network port 0 is located, and steps 1421-1424 are operations performed by the data transmission channel where network port 1 is located. The operations of the two data transmission channels are independent of each other. .
当帧序列计数的值达到最大值时(大于或等于最大值时),执行步骤1412或步骤1421,将计数器清零(即将帧序列计数的值归零),无论发送失败与否,均执行步骤1413或步骤1423,对PDU报文进行更新。When the value of the frame sequence count reaches the maximum value (greater than or equal to the maximum value), step 1412 or step 1421 is executed to clear the counter (that is, the value of the frame sequence count is reset to zero), and the steps are executed regardless of whether the transmission fails or not. Step 1413 or step 1423, update the PDU message.
帧序列计数的值由发送计数器产生,在上电期间是持续不断累加的状态。The value of the frame sequence count is generated by the transmit counter, which is continuously accumulated during power-on.
可选地,为了以避免在网络中产生发送报文的仲裁冲突,可以设置为该帧序列计数是 不支持外部软件修改的。上电时,发送计数器置0,即帧序列计数的初始值为0,之后每发送一次报文,计数器加1,帧序列计数的值累加1,直到帧序列计数的值累加到大于或等于预设阈值的时候,计数器清零,帧序列计数的值归零,重新从0开始计数。Optionally, in order to avoid arbitration conflict of sending packets in the network, it can be set that the frame sequence count does not support external software modification. When powered on, the sending counter is set to 0, that is, the initial value of the frame sequence count is 0. After each message is sent, the counter is incremented by 1, and the frame sequence count value is incremented by 1 until the frame sequence count value is accumulated to be greater than or equal to the preset value. When the threshold is set, the counter is cleared, the value of the frame sequence count is reset to zero, and the count starts from 0 again.
可选地,可以根据安全数据传输协议的算法,在本地通过SID计算出数据传输字段后,将其装载在数据区。Optionally, according to the algorithm of the secure data transmission protocol, after the data transmission field is calculated locally through the SID, it can be loaded in the data area.
数字签名区装载以上字段完成后,完成报文数据区加密,并传输至发送层。由协议栈发送区进行发送。After the above fields are loaded in the digital signature area, the encryption of the message data area is completed and transmitted to the sending layer. Sent by the protocol stack sending area.
当报文全部装在好后,执行步骤1415和步骤1422,分别从网口0和网口1将报文发送出去。如果发送失败的时间间隔或次数超过预设值可以执行步骤1403,取消发布报文。After the packets are all installed, step 1415 and step 1422 are executed to send the packets from network port 0 and network port 1 respectively. If the time interval or the number of times of sending failure exceeds the preset value, step 1403 may be executed to cancel the publishing of the message.
需要说明的时,PDU ID、帧序列计数、IP和MAC构成了这帧报文在网络中的位移标识符。在同一个发送周期内,PDU ID与帧序列计数相同的报文有两帧。在同一个发送周期内,两个PDU ID相同的报文,IP首部与MAC地址均不相同,因此两个相同的报文的标识符具有唯一性。It should be noted that the PDU ID, frame sequence count, IP and MAC constitute the displacement identifier of this frame message in the network. In the same transmission cycle, there are two frames of the message with the same PDU ID and frame sequence count. In the same sending cycle, two packets with the same PDU ID have different IP headers and MAC addresses, so the identifiers of the two identical packets are unique.
应理解,图14是发送冗余报文的流程的一个示例,具体过程可以参照图7的相关介绍,因此为了简洁,不再赘述。It should be understood that FIG. 14 is an example of the process of sending redundant packets, and the specific process can refer to the related introduction in FIG. 7 , so for brevity, details are not repeated here.
图15是本申请实施例的冗余报文的接收流程示意图。下面对图15各个步骤进行介绍。FIG. 15 is a schematic diagram of a process of receiving a redundant packet according to an embodiment of the present application. Each step of FIG. 15 is described below.
1501、PDU订阅。1501. PDU subscription.
需要说明的是,PDU订阅可以理解为接收报文的触发条件之一,也可以理解为启动接收报文流程的信息。It should be noted that PDU subscription can be understood as one of the triggering conditions for receiving a message, and can also be understood as information for starting a process of receiving a message.
1502、模式选择,当选择RT模式时执行步骤1504,当选择SDT或安全模式时,执行步骤1503。1502. Mode selection, when RT mode is selected, step 1504 is performed, and when SDT or security mode is selected, step 1503 is performed.
需要说明的是,RT模式可以理解为上文所述明文传输,也就是说,报文没有被加密,此时不需要执行解密的操作。SDT和安全模式可以理解为上文所述密文传输,也就是说,报文是被加密的,此时需要先对报文进行解密。It should be noted that the RT mode can be understood as the above-mentioned plaintext transmission, that is, the message is not encrypted, and the decryption operation is not required at this time. SDT and security mode can be understood as the ciphertext transmission described above, that is, the message is encrypted, and the message needs to be decrypted first.
1503、对报文进行解密。1503. Decrypt the packet.
需要说明的是,只有经过加密的报文才需要执行该步骤1503。It should be noted that step 1503 needs to be performed only for encrypted packets.
1504、对接收的报文进行解析。1504. Parse the received message.
可以理解为将接收到的报文中的内容读取出来,以便于利用接收到的报文的校验字段检查报文是否存在错误。It can be understood that the content of the received message is read out, so as to use the check field of the received message to check whether there is an error in the message.
1505、检查报文。1505. Check the packet.
可选地,可以利用图5中步骤520所提供的方法执行该步骤1505。Optionally, this step 1505 may be performed using the method provided in step 520 in FIG. 5 .
1506、读取和选择报文。1506. Read and select the message.
可选地,可以利用图5中步骤550和步骤560的方法执行该步骤1506。Optionally, step 1506 may be performed using the methods of steps 550 and 560 in FIG. 5 .
应理解,图15是接收冗余报文和读入报文的流程的一个示例,具体过程可以参照图5或图6的相关介绍,因此为了简洁,不再赘述。It should be understood that FIG. 15 is an example of the process of receiving redundant packets and reading in packets, and the specific process can refer to the related introduction in FIG. 5 or FIG.
上文对本申请实施例的车辆通信方法进行了介绍,下面对本申请实施例的车辆通信装置进行介绍。应理解,下文中介绍的车辆通信装置能够执行本申请实施例的车辆通信方法的各个过程,下面在介绍装置的实施例时,会适当省略重复的描述。The vehicle communication method of the embodiment of the present application is described above, and the vehicle communication device of the embodiment of the present application is described below. It should be understood that the vehicular communication device introduced hereinafter can execute each process of the vehicular communication method of the embodiments of the present application, and repeated descriptions will be appropriately omitted when introducing the embodiments of the device below.
图16是本申请实施例的一种车辆通信装置的示意图,该装置2000包括接收单元2001 和处理单元2002。该装置2000可以用于执行本申请实施例的车辆通信方法中接收端的车辆通信装置执行的各步骤。FIG. 16 is a schematic diagram of a vehicle communication device according to an embodiment of the present application. The device 2000 includes a receiving unit 2001 and a processing unit 2002 . The device 2000 can be used to execute each step performed by the vehicle communication device at the receiving end in the vehicle communication method of the embodiment of the present application.
例如,接收单元2001可以用于执行图5所示方法中的步骤510、步骤550,处理单元2002可以用于执行图5所示方法中的步骤520至步骤540、步骤560。又例如,接收单元2001可以用于执行图6所示方法中的步骤511、512和步骤551、552,处理单元2002可以用于执行图6所示方法中的步骤521、522、531、532、541、542和步骤561、562。又例如,接收单元2001可以用于执行图15所示方法中的步骤1501,处理单元2002可以用于执行图15所示方法中的步骤1502至步骤1506。For example, the receiving unit 2001 can be used to perform steps 510 and 550 in the method shown in FIG. 5 , and the processing unit 2002 can be used to perform steps 520 to 540 and 560 in the method shown in FIG. 5 . For another example, the receiving unit 2001 can be used to perform steps 511, 512 and 551, 552 in the method shown in 541, 542 and steps 561, 562. For another example, the receiving unit 2001 may be configured to perform step 1501 in the method shown in FIG. 15 , and the processing unit 2002 may be configured to perform steps 1502 to 1506 in the method shown in FIG. 15 .
上述装置2000可以为图4所示车辆通信装置。The above-mentioned apparatus 2000 may be the vehicle communication apparatus shown in FIG. 4 .
图17是本申请实施例的一种车辆通信装置的硬件结构示意图。该装置3000包括存储器3001、处理器3002、通信接口3003以及总线3004。其中,存储器3001、处理器3002、通信接口3003通过总线3004实现彼此之间的通信连接。FIG. 17 is a schematic diagram of a hardware structure of a vehicle communication device according to an embodiment of the present application. The apparatus 3000 includes a memory 3001 , a processor 3002 , a communication interface 3003 and a bus 3004 . The memory 3001 , the processor 3002 , and the communication interface 3003 are connected to each other through the bus 3004 for communication.
装置3000可以用于执行上文车辆通信方法中接收端的车辆通信装置执行的各个步骤。The apparatus 3000 may be used to execute each step performed by the vehicle communication device at the receiving end in the above vehicle communication method.
可选地,存储器3001可以是只读存储器(read only memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(random access memory,RAM)。存储器3001可以存储程序,当存储器3001中存储的程序被处理器3002执行时,处理器3002和通信接口3003用于执行本申请实施例的车辆通信方法的各个步骤。Optionally, the memory 3001 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 3001 may store a program. When the program stored in the memory 3001 is executed by the processor 3002, the processor 3002 and the communication interface 3003 are used to execute each step of the vehicle communication method of the embodiment of the present application.
可选地,存储器3001可以具有图1所示存储器152的功能或者具有图2所示系统内存235的功能,或者具有图4所示存储器340的功能,以实现上述存储程序的功能。可选地,处理器3002可以采用通用的CPU,微处理器,ASIC,图形处理器(graphic processing unit,GPU)或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的车辆通信装置中的单元所需执行的功能,或者执行本申请实施例的车辆通信方法的各个步骤。Optionally, the memory 3001 may have the function of the memory 152 shown in FIG. 1 , the function of the system memory 235 shown in FIG. 2 , or the function of the memory 340 shown in FIG. 4 to realize the above function of storing programs. Optionally, the processor 3002 may adopt a general-purpose CPU, a microprocessor, an ASIC, a graphics processing unit (graphic processing unit, GPU), or one or more integrated circuits, for executing related programs, so as to implement the functions of the embodiments of the present application. The functions required to be performed by the units in the vehicle communication device, or to perform each step of the vehicle communication method of the embodiments of the present application.
可选地,处理器3002可以具有图1所示处理器151的功能或者具有图2所示处理器203的功能,或者具有图3所示处理器330的功能,以实现上述执行相关程序的功能。Optionally, the processor 3002 may have the function of the processor 151 shown in FIG. 1 , or the function of the processor 203 shown in FIG. 2 , or the function of the processor 330 shown in FIG. 3 , so as to realize the above-mentioned function of executing related programs .
可选地,处理器3002还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请实施例的车辆通信方法的各个步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。Optionally, the processor 3002 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the vehicle communication method in the embodiment of the present application may be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
可选地,上述处理器3002还可以是通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成本申请实施例的车辆通信装置中包括的单元所需执行的功能,或者执行本申请实施例的车辆通信方法的各个步骤。Optionally, the above-mentioned processor 3002 may also be a general-purpose processor, a digital signal processor (digital signal processing, DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (field programmable gate array, FPGA) or other Programming logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory and, in combination with its hardware, completes the functions required to be performed by the units included in the vehicle communication device of the embodiment of the present application, or executes each step of the vehicle communication method of the embodiment of the present application .
可选地,通信接口3003可以使用例如但不限于收发器一类的收发装置,来实现装置 与其他设备或通信网络之间的通信。Optionally, the communication interface 3003 may use a transceiver device such as, but not limited to, a transceiver to implement communication between the device and other devices or a communication network.
总线3004可包括在装置各个部件(例如,存储器、处理器、通信接口)之间传送信息的通路。The bus 3004 may include pathways for transferring information between various components of the device (eg, memory, processor, communication interface).
图18是本申请实施例的一种车辆通信装置的示意图,该装置4000包括发送单元4001和处理单元4002。该装置4000可以用于执行本申请实施例的车辆通信方法中发送端的车辆通信装置执行的各步骤。FIG. 18 is a schematic diagram of a vehicle communication device according to an embodiment of the present application. The device 4000 includes a sending unit 4001 and a processing unit 4002 . The device 4000 can be used to execute each step performed by the vehicle communication device at the transmitting end in the vehicle communication method of the embodiment of the present application.
例如,发送单元4001可以用于执行图7所示方法中的步骤704,处理单元4002可以用于执行图7所示方法中的步骤701至步骤703。又例如,发送单元4001可以用于执行图14所示方法中的步骤1414和步骤1424,处理单元4002可以用于执行图14所示方法中的其他步骤。For example, the sending unit 4001 may be configured to execute step 704 in the method shown in FIG. 7 , and the processing unit 4002 may be configured to execute steps 701 to 703 of the method shown in FIG. 7 . For another example, the sending unit 4001 can be used to perform steps 1414 and 1424 in the method shown in FIG. 14 , and the processing unit 4002 can be used to perform other steps in the method shown in FIG. 14 .
上述装置4000可以为图4所示车辆通信装置。The above-mentioned apparatus 4000 may be the vehicle communication apparatus shown in FIG. 4 .
图19是本申请实施例的一种车辆通信装置的硬件结构示意图。该装置5000包括存储器5001、处理器5002、通信接口5003以及总线5004。其中,存储器5001、处理器5002、通信接口5003通过总线5004实现彼此之间的通信连接。FIG. 19 is a schematic diagram of a hardware structure of a vehicle communication device according to an embodiment of the present application. The apparatus 5000 includes a memory 5001 , a processor 5002 , a communication interface 5003 and a bus 5004 . The memory 5001 , the processor 5002 , and the communication interface 5003 are connected to each other through the bus 5004 for communication.
装置5000可以用于执行上文车辆通信方法中发送端的车辆通信装置执行的各个步骤。The apparatus 5000 can be used to execute each step performed by the vehicle communication apparatus at the transmitting end in the above vehicle communication method.
可选地,存储器5001可以是ROM,静态存储设备,动态存储设备或者RAM。存储器5001可以存储程序,当存储器5001中存储的程序被处理器5002执行时,处理器5002和通信接口5003用于执行本申请实施例的车辆通信方法的各个步骤。Alternatively, the memory 5001 may be a ROM, a static storage device, a dynamic storage device or a RAM. The memory 5001 may store a program. When the program stored in the memory 5001 is executed by the processor 5002, the processor 5002 and the communication interface 5003 are used to execute each step of the vehicle communication method of the embodiment of the present application.
可选地,存储器5001可以具有图1所示存储器152的功能或者具有图2所示系统内存235的功能,或者具有图4所示存储器340的功能,以实现上述存储程序的功能。可选地,处理器5002可以采用通用的CPU,微处理器,ASIC,GPU或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的车辆通信装置中的单元所需执行的功能,或者执行本申请实施例的车辆通信方法的各个步骤。Optionally, the memory 5001 may have the function of the memory 152 shown in FIG. 1 , the function of the system memory 235 shown in FIG. 2 , or the function of the memory 340 shown in FIG. 4 to realize the above function of storing programs. Optionally, the processor 5002 may adopt a general-purpose CPU, a microprocessor, an ASIC, a GPU, or one or more integrated circuits, for executing a related program, so as to realize the required execution of the unit in the vehicle communication device of the embodiment of the present application function, or execute each step of the vehicle communication method of the embodiments of the present application.
可选地,处理器5002可以具有图1所示处理器151的功能或者具有图2所示处理器203的功能,或者具有图3所示处理器330的功能,以实现上述执行相关程序的功能。Optionally, the processor 5002 may have the function of the processor 151 shown in FIG. 1 , the function of the processor 203 shown in FIG. 2 , or the function of the processor 330 shown in FIG. 3 , so as to realize the above-mentioned function of executing related programs .
可选地,处理器5002还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请实施例的车辆通信方法的各个步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。Optionally, the processor 5002 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the vehicle communication method in the embodiment of the present application may be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
可选地,上述处理器5002还可以是通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成本申请实施例的车辆通信装置中包括的单元所需执行的功能,或者执行本申请实施例的车辆通信方法的各个步骤。Optionally, the above-mentioned processor 5002 may also be a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory and, in combination with its hardware, completes the functions required to be performed by the units included in the vehicle communication device of the embodiment of the present application, or executes each step of the vehicle communication method of the embodiment of the present application .
可选地,通信接口5003可以使用例如但不限于收发器一类的收发装置,来实现装置 与其他设备或通信网络之间的通信。Optionally, the communication interface 5003 may use a transceiver device such as, but not limited to, a transceiver to implement communication between the device and other devices or a communication network.
总线5004可包括在装置各个部件(例如,存储器、处理器、通信接口)之间传送信息的通路。The bus 5004 may include pathways for communicating information between various components of the device (eg, memory, processor, communication interface).
本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得该计算机实现上述方法实施例中的方法。The embodiments of the present application further provide a computer program product including instructions, and when the instructions are executed by a computer, the instructions cause the computer to implement the methods in the foregoing method embodiments.
上述提供的任一种车辆通信装置中相关内容的解释及有益效果均可参考上文提供的对应的方法实施例,此处不再赘述。For the explanation and beneficial effects of the relevant content in any of the vehicle communication devices provided above, reference may be made to the corresponding method embodiments provided above, which will not be repeated here.
除非另有定义,本申请所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本申请中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used in this application in the specification of this application are for the purpose of describing specific embodiments only, and are not intended to limit the application.
本申请实施例并未对本申请实施例提供的方法的执行主体的具体结构进行特别限定,只要能够通过运行记录有本申请实施例提供的方法的代码的程序,以根据本申请实施例提供的方法进行通信即可。The embodiments of the present application do not specifically limit the specific structure of the execution body of the methods provided by the embodiments of the present application, as long as the program in which the codes of the methods provided by the embodiments of the present application are recorded can be executed to execute the methods according to the embodiments of the present application. Just communicate.
本申请的各个方面或特征可以实现成方法、装置或使用标准编程和/或工程技术的制品。本申请中使用的术语“制品”可以涵盖可从任何计算机可读器件、载体或介质访问的计算机程序。例如,计算机可读介质可以包括但不限于:磁存储器件(例如,硬盘、软盘或磁带等),光盘(例如,压缩盘(compact disc,CD)、数字通用盘(digital versatile disc,DVD)等),智能卡和闪存器件(例如,可擦写可编程只读存储器(erasable programmable read-only memory,EPROM)、卡、棒或钥匙驱动器等)。Various aspects or features of the present application may be implemented as methods, apparatus, or articles of manufacture using standard programming and/or engineering techniques. The term "article of manufacture" as used in this application may encompass a computer program accessible from any computer-readable device, carrier or media. For example, computer readable media may include, but are not limited to, magnetic storage devices (eg, hard disks, floppy disks, or magnetic tapes, etc.), optical disks (eg, compact discs (CDs), digital versatile discs (DVDs), etc. ), smart cards and flash memory devices (eg, erasable programmable read-only memory (EPROM), cards, stick or key drives, etc.).
本申请描述的各种存储介质可代表用于存储信息的一个或多个设备和/或其它机器可读介质。术语“机器可读介质”可以包括但不限于:无线信道和能够存储、包含和/或承载指令和/或数据的各种其它介质。The various storage media described herein may represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and/or carrying instructions and/or data.
需要说明的是,当处理器为通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件时,存储器(存储模块)可以集成在处理器中。It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, the memory (storage module) can be integrated in the processor.
还需要说明的是,本申请描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should also be noted that the memory described in this application is intended to include, but not be limited to, these and any other suitable types of memory.
本领域普通技术人员可以意识到,结合本申请中所公开的实施例描述的各示例的单元及步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的保护范围。Those of ordinary skill in the art can realize that the units and steps of each example described in conjunction with the embodiments disclosed in this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each particular application, but such implementations should not be considered outside the scope of protection of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described devices and units, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。此外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或 通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上,或者说对现有技术做出贡献的部分,或者该技术方案的部分,可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,该计算机软件产品包括若干指令,该指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。前述的存储介质可以包括但不限于:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a computer software product, and the computer software product is stored in a storage In the medium, the computer software product includes several instructions, the instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium may include, but is not limited to, various media that can store program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (32)

  1. 一种车辆通信的方法,其特征在于,包括:A method for vehicle communication, comprising:
    接收第一报文,所述第一报文包括校验字段和唯一标识符,所述唯一标识符包括帧标识ID和互联网协议IP地址;Receive a first message, the first message includes a check field and a unique identifier, and the unique identifier includes a frame identification ID and an Internet Protocol IP address;
    根据所述第一报文的校验字段,对所述第一报文进行检查;checking the first message according to the check field of the first message;
    若所述第一报文通过检查,根据所述帧ID,将所述第一报文存储到所述帧ID所对应的缓存空间。If the first packet passes the inspection, the first packet is stored in the buffer space corresponding to the frame ID according to the frame ID.
  2. 如权利要求1所述的方法,其特征在于,若所述第一报文没有通过检查,将所述第一报文丢弃。The method according to claim 1, wherein if the first packet fails the check, the first packet is discarded.
  3. 如权利要求1或2所述的方法,其特征在于,所述唯一标识符还包括帧序列计数,所述方法还包括:The method of claim 1 or 2, wherein the unique identifier further comprises a frame sequence count, the method further comprising:
    获取读取请求,所述读取请求包括待读取报文的帧ID;Obtain a read request, where the read request includes the frame ID of the message to be read;
    从所述待读取报文的帧ID所对应的缓存空间中读取至少一个第一报文,所述至少一个第一报文的帧序列计数的值用于表示所述至少一个第一报文的被发送次序;At least one first packet is read from the buffer space corresponding to the frame ID of the to-be-read packet, and the value of the frame sequence count of the at least one first packet is used to represent the at least one first packet the order in which the messages were sent;
    从所述至少一个第一报文中选中所述帧序列计数的值最大的报文为第二报文且返回所述第二报文。From the at least one first message, the message with the largest value of the frame sequence count is selected as the second message, and the second message is returned.
  4. 如权利要求3所述的方法,其特征在于,所述方法还包括:The method of claim 3, wherein the method further comprises:
    将所述至少一个第一报文中未被选中的第一报文丢弃。A first packet that is not selected among the at least one first packet is discarded.
  5. 如权利要求1至4中任意一项所述的方法,其特征在于,所述第一报文包括:IP首部、用户数据报协议UDP首部、协议数据单元PDU首部和数据区,所述唯一标识符的所述IP地址是被装载在所述IP首部中的,所述唯一标识符的其他元素是被装载在所述PDU首部中的。The method according to any one of claims 1 to 4, wherein the first message comprises: an IP header, a user datagram protocol UDP header, a protocol data unit PDU header and a data area, and the unique identifier The IP address of the identifier is carried in the IP header, and the other elements of the unique identifier are carried in the PDU header.
  6. 如权利要求5所述的方法,其特征在于,所述第一报文还包括:安全数据传输协议区。The method of claim 5, wherein the first message further comprises: a secure data transfer protocol area.
  7. 如权利要求5或6所述的方法,其特征在于,所述第一报文还包括:数字签名区首部和密钥区。The method according to claim 5 or 6, wherein the first message further comprises: a digital signature area header and a key area.
  8. 一种车辆通信的方法,其特征在于,包括:A method for vehicle communication, comprising:
    将第一待发送报文进行数据装载,所述第一待发送报文包括帧标识ID;performing data loading on the first message to be sent, where the first message to be sent includes a frame identification ID;
    将所述第一待发送报文传递给多个数据传输通道,所述多个数据传输通道的互联网协议IP地址互不相同;delivering the first message to be sent to multiple data transmission channels, where the Internet Protocol IP addresses of the multiple data transmission channels are different from each other;
    为所述第一待发送报文装载所述多个数据传输通道的IP地址,得到多个第二待发送报文;Loading the IP addresses of the plurality of data transmission channels for the first message to be sent, to obtain a plurality of second messages to be sent;
    在同一发送周期内,发送所述多个第二待发送报文。In the same sending period, the plurality of second messages to be sent are sent.
  9. 如权利要求8所述的方法,其特征在于,所述方法还包括:The method of claim 8, wherein the method further comprises:
    为所述多个第二待发送报文装载帧序列计数,所述帧序列计数用于表示所述第二待发送报文的发送次序。A frame sequence count is loaded for the plurality of second messages to be sent, where the frame sequence count is used to indicate a sending order of the second messages to be sent.
  10. 如权利要求9所述的方法,其特征在于,所述帧序列计数初始值为0,且所述帧序列计数小于或等于预设阈值,所述方法还包括:The method according to claim 9, wherein the initial value of the frame sequence count is 0, and the frame sequence count is less than or equal to a preset threshold, the method further comprises:
    每发送一次所述第二待发送报文,所述帧序列计数的值累加1,且当所述帧序列计数的值累加到大于或等于所述预设阈值时,将所述帧序列计数的值归零。Each time the second to-be-sent message is sent, the frame sequence count value is incremented by 1, and when the frame sequence count value is accumulated to be greater than or equal to the preset threshold, the frame sequence count value is incremented by 1. value to zero.
  11. 如权利要求8至10中任一项所述的方法,其特征在于,所述第一待发送报文和所述第二待发送报文均包括:IP首部、用户数据报协议UDP首部、协议数据单元PDU首部和数据区,所述帧ID被装载在所述第一待发送报文的PDU首部和所述第二待发送报文的PDU首部中,所述IP地址被装载在所述第二待发送报文的IP首部中。The method according to any one of claims 8 to 10, wherein the first message to be sent and the second message to be sent both include: an IP header, a User Datagram Protocol (UDP) header, a protocol Data unit PDU header and data area, the frame ID is loaded in the PDU header of the first message to be sent and the PDU header of the second message to be sent, and the IP address is loaded in the first message. 2. In the IP header of the message to be sent.
  12. 如权利要求11所述的方法,其特征在于,所述帧序列计数被装载在所述第二待发送报文的PDU首部中。The method of claim 11, wherein the frame sequence count is loaded in a PDU header of the second message to be sent.
  13. 如权利要求11或12所述的方法,其特征在于,所述第二待发送报文还包括:安全数据传输协议区。The method according to claim 11 or 12, wherein the second message to be sent further comprises: a secure data transmission protocol area.
  14. 如权利要求11至13中任一项所述的方法,其特征在于,所述第二待发送报文还包括:数字签名区首部和密钥区。The method according to any one of claims 11 to 13, wherein the second message to be sent further comprises: a digital signature area header and a key area.
  15. 一种车辆通信的装置,其特征在于,包括:A device for vehicle communication, comprising:
    接收单元,用于接收第一报文,所述第一报文包括校验字段和唯一标识符,所述唯一标识符包括帧标识ID和互联网协议IP地址;a receiving unit, configured to receive a first message, where the first message includes a check field and a unique identifier, and the unique identifier includes a frame identification ID and an Internet Protocol IP address;
    处理单元,用于根据所述第一报文的校验字段,对所述第一报文进行检查;a processing unit, configured to check the first message according to the check field of the first message;
    若所述第一报文通过检查,所述处理单元还用于,根据所述帧ID,将所述第一报文存储到所述帧ID所对应的缓存空间。If the first packet passes the inspection, the processing unit is further configured to, according to the frame ID, store the first packet in the buffer space corresponding to the frame ID.
  16. 如权利要求15所述的装置,其特征在于,若所述第一报文没有通过检查,所述处理单元还用于,将所述第一报文丢弃。The apparatus according to claim 15, wherein if the first packet fails the check, the processing unit is further configured to discard the first packet.
  17. 如权利要求15或16所述的装置,其特征在于,所述唯一标识符还包括帧序列计数,所述接收单元还用于,获取读取请求,所述读取请求包括待读取报文的帧ID;The apparatus according to claim 15 or 16, wherein the unique identifier further includes a frame sequence count, and the receiving unit is further configured to obtain a read request, wherein the read request includes a message to be read The frame ID of;
    所述处理单元还用于,从所述待读取报文的帧ID所对应的缓存空间中读取至少一个第一报文,所述至少一个第一报文的帧序列计数的值用于表示所述至少一个第一报文的被发送次序;The processing unit is further configured to read at least one first packet from the buffer space corresponding to the frame ID of the to-be-read packet, and the value of the frame sequence count of the at least one first packet is used for Indicates the order in which the at least one first packet is sent;
    所述处理单元还用于,从所述至少一个第一报文中选中对应的所述帧序列计数的值最大的报文为第二报文且返回所述第二报文。The processing unit is further configured to select, from the at least one first packet, a corresponding packet with the largest value of the frame sequence count as a second packet and return the second packet.
  18. 如权利要求17所述的装置,其特征在于,所述处理单元还用于,将所述至少一个第一报文中未被选中的第一报文丢弃。The apparatus of claim 17, wherein the processing unit is further configured to discard an unselected first packet in the at least one first packet.
  19. 如权利要求15至18中任意一项所述的装置,其特征在于,所述第一报文包括:IP首部、用户数据报协议UDP首部、协议数据单元PDU首部和数据区,所述唯一标识符的所述IP地址是被装载在所述IP首部中的,所述唯一标识符的其他元素是被装载在所述PDU首部中的。The device according to any one of claims 15 to 18, wherein the first message comprises: an IP header, a User Datagram Protocol UDP header, a Protocol Data Unit PDU header and a data area, and the unique identifier The IP address of the identifier is carried in the IP header, and the other elements of the unique identifier are carried in the PDU header.
  20. 如权利要求19所述的装置,其特征在于,所述第一报文还包括:安全数据传输协议区。The apparatus of claim 19, wherein the first message further comprises: a secure data transfer protocol area.
  21. 如权利要求19或20所述的装置,其特征在于,所述第一报文还包括:数字签名区首部和密钥区。The apparatus according to claim 19 or 20, wherein the first message further comprises: a digital signature area header and a key area.
  22. 一种车辆通信的装置,其特征在于,包括:A device for vehicle communication, comprising:
    处理单元,用于将第一待发送报文进行数据装载,所述第一待发送报文包括帧标识ID;a processing unit, configured to perform data loading on a first message to be sent, where the first message to be sent includes a frame identification ID;
    所述处理单元还用于,将所述第一待发送报文传递给多个数据传输通道,所述多个数据传输通道的互联网协议IP地址互不相同;The processing unit is further configured to deliver the first message to be sent to a plurality of data transmission channels, and the Internet Protocol IP addresses of the plurality of data transmission channels are different from each other;
    所述处理单元还用于,为所述第一待发送报文装载所述多个数据传输通道的IP地址,得到多个第二待发送报文;The processing unit is further configured to load the IP addresses of the plurality of data transmission channels for the first message to be sent, to obtain a plurality of second messages to be sent;
    发送单元,用于在同一发送周期内,发送所述多个第二待发送报文。A sending unit, configured to send the plurality of second messages to be sent within the same sending period.
  23. 如权利要求22所述的装置,其特征在于,所述处理单元还用于,为所述多个第二待发送报文装载帧序列计数,所述帧序列计数用于表示所述第二待发送报文的被发送次序。The apparatus according to claim 22, wherein the processing unit is further configured to load a frame sequence count for the plurality of second messages to be sent, where the frame sequence count is used to indicate the second message to be sent The order in which packets are sent.
  24. 如权利要求23所述的装置,其特征在于,所述帧序列计数初始值为0,且所述帧序列计数小于或等于预设阈值,所述处理单元还用于:The device according to claim 23, wherein the initial value of the frame sequence count is 0, and the frame sequence count is less than or equal to a preset threshold, and the processing unit is further configured to:
    每当所述发送单元发送一次所述第二待发送报文,所述处理单元将所述帧序列计数的值累加1,且当所述帧序列计数的值累加到大于或等于所述预设阈值时,所述处理单元将所述帧序列计数的值归零。Whenever the sending unit sends the second message to be sent once, the processing unit adds 1 to the value of the frame sequence count, and when the frame sequence count value is added to a value greater than or equal to the preset value When the threshold is reached, the processing unit resets the value of the frame sequence count to zero.
  25. 如权利要求22至24中任一项所述的装置,其特征在于,所述第一待发送报文和所述第二待发送报文均包括:IP首部、用户数据报协议UDP首部、协议数据单元PDU首部和数据区,所述帧ID被装载在所述第一待发送报文的PDU首部和所述第二待发送报文的PDU首部中,所述IP地址被装载在所述第二待发送报文的IP首部中。The device according to any one of claims 22 to 24, wherein the first message to be sent and the second message to be sent both include: an IP header, a User Datagram Protocol (UDP) header, a protocol Data unit PDU header and data area, the frame ID is loaded in the PDU header of the first message to be sent and the PDU header of the second message to be sent, and the IP address is loaded in the first message. 2. In the IP header of the message to be sent.
  26. 如权利要求25所述的装置,其特征在于,所述帧序列计数被装载在所述第二待发送报文的PDU首部中。26. The apparatus of claim 25, wherein the frame sequence count is carried in a PDU header of the second message to be sent.
  27. 如权利要求25或26所述的装置,其特征在于,所述第二待发送报文还包括:安全数据传输协议区。The apparatus according to claim 25 or 26, wherein the second message to be sent further comprises: a secure data transmission protocol area.
  28. 如权利要求25至27中任一项所述的装置,其特征在于,所述第二待发送报文还包括:数字签名区首部和密钥区。The apparatus according to any one of claims 25 to 27, wherein the second message to be sent further comprises: a digital signature area header and a key area.
  29. 一种车辆通信的装置,其特征在于,包括:A device for vehicle communication, comprising:
    处理器,用于执行存储器中存储的计算机指令,以使得所述装置执行:如权利要求1至7中任一项所述的方法。A processor for executing computer instructions stored in the memory to cause the apparatus to perform: the method of any one of claims 1 to 7.
  30. 一种车辆通信的装置,其特征在于,包括:A device for vehicle communication, comprising:
    处理器,用于执行存储器中存储的计算机指令,以使得所述装置执行:如权利要求8至14中任一项所述的方法。A processor for executing computer instructions stored in the memory to cause the apparatus to perform: the method of any one of claims 8 to 14.
  31. 一种计算机存储介质,其特征在于,其上存储有计算机程序,所述计算机程序被计算机执行时,以使得实现如权利要求1至7中任一项所述的方法。A computer storage medium, characterized in that a computer program is stored thereon, and when the computer program is executed by a computer, the method according to any one of claims 1 to 7 is implemented.
  32. 一种计算机存储介质,其特征在于,其上存储有计算机程序,所述计算机程序被计算机执行时,以使得实现如权利要求8至14中任一项所述的方法。A computer storage medium, characterized in that a computer program is stored thereon, and when the computer program is executed by a computer, the method according to any one of claims 8 to 14 is implemented.
PCT/CN2020/116393 2020-09-21 2020-09-21 Vehicle communication method and vehicle communication device WO2022056894A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/116393 WO2022056894A1 (en) 2020-09-21 2020-09-21 Vehicle communication method and vehicle communication device
CN202080004605.1A CN112585931A (en) 2020-09-21 2020-09-21 Vehicle communication method and communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/116393 WO2022056894A1 (en) 2020-09-21 2020-09-21 Vehicle communication method and vehicle communication device

Publications (1)

Publication Number Publication Date
WO2022056894A1 true WO2022056894A1 (en) 2022-03-24

Family

ID=75145417

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116393 WO2022056894A1 (en) 2020-09-21 2020-09-21 Vehicle communication method and vehicle communication device

Country Status (2)

Country Link
CN (1) CN112585931A (en)
WO (1) WO2022056894A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745339A (en) * 2022-04-07 2022-07-12 潍柴动力股份有限公司 Transmission method, transmission device and transmission system of multi-packet message data
CN114900515A (en) * 2022-03-25 2022-08-12 中国铁道科学研究院集团有限公司电子计算技术研究所 Train file returning method, train host, station and control center
CN114968827A (en) * 2022-08-01 2022-08-30 江铃汽车股份有限公司 Vehicle bus signal information checking method and system
CN115022418A (en) * 2022-07-12 2022-09-06 南京懂玫驱动技术有限公司 Data interaction method, device and system for electric power-assisted bicycle and storage medium
CN115208712A (en) * 2022-06-13 2022-10-18 深圳市科陆电子科技股份有限公司 Control method, cell stack management system, device and medium
CN115442173A (en) * 2022-06-07 2022-12-06 北京车和家信息技术有限公司 Vehicle message forwarding and processing method and device, electronic equipment and storage medium
CN115955356A (en) * 2023-01-03 2023-04-11 重庆长安汽车股份有限公司 Method, system, equipment and medium for inter-domain secure communication

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113840001B (en) * 2021-09-23 2023-07-11 中车株洲电力机车有限公司 Fault data processing method, communication system and rail transit vehicle under MVB network
CN114205398B (en) * 2021-12-10 2023-08-22 奇瑞汽车股份有限公司 Vehicle communication method and system
CN115037683A (en) * 2022-05-11 2022-09-09 小马易行科技(上海)有限公司 ECU information transmission method, system, computer equipment and storage medium
CN115694747A (en) * 2022-09-29 2023-02-03 成都赛力斯科技有限公司 Data redundancy protection method and device, computer equipment and storage medium
CN116155863B (en) * 2023-04-14 2023-07-04 小米汽车科技有限公司 Method and device for distributing Ethernet addresses of vehicles, medium and chip
CN116959289B (en) * 2023-09-21 2024-03-22 山东通维信息工程有限公司 Intelligent parking system and method based on vehicle-road cooperation technology

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5448564A (en) * 1994-01-31 1995-09-05 Advanced Micro Devices, Inc. Modular architecture for fast-packet network
CN107395396A (en) * 2017-06-22 2017-11-24 中国科学院西安光学精密机械研究所 The double network interfaces of redundancy based on FPGA can configure Ethernet IP kernel
CN109412968A (en) * 2018-10-08 2019-03-01 西安微电子技术研究所 A kind of redundancy communication reception management system and method for time trigger ethernet side node
CN109728985A (en) * 2017-10-30 2019-05-07 北京精密机电控制设备研究所 A kind of real-time redundant communication system based on RS422 and CAN bus isomery
CN110808816A (en) * 2019-11-05 2020-02-18 中国铁道科学研究院集团有限公司通信信号研究所 Railway train-ground redundant wireless data communication method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106911436B (en) * 2015-12-23 2019-07-23 南京南瑞继保电气有限公司 A kind of implementation method of parallel double-network redundant
CN111263333B (en) * 2018-11-30 2021-10-08 北京图森智途科技有限公司 Redundant communication method, device and system for collaborative automatic driving motorcade
CN111416690A (en) * 2019-01-07 2020-07-14 株洲中车时代电气股份有限公司 Train redundant network communication system and method based on Ethernet

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5448564A (en) * 1994-01-31 1995-09-05 Advanced Micro Devices, Inc. Modular architecture for fast-packet network
CN107395396A (en) * 2017-06-22 2017-11-24 中国科学院西安光学精密机械研究所 The double network interfaces of redundancy based on FPGA can configure Ethernet IP kernel
CN109728985A (en) * 2017-10-30 2019-05-07 北京精密机电控制设备研究所 A kind of real-time redundant communication system based on RS422 and CAN bus isomery
CN109412968A (en) * 2018-10-08 2019-03-01 西安微电子技术研究所 A kind of redundancy communication reception management system and method for time trigger ethernet side node
CN110808816A (en) * 2019-11-05 2020-02-18 中国铁道科学研究院集团有限公司通信信号研究所 Railway train-ground redundant wireless data communication method

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114900515A (en) * 2022-03-25 2022-08-12 中国铁道科学研究院集团有限公司电子计算技术研究所 Train file returning method, train host, station and control center
CN114900515B (en) * 2022-03-25 2024-04-02 中国铁道科学研究院集团有限公司电子计算技术研究所 Train file returning method, train host, station and control center
CN114745339A (en) * 2022-04-07 2022-07-12 潍柴动力股份有限公司 Transmission method, transmission device and transmission system of multi-packet message data
CN114745339B (en) * 2022-04-07 2023-10-20 潍柴动力股份有限公司 Multi-packet message data transmission method, transmission device and transmission system
CN115442173A (en) * 2022-06-07 2022-12-06 北京车和家信息技术有限公司 Vehicle message forwarding and processing method and device, electronic equipment and storage medium
CN115442173B (en) * 2022-06-07 2024-02-06 北京车和家信息技术有限公司 Vehicle message forwarding and processing method and device, electronic equipment and storage medium
CN115208712A (en) * 2022-06-13 2022-10-18 深圳市科陆电子科技股份有限公司 Control method, cell stack management system, device and medium
CN115022418A (en) * 2022-07-12 2022-09-06 南京懂玫驱动技术有限公司 Data interaction method, device and system for electric power-assisted bicycle and storage medium
CN114968827A (en) * 2022-08-01 2022-08-30 江铃汽车股份有限公司 Vehicle bus signal information checking method and system
CN114968827B (en) * 2022-08-01 2023-06-02 江铃汽车股份有限公司 Vehicle bus signal information verification method and system
CN115955356A (en) * 2023-01-03 2023-04-11 重庆长安汽车股份有限公司 Method, system, equipment and medium for inter-domain secure communication

Also Published As

Publication number Publication date
CN112585931A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
WO2022056894A1 (en) Vehicle communication method and vehicle communication device
CN109917765B (en) Distributed domain controller system based on network architecture of automatic driving system
JP7437892B2 (en) Intermediate vehicle repeater for off-range vehicles
CN209842367U (en) Distributed domain controller system based on network architecture of automatic driving system
US11398116B2 (en) Anomaly detection electronic control unit, in-vehicle network system, and anomaly detection method
WO2022041122A1 (en) Data transmission method and apparatus
CN115878343A (en) Inter-process communication method and related device
WO2022056899A1 (en) Fault diagnosis method and apparatus for vehicle speed measuring apparatus
US11456890B2 (en) Open and safe monitoring system for autonomous driving platform
US11884300B2 (en) Control system for autonomous vehicle
WO2022116000A1 (en) Communication method and apparatus
EP4383033A1 (en) Method, apparatus, and system for remotely diagnosising vehicle
EP4346187A1 (en) Ota upgrade method and device, and computer-readable storage medium
CN116631220A (en) Pre-crash alerting based on security metrics for decentralized environmental notification services
CN113934201A (en) Path planning method and device for automatic guided vehicle cluster
CN205890794U (en) On -vehicle network terminal platform of distributing type electric automobile
CN115179879A (en) Vehicle self-awakening method and device, vehicle and storage medium
CN115297461B (en) Data interaction method and device, vehicle, readable storage medium and chip
JP2022547928A (en) Waypoint information transmission method, device and system for automated driving vehicle platoon
CN112655184B (en) Safety protection method and device, intelligent automobile and storage medium
US11539621B2 (en) Controller area network messages in an autonomous vehicle
EP4075737A1 (en) Information transmission method, communication device and system, and computer-readable storage medium
CN112689982A (en) Data verification method and device
US20220076580A1 (en) Electronic device for vehicles and operation method of electronic device for vehicles
WO2022188006A1 (en) Certificate application method and apparatus

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20953752

Country of ref document: EP

Kind code of ref document: A1