WO2021143190A1 - 消息通信方法、计算机系统及代理装置 - Google Patents

消息通信方法、计算机系统及代理装置 Download PDF

Info

Publication number
WO2021143190A1
WO2021143190A1 PCT/CN2020/116862 CN2020116862W WO2021143190A1 WO 2021143190 A1 WO2021143190 A1 WO 2021143190A1 CN 2020116862 W CN2020116862 W CN 2020116862W WO 2021143190 A1 WO2021143190 A1 WO 2021143190A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
computer system
identifier
ros
autosar
Prior art date
Application number
PCT/CN2020/116862
Other languages
English (en)
French (fr)
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 华为技术有限公司
Publication of WO2021143190A1 publication Critical patent/WO2021143190A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Definitions

  • This application relates to the technical field of automatic driving or assisted automatic driving, in particular to a message communication method, a computer system and an agent device.
  • the autonomous vehicle software architecture can include an application layer and a framework layer.
  • the application layer includes applications such as perception, fusion, regulation, and execution.
  • the framework layer is used to provide basic logic and rules for the application layer, including calculation logic, communication logic, etc.
  • AUTOSAR automotive open system architecture
  • ROS robot operating system
  • the AUTOSAR system has relatively complete functions for the traditional control and execution of vehicles, it has insufficient support for the development of autonomous driving systems. This is specifically reflected in the fact that the application layer perception, fusion, regulation and execution functions are not easy to develop.
  • the ROS system was originally a data-oriented software architecture for the development of robotic systems, so it was good at computing, decision-making and other functions. However, additional development was required for the traditional control and execution of the vehicle. Therefore, how to design an automatic driving system or an auxiliary automatic driving system has become an urgent technical problem to be solved.
  • the embodiments of the present application provide a message communication method, a computer system, and an agent device, which help to enable an automatic driving system or an auxiliary automatic driving system to have the excellent characteristics of the first computer system and the second computer system at the same time, thereby improving the automatic driving system Or assist the performance of the automated driving system.
  • a message communication method is provided, which is applied to an automatic driving system or an auxiliary automatic driving system.
  • the automatic driving system or an auxiliary automatic driving system includes a first computer system, a second computer system, and an agent device.
  • the method includes: The proxy device receives the first message sent by the first computer system, and the format of the first message is a format that can be recognized by the first computer system.
  • the proxy device converts the first message into a second message.
  • the format of the second message is a format that can be recognized by the second computer system.
  • the agent device sends a second message to the second computer system.
  • adding an agent device to the automatic driving system or the auxiliary automatic driving system is used to convert the message format of the first computer system and the second computer system, so that the first computer system and the second computer system communicate messages, which is helpful
  • Enable the automatic driving system or auxiliary automatic driving system to have the excellent characteristics of the first computer system and the second computer system (for example, it can take into account the traditional control of the AUTOSAR system on the vehicle, as well as the advanced functions of ROS perception, calculation, fusion, and simulation. ).
  • the first computer system includes an AUTOSAR system
  • the second computer system includes ROS
  • the first computer system includes ROS
  • the second computer system includes an AUTOSAR system. In this way, the intercommunication between AUTOSAR system and ROS message can be realized.
  • the first message is a remote procedure call RPC mode message or a parameter mode message
  • the first message includes a first message identifier
  • the first message identifier includes a method identifier and/or a parameter identifier. symbol.
  • the method further includes: determining the second message identifier corresponding to the first message identifier according to the correspondence between the message identifier that can be recognized by the first computer system and the message identifier that can be recognized by the second computer system.
  • the second message includes a second message identifier
  • the second message identifier includes a method identifier and/or a parameter identifier.
  • the application program of the first computer system can be realized to call the application program in the second computer system, and the first computer system can obtain or set the parameters in the second computer system, thereby realizing the first computer system and the second computer system. Communication of messages in remote procedure call mode and parameter mode.
  • the subject of the message sent by the first object included in the first computer system is the same as the subject of the message received by the second object included in the proxy device.
  • the first object is the sender of the message sent in the first computer system
  • the second object is the receiver of the received message in the agent device.
  • the message sent by the first object includes the first message.
  • the subject of the message sent by the third object included in the proxy device is the same as the subject of the message received by the fourth object included in the second computer system.
  • the third object is the sender of the message sent in the proxy device.
  • the fourth object is the recipient of the message received in the second computer system.
  • the message sent by the third object includes the second message.
  • the first computer system includes an AUTOSAR system
  • the second computer system includes ROS
  • the method further includes that the proxy device filters the first message.
  • the proxy device converting the first message into the second message specifically includes: the proxy device converting the filtered first message into the second message.
  • the first computer system includes ROS
  • the second computer system includes the AUTOSAR system
  • the second message does not include the instance identifier.
  • the method further includes: the agent device adds the instance identifier to the second message , Where the instance identifier is used in the AUTOSAR system to determine the fourth object. In this way, the message sent by ROS to the AUTOSAR system can also accurately correspond to the process of the application in the AUTOSAR system.
  • the first computer system includes an AUTOSAR system
  • the second computer system includes ROS
  • the quality of service (QoS) used by the first object is compatible with the QoS used by the second object.
  • the QoS used by the third object is compatible with the QoS used by the fourth object.
  • the agent device communicates with the AUTOSAR system
  • the sender of the sending message and the recipient of the received message have the same theme and QoS compatibility.
  • the QoS of the sender needs to be compatible with the QoS of the receiver.
  • the value of the sender's QoS defines the quality of service provided by the sender; the value of the receiver's QoS defines the quality of service required by the receiver.
  • the QoS of the sender is compatible with the QoS of the receiver, which means that the quality of service provided by the sender must meet the quality of service required by the receiver.
  • a message communication method is provided, which is applied to an automatic driving system or an auxiliary automatic driving system, the automatic driving system or the auxiliary automatic driving system includes: a first computer system and a second computer system, and the method includes: a second computer
  • the system receives the first message sent by the first computer system.
  • the format of the first message is a format recognized by the first computer system.
  • the second computer system converts the first message into a second message.
  • the format of the second message is the second computer.
  • the format recognized by the system. the second computer system adds logic for converting the format of the first computer system to the format of the second computer system, so that the first computer system and the second computer system realize message communication.
  • the first computer system includes the automotive open system architecture AUTOSAR system, and the second computer system includes the robot operating system ROS; or, the first computer system includes ROS, and the second computer system includes the AUTOSAR system.
  • the intercommunication between AUTOSAR system and ROS message can be realized.
  • the first message is a remote procedure call RPC mode message or a parameter mode message
  • the first message includes a first message identifier
  • the first message identifier includes a method identifier and/or a parameter identifier. symbol.
  • the method further includes: the second computer system determines the second message identifier corresponding to the first message identifier according to the correspondence between the message identifier that can be recognized by the first computer system and the message identifier that can be recognized by the second computer system.
  • the second message includes a second message identifier.
  • the second message identifier includes a method identifier and/or a parameter identifier.
  • the application program of the first computer system can be realized to call the application program in the second computer system, and the first computer system can obtain or set the parameters in the second computer system, thereby realizing the first computer system and the second computer system. Communication of messages in remote procedure call mode and parameter mode.
  • the subject of the message sent by the first object included in the first computer system is the same as the subject of the message received by the second object included in the second computer system.
  • the subject of the message received by the first object included in the first computer system is the same as the subject of the message sent by the second object included in the second computer system.
  • the first object is the sender of the message sent in the first computer system
  • the second object is the recipient of the received message in the second computer system.
  • the message sent by the first object includes the first message; or, the message sent by the second object includes the second message.
  • the first computer system includes an AUTOSAR system
  • the second computer system includes ROS
  • the method further includes: the second computer system filters the first message.
  • the second computer system converting the first message into the second message includes: the second computer system converting the filtered first message into the second message.
  • the first computer system includes ROS
  • the second computer system includes an AUTOSAR system
  • the first message does not include an instance identifier.
  • the method further includes: the second computer system adds the instance identifier to the first Two messages, where the instance identifier is used by the AUTOSAR system to determine the second object.
  • the message sent by ROS to the AUTOSAR system can also accurately correspond to the process of the application in the AUTOSAR system.
  • the first computer system includes an AUTOSAR system
  • the second computer system includes ROS
  • the QoS used by the first object is compatible with the QoS used by the second object.
  • an agent device which can be used to execute any method provided in any possible implementation manner of the first aspect to the first aspect.
  • the proxy device may be a computer device (such as a terminal device, a server, or a cloud server) or a chip.
  • the device may be divided into functional modules according to any of the methods provided in the first aspect.
  • each functional unit can be divided corresponding to each function, or two or more functions can be integrated into one processing unit.
  • the apparatus may include a processor, and the processor is configured to execute any one of the foregoing provided by the first aspect.
  • the processor is configured to execute any one of the foregoing provided by the first aspect.
  • a computer-readable storage medium such as a non-transitory computer-readable storage medium.
  • a computer program (or instruction) is stored thereon, and when the computer program (or instruction) runs on a computer, the computer is caused to execute any of the above-mentioned first aspect or any one of the possible implementations of the first aspect. method.
  • a computer program product which when running on a computer, enables any method provided in the first aspect or any one of the possible implementations of the first aspect to be executed.
  • a chip including a processor, configured to call and run a computer program stored in the memory from a memory, and execute any of the first aspect or any one of the possible implementation manners of the first aspect. a way.
  • a computer system in a seventh aspect, can be used to execute any method provided in the foregoing second aspect or any possible implementation manner of the second aspect.
  • the computer system may be divided into functional modules according to any of the methods provided in the second aspect. For example, each functional unit can be divided corresponding to each function, or two or more functions can be integrated into one processing unit.
  • the computer system may include a processor, and the processor is configured to execute any of the above-mentioned second aspect. a way.
  • a computer-readable storage medium such as a non-transitory computer-readable storage medium.
  • a computer program (or instruction) is stored thereon, and when the computer program (or instruction) runs on a computer, the computer is caused to execute any of the above-mentioned second aspect or any of the possible implementations of the second aspect. method.
  • a computer program product which when running on a computer, enables any method provided by the second aspect or any possible implementation of the second aspect to be executed.
  • a chip including: a processor, configured to call and run a computer program stored in the memory from a memory, and execute any of the second aspect or any one of the possible implementation manners of the second aspect. a way.
  • any of the agent devices, computer systems, computer storage media, computer program products, or chips provided above can be applied to the corresponding methods provided above, and therefore, the beneficial effects that can be achieved can be Refer to the beneficial effects in the corresponding method, which will not be repeated here.
  • FIG. 1 is a schematic diagram of an autonomous vehicle software architecture structure applicable to an embodiment of the present application
  • FIG. 2 is a functional block diagram of a vehicle 100 applicable to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a computer system applicable to an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an AUTOSAR system-based automatic driving or auxiliary automatic driving system that can be applied to an embodiment of the present application;
  • Figure 5 is a diagram of the relationship between domain participants, publishers, subscribers, data writers, and data readers applicable to embodiments of the present application;
  • Fig. 6 is a DDS publish-subscribe model applicable to the embodiments of the present application.
  • FIG. 7 is a schematic diagram of the relationship between domains, domain participants, and applications applicable to the embodiments of the present application.
  • FIG. 8 is a schematic structural diagram of a ROS-based automatic driving or assisted automatic driving system that can be applied to an embodiment of the present application;
  • Fig. 9 is a publish-subscribe model of ros_comm applicable to the embodiment of the present application.
  • FIG. 10 is a schematic diagram of the intercommunication between the AUTOSAR system and ROS provided by an embodiment of the application.
  • FIG. 11 is a schematic diagram of the system architecture of a solution for interworking between AUTOSAR system and ROS based on proxy mode provided by an embodiment of the application;
  • FIG. 12 is a schematic diagram of the system architecture of a solution for interworking between the AUTOSAR system and ROS based on the pass-through mode provided by an embodiment of the application;
  • FIG. 13 is a schematic flowchart of an AUTOSAR system and an agent device service discovery method provided by an embodiment of this application;
  • FIG. 14 is a schematic flowchart of a proxy device and a ROS service discovery method provided by an embodiment of the application;
  • 15 is a schematic flowchart of a method for the AUTOSAR system to send messages to the ROS through the proxy device in the method for implementing the message communication between the AUTOSAR system and the ROS based on the proxy mode according to an embodiment of the application;
  • 16 is a schematic flow diagram of a method for ROS to send messages to the AUTOSAR system through a proxy device in a method for implementing message communication between the AUTOSAR system and the ROS based on the proxy mode according to an embodiment of the application;
  • FIG. 17 is a schematic flowchart of a method for realizing the message communication between the AUTOSAR system and the ROS based on the direct mode according to an embodiment of the application;
  • FIG. 18 is a schematic flowchart of another method for realizing the message communication between the AUTOSAR system and the ROS based on the direct mode according to an embodiment of the application;
  • FIG. 19 is a schematic structural diagram of an agent device provided by an embodiment of this application.
  • FIG. 20 is a schematic structural diagram of a computer system provided by an embodiment of this application.
  • FIG. 2 is a functional block diagram of a vehicle 100 applicable to the embodiment of the present application.
  • the vehicle 100 is configured in a fully or partially autonomous driving mode.
  • the vehicle 100 can control itself while in the automatic driving mode, and can determine the current state of the vehicle and its surrounding environment through human operations, determine the possible behavior of at least one other vehicle in the surrounding environment, and determine the other vehicle The confidence level corresponding to the possibility of performing the possible behavior is controlled based on the determined information.
  • the vehicle 100 can be placed to operate without human interaction.
  • the vehicle 100 may include various subsystems, such as a travel system 102, a sensing system 104, a control system 106, one or more peripheral devices 108 and a power supply 110, a computer system 112, and a user interface 116.
  • the vehicle 100 may include more or fewer subsystems, and each subsystem may include multiple elements.
  • each of the subsystems and elements of the vehicle 100 may be wired or wirelessly interconnected.
  • the travel system 102 may include components that provide power movement for the vehicle 100.
  • the traveling system 102 may include an engine 118, an energy source 119, a transmission 120, and wheels 121.
  • the engine 118 may be an internal combustion engine, an electric motor, an air compression engine, or a combination of other types of engines, such as a hybrid engine composed of a gas oil engine and an electric motor, or a hybrid engine composed of an internal combustion engine and an air compression engine.
  • the engine 118 converts the energy source 119 into mechanical energy.
  • Examples of energy sources 119 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 119 may also provide energy for other systems of the vehicle 100.
  • the transmission device 120 can transmit mechanical power from the engine 118 to the wheels 121.
  • the transmission device 120 may include a gearbox, a differential, and a drive shaft.
  • the transmission device 120 may also include other devices, such as a clutch.
  • the drive shaft may include one or more shafts that can be coupled to one or more wheels 121.
  • the sensing system 104 may include several sensors that sense information about the environment around the vehicle 100.
  • the sensing system 104 may include a positioning system 122 (the positioning system may be a GPS system, a Beidou system or other positioning systems), an inertial measurement unit (IMU) 124, a radar 126, and a laser rangefinder 128 And the camera 130.
  • the sensing system 104 may also include sensors of the internal system of the monitored vehicle 100 (for example, 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, direction, speed, etc.). Such detection and identification are key functions for the safe operation of the vehicle 100.
  • the positioning system 122 can be used to estimate the geographic location of the vehicle 100.
  • the inertial measurement unit 124 is used to sense changes in the position and orientation of the vehicle 100 based on inertial acceleration.
  • the inertial measurement unit 124 may be a combination of an accelerometer and a gyroscope.
  • the radar 126 may use radio signals to sense objects in the surrounding environment of the vehicle 100. In some embodiments, in addition to sensing the object, the radar 126 may also be used to sense the speed and/or direction of the object.
  • the laser rangefinder 128 can use laser light to sense objects in the environment where the vehicle 100 is located.
  • the laser rangefinder 128 may include one or more laser sources, laser scanners, and one or more detectors, as well as other system components.
  • the camera 130 may be used to capture multiple images of the surrounding environment of the vehicle 100.
  • the camera 130 may be a still camera or a video camera.
  • the control system 106 controls the operation of the vehicle 100 and its components.
  • the control system 106 may include various components, including a steering system 132, a throttle 134, a braking unit 136, a computer vision system 140, a route control system 142, and an obstacle avoidance system 144.
  • the steering system 132 is operable to adjust the forward direction of the vehicle 100.
  • it may be a steering wheel system.
  • the throttle 134 is used to control the operating speed of the engine 118 and thereby control the speed of the vehicle 100.
  • the braking unit 136 is used to control the vehicle 100 to decelerate.
  • the braking unit 136 may use friction to slow down the wheels 121.
  • the braking unit 136 may convert the kinetic energy of the wheels 121 into electric current.
  • the braking unit 136 may also take other forms to slow down the rotation speed of the wheels 121 to control the speed of the vehicle 100.
  • the computer vision system 140 may be operable to process and analyze the images captured by the camera 130 in order to identify objects and/or features in the surrounding environment of the vehicle 100.
  • the objects and/or features may include traffic signals, road boundaries and obstacles.
  • the computer vision system 140 may use object recognition algorithms, Structure from Motion (SFM) algorithms, video tracking, and other computer vision technologies.
  • SFM Structure from Motion
  • the computer vision system 140 may be used to map the environment, track objects, estimate the speed of objects, and so on.
  • the route control system 142 is used to determine the travel route of the vehicle 100.
  • the route control system 142 may combine data from the radar 126, the positioning system 122, and one or more predetermined maps to determine a travel route for the vehicle 100.
  • the obstacle avoidance system 144 is used to identify, evaluate and avoid or otherwise surpass potential obstacles in the environment of the vehicle 100.
  • control system 106 may add or alternatively include components other than those shown and described. Alternatively, a part of the components shown above may be reduced.
  • the vehicle 100 interacts with external sensors, other vehicles, other computer systems, or users through peripheral devices 108.
  • the peripheral device 108 may include a wireless communication system 146, an onboard computer 148, a microphone 150, and/or a speaker 152.
  • the peripheral device 108 provides a means for the user of the vehicle 100 to interact with the user interface 116.
  • the onboard computer 148 may provide information to the user of the vehicle 100.
  • the user interface 116 can also operate the on-board computer 148 to receive user input.
  • the on-board computer 148 can be operated through a touch screen.
  • the peripheral device 108 may provide a means for the vehicle 100 to communicate with other devices located in the vehicle.
  • the microphone 150 may receive audio (eg, voice commands or other audio input) from a user of the vehicle 100.
  • the speaker 152 may output audio to the user of the vehicle 100.
  • the wireless communication system 146 may wirelessly communicate with one or more devices directly or via a communication network.
  • the wireless communication system 146 may use 3G cellular communication, such as CDMA, EVDO, GSM/GPRS, or 4G cellular communication, such as LTE. Or 5G cellular communication.
  • the wireless communication system 146 may use WiFi to communicate with a wireless local area network (WLAN).
  • WLAN wireless local area network
  • the wireless communication system 146 may directly communicate with the device using an infrared link, Bluetooth, or ZigBee.
  • Other wireless protocols such as various vehicle communication systems.
  • the wireless communication system 146 may include one or more dedicated short-range communications (DSRC) devices, which may include vehicles and/or roadside stations. Public and/or private data communications.
  • DSRC dedicated short-range communications
  • the power supply 110 may provide power to various components of the vehicle 100.
  • the power source 110 may be a rechargeable lithium ion or lead-acid battery.
  • One or more battery packs of such batteries may be configured as a power source to provide power to various components of the vehicle 100.
  • the power source 110 and the energy source 119 may be implemented together, such as in some all-electric vehicles.
  • the computer system 112 may include at least one processor 113 that executes instructions 115 stored in a non-transitory computer readable medium such as the memory 114.
  • the computer system 112 may also be multiple computing devices that control individual components or subsystems of the vehicle 100 in a distributed manner.
  • the processor 113 may be any conventional processor, such as a commercially available CPU. Alternatively, the processor may be a dedicated device such as an ASIC or other hardware-based processor.
  • FIG. 2 functionally illustrates the processor, the memory, and other elements of the computer in the same block, those of ordinary skill in the art should understand that the processor, computer, or memory may or may not actually include Multiple processors, computers, or memories in the same physical enclosure.
  • the memory may be a hard disk drive or other storage medium located in a housing other than the computer. Therefore, a reference to a processor or computer will be understood to include a 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 here, some components such as steering components and deceleration components may each have its own processor that only performs calculations related to component-specific functions .
  • the processor may be located away from the vehicle and wirelessly communicate with the vehicle.
  • some of the processes described herein are executed on a processor disposed in the vehicle and others are executed by a remote processor, including taking the necessary steps to perform a single manipulation.
  • the memory 114 may contain instructions 115 (eg, program logic), which may be executed by the processor 113 to perform various functions of the vehicle 100, including those functions described above.
  • the memory 114 may also contain additional instructions, including one or more of the traveling system 102, the sensing system 104, the control system 106, and the peripheral device 108 to send data, receive data therefrom, interact with it, and/or control it. instruction.
  • the memory 114 may also store data, such as road maps, route information, the location, direction, and speed of the vehicle, and other such vehicle data, as well as other information. Such information may be used by the vehicle 100 and the computer system 112 during the operation of the vehicle 100 in autonomous, semi-autonomous, and/or manual modes.
  • the user interface 116 is used to provide information to or receive information from a user of the vehicle 100.
  • the user interface 116 may include one or more input/output devices in the set of peripheral devices 108, such as a wireless communication system 146, a car computer 148, a microphone 150, and a speaker 152.
  • the computer system 112 may control the functions of the vehicle 100 based on inputs received from various subsystems (for example, the travel system 102, the sensing system 104, and the control system 106) and from the user interface 116. For example, the computer system 112 may utilize input from the control system 106 in order to control the steering system 132 to avoid obstacles detected by the sensing system 104 and the obstacle avoidance system 144. In some embodiments, the computer system 112 is operable to provide control of many aspects of the vehicle 100 and its subsystems.
  • one or more of these components described above may be installed or associated with the vehicle 100 separately.
  • the storage 114 may exist partially or completely separately from the vehicle 100.
  • the above-mentioned components may be communicatively coupled together in a wired and/or wireless manner.
  • FIG. 2 should not be construed as a limitation to the embodiment of the present application.
  • the above-mentioned vehicle 100 may be a car, truck, motorcycle, bus, boat, airplane, helicopter, lawn mower, recreational vehicle, playground vehicle, construction equipment, tram, golf cart, train, and trolley, etc.
  • the application examples are not particularly limited.
  • the computer system 101 includes a processor 103, which is coupled to a system bus 105.
  • the processor 103 may be one or more processors, where each processor may include one or more processor cores.
  • a display adapter (video adapter) 107, the display adapter 107 can drive the display 109, and the display 109 is coupled to the system bus 105.
  • the system bus 105 is coupled with an input/output (I/O) bus 175 through a bus bridge 111.
  • the I/O interface 157 and the I/O bus 175 are coupled.
  • the I/O interface 157 communicates with a variety of I/O devices, such as input device 117 (such as keyboard, mouse, touch screen, etc.), media tray 121 (such as CD-ROM, multimedia interface, etc.), sending and receiving 123 (can send and/or receive radio communication signals), camera 155 (can capture scene and dynamic digital video images), sensor 153 and USB port 125.
  • input device 117 such as keyboard, mouse, touch screen, etc.
  • media tray 121 such as CD-ROM, multimedia interface, etc.
  • sending and receiving 123 can send and/or receive radio communication signals
  • camera 155 can capture scene and dynamic digital video images
  • sensor 153 can capture scene and dynamic digital video images
  • USB port 125 can capture scene and dynamic digital video images
  • the interface connected to the I/O interface 157 may be a USB interface.
  • the processor 103 may be any conventional processor, including a reduced instruction set computing ("RISC”) processor, a complex instruction set computing (“CISC”) processor, or a combination of the foregoing.
  • the processor may be a dedicated device such as an application specific integrated circuit (“ASIC").
  • the processor 103 may be a neural network processor or a combination of a neural network processor and the foregoing traditional processors.
  • the computer system 101 may be located far away from the autonomous driving vehicle, and may perform wireless communication with the autonomous driving vehicle.
  • some of the processes described herein are executed on a processor provided in an autonomous vehicle, and others are executed by a remote processor, including taking actions required to perform a single manipulation.
  • the computer system 101 can communicate with the software deployment server 149 through the network interface 129.
  • the network interface 129 is a hardware network interface, such as a network card.
  • the network 127 may be an external network, such as the Internet, or an internal network, such as an Ethernet or a virtual private network (VPN).
  • the network 127 may also be a wireless network, such as a WiFi network, a cellular network, and so on.
  • the hard disk drive interface 131 and the system bus 105 are coupled.
  • the hard disk drive interface 131 and the hard disk drive 133 are connected.
  • the system memory 135 is coupled to the system bus 105.
  • the data running in the system memory 135 may include the operating system 137 and application programs 143 of the computer system 101.
  • the operating system 137 includes a Shell 139 and a kernel (kernel) 141.
  • Shell 139 is an interface between the user and the operating system 137.
  • Shell139 is the outermost layer of operating system 137.
  • Shell139 manages the interaction between the user and the operating system 137: waiting for the user's input, interpreting the user's input to the operating system 137, and processing various output results of the operating system 137.
  • the kernel 141 is composed of those parts of the operating system 137 that are used to manage memory, files, peripherals, and system resources. Directly interacting with the hardware, the kernel 141 usually runs processes and provides inter-process communication, providing CPU time slice management, interrupts, memory management, IO management, and so on.
  • Application programs 143 include programs 147 related to autonomous driving, such as programs that manage the interaction between autonomous vehicles and road obstacles, programs that control the route or speed of autonomous vehicles, and programs that control interaction between autonomous vehicles and other autonomous vehicles on the road.
  • the application program 143 also exists on the system of the software deployment server 149. In one embodiment, when the application program 143 needs to be executed, the computer system 101 may download the application program 143 from the software deployment server 149.
  • the sensor 153 can be associated with the computer system 101 through the I/O interface 157.
  • the sensor 153 is used to detect the environment around the computer system 101.
  • the sensor 153 can detect animals, cars, obstacles, and crosswalks. Further, the sensor can also detect the environment around objects such as animals, cars, obstacles, and crosswalks. Other animals, weather conditions, the brightness of the surrounding environment, etc.
  • the sensor may be a camera, an infrared sensor, a chemical detector, a microphone, etc.
  • the computer system 112 in FIG. 2 may be the computer system 101 in FIG. 3.
  • the processor 113 in FIG. 2 may be the processor 103 in FIG. 3, and the memory 114 in FIG. 2 may be the system memory 135 or the media disk 121 in FIG. 3.
  • the software architecture of the operating system 137 in FIG. 3 may be the autonomous vehicle software architecture shown in FIG. 1.
  • AUTOSAR system is an open and standardized software architecture system developed by the automotive industry.
  • the bottom layer of the software architecture system can realize data transmission through data distribution service (DDS), which is of course not limited to this.
  • the AUTOSAR system 20 (which is an AUTOSAR-based automatic driving or auxiliary automatic driving system) as shown in FIG. 4 may include an application module 201 and a communication module 202.
  • the application module 201 may correspond to the application layer 101a in FIG. 1, and includes an application program.
  • the communication module 202 may correspond to the framework layer 102a in FIG. 1, and is mainly used to transmit data between different applications in the application module 201.
  • the communication module 202 may include a communication mode layer 301, a binding layer (DDS binding layer) 302, and a DDS303.
  • the communication mode layer 301 may provide the following message communication modes: event mode, method mode, and field mode. Different message communication modes have different message formats.
  • the event mode is a message communication mode in which messages are sent directly. In this mode, application 1 sends a message to application 2, and application 2 receives the message.
  • the method mode is the message communication mode of remote procedure call (RPC). In this mode, application 1 sends a service request message to application 2; application 2 replies to application 1 with a response message according to the message.
  • the parameter mode is a message communication mode that requests to obtain the value of a parameter or request to change the value of a parameter. In this mode, application 1 that needs to obtain a parameter or change the value of a parameter sends a message to application 2.
  • Application 2 sends the value of the requested parameter to Application 1 according to the message; or changes the value of the parameter according to the message, and sends the changed parameter value to Application 1.
  • the message communication mode is visible to the user, and their specific implementation uses DDS303.
  • the communication mode layer 301 calls the interface of the DDS303 through the combination layer 302.
  • DDS303 is a distributed, highly reliable, high real-time message communication middleware. DDS303 emphasizes data-centricity, and a topic is an identifier that uniquely identifies a certain kind of data. The message of a specific topic has a certain data type, and the data type is defined by the basic types of char, byte, int, etc. Exemplarily, the subject may be "TEXT", and the data type of the message of the subject is char. DDS303 provides a message interface to define the message format and data type of messages sent and received. The message interface provided by DDS303 includes a write interface and a read interface.
  • the communication mode of DDS303 is a publish-subscribe model.
  • the publish-subscribe model divides the system into logically independent domains. Each domain contains several entities. These entities complete data publishing, subscription and other interactions. Task. Entities include: domain participant (domain participant), publisher (publisher), subscriber (subscriber), topic, data writer (data writer) and data reader (data reader). These entities have several QoS corresponding to them.
  • a domain is a concept of scope, which is uniquely identified by a domain ID. Generally, entities in the same domain can communicate, and there is generally no logical relationship between entities in different domains.
  • DDS303 As the entrance of DDS303, domain participants are used to create topics and register data types. Manage entities such as publishers and subscribers.
  • the publisher is responsible for managing (such as creating, deleting) data writers.
  • the issuer can declare the data type and subject of its production when registering and claiming to be the issuer of the data in the DDS, and describe the registration statement information such as QoS provided.
  • Subscribers are responsible for managing (such as creating, deleting) data readers. Subscribers can declare the required data type, subject, QoS and other registration declaration information when registering as a data subscriber in the DDS.
  • the data writer is responsible for using write functions (such as write()) to generate data.
  • the data reader is responsible for reading the data.
  • DDS303 includes a type of data readers and data writers for service discovery, such as the first data writer and the first data reader in the first embodiment below; or, the AUTOSAR system Publisher data reader (pb-datareader), subscriber data writer (sb-datawriter) in the proxy device; or, subscriber data reader (sb-datareader), AUTOSAR system in the proxy device Publisher Data Writer in (pb-datawriter)).
  • the DDS303 also includes a type of data readers and data writers for data transmission between applications (the second data reader and the second data writer in the first embodiment below).
  • one domain participant 401 can create multiple publishers 402 and/or subscribers 403, and one publisher 402 can create multiple data writers 404 (as shown in Figure 5, data writer 404-1 And data writer 404-2), one subscriber 403 can create multiple data readers 405 (such as data reader 405-1 and data reader 405-2 in FIG. 5). If a data writer or data reader is created by a publisher or subscriber, the data writer or data reader is associated with the domain participant who created the publisher or subscriber.
  • Each data writer and data reader can be bound to a topic.
  • the subject of data writers and data readers who communicate with each other is the same.
  • the message communication mode is an event mode
  • the subject includes the identifier of the event.
  • the message communication mode is the method mode
  • the subject includes the method identifier.
  • the message communication mode is the parameter mode
  • the subject includes the parameter identifier.
  • QoS is a set of configurable parameters. Using QoS can guarantee the quality of service of DDS303 message communication.
  • the QoS of the data writer needs to be compatible with the QoS of the data reader.
  • the QoS value of the data writer defines the quality of service provided by the data writer; the QoS value of the data reader defines the quality of service required by the data reader.
  • the QoS of the data writer is compatible with the QoS of the data reader, which means that the quality of service provided by the data writer must meet the quality of service required by the data reader.
  • the QoS compatibility of the data writer and the data reader is: the QoS value of the data writer is greater than or equal to the QoS value of the data reader, for example, the data writer
  • the DEADLINE QoS compatibility with the DEADLINE QoS of the data reader means that the duration of the DEADLINE QoS of the data writer is less than the duration of the DEADLINE QoS of the data reader.
  • the reliability QoS of the data writer is compatible with the reliability QoS of the data reader, including the reliability of the data reader when the QoS of the data reader is best-effort, the reliability of the data writer QoS is reliable or best effort. When the reliability QoS of the data reader is reliable, the reliability QoS of the data writer must be reliable.
  • DDS303 can establish a data link for data writers and data readers with the same theme and QoS compatibility.
  • FIG. 6 it is a DDS publish-subscribe model applicable to the embodiment of the present application.
  • the publisher 402 created two data writers (such as the data writer 404-1 and the data writer 404-2 in Figure 6), and the subscriber 403 created two data readers (such as Data reader 405-1 and data reader 405-2 in FIG. 6). If the data writer 404-1 and the data reader 405-1 in Figure 6 have the same theme 1 and compatible QoS, and the data writer 404-2 and the data reader 405-2 have the same theme 1 and compatible QoS, DDS can establish the data link between the data writer 404-1 and the data reader 405-1, and the data link between the data writer 404-2 and the data reader 405-2 Data link between.
  • the application module 201 includes an application 601A, an application 601B, an application 601C, and an application 601D.
  • the process of an application corresponds to one or more domain participants.
  • Domain participant 1 and domain participant 2 in FIG. 7 have the same domain number (labeled as domain 610).
  • Domain participant 3 and domain participant 4 have the same domain number (labeled as domain 620).
  • Domain participant 5, domain participant 6, and domain participant 7 have the same domain number (labeled as domain 630). Only data readers and data writers of domain participants belonging to the same domain can establish a data link with QoS based on the topic.
  • ROS provides services similar to computer systems, including hardware abstract description, underlying driver management, execution of shared functions, message transfer between programs, program release package management, etc. Provide tools and libraries for acquiring, building, writing and executing multi-computer fusion programs. It should be noted that the embodiments of the present application do not limit the version of ROS.
  • ROS can be ROS1.0 or ROS2.0.
  • ROS1.0 is taken as an example for description.
  • the ROS 70 shown in FIG. 8 may include an application module 701 and a communication module 702.
  • the application module 701 may correspond to the application layer 101a in FIG. 1, and includes an application program.
  • the communication module 702 may correspond to the framework layer 102a in FIG. 1, and is used to transmit data between different applications in the application module 701.
  • the communication module 702 may include a communication mode layer 7020 and ros_comm7021.
  • the communication mode layer 7020 may provide the following message communication modes: topic mode, service/client mode, and ros parameter service mode. Different message communication modes have different message formats.
  • the topic mode is a message communication mode of direct message delivery. In this mode, application 1 sends a message to application 2, and application 2 receives the message.
  • the service/request mode is a message communication mode of RPC. In this mode, application 1 sends a service request message to application 2; application 2 replies to application 1 with a response message according to the message.
  • the parameter mode is a message communication mode that requests to obtain the value of a parameter or request to change the value of a parameter. In this mode, the application 1 that needs to obtain a parameter or change the value of a parameter sends a message to the parameter server.
  • the parameter server sends the value of the requested parameter to the application program 1 requesting to obtain the parameter according to the message. Or, change the value of the parameter according to the message, and send the changed parameter value to the application 1.
  • the message communication mode is the logic visible to the user, and their concrete realization is with the help of ros_comm7021.
  • ros_comm7021 is a middleware that can provide message transmission.
  • the message interface provided by ros_comm7021 includes a publish interface and a subscription interface, which are used to define the message format of ROS.
  • the communication mode of ros_comm7021 is also a publish-subscribe model.
  • the publish and subscribe model includes master nodes, nodes and parameter servers.
  • a node can be an executable file used to communicate with other nodes.
  • a node can publish a topic message to become a publisher, or subscribe to a topic message to become a subscriber.
  • the publisher is responsible for sending data using the publishing interface.
  • the subscriber is responsible for receiving data using the subscription interface.
  • the master node manages each node and is used to find each other for publishers and subscribers.
  • a parameter server is a multi-variable, shared dictionary that can be accessed through a network API.
  • the parameter server can be regarded as a node, and the node uses the parameter server to store, retrieve or change the value of the parameter at runtime.
  • a topic is a topic agreed upon when a publisher and a subscriber communicate with each other, and each publisher and subscriber can be bound to a topic. Publishers and subscribers that communicate with each other have the same topic.
  • the topic mode the topic includes the topic.
  • the message communication mode is the method mode
  • the subject includes the method identifier.
  • the message communication mode is the parameter mode
  • the subject includes the parameter identifier.
  • ros_comm7021 can establish a data link for publishers and subscribers with the same topic.
  • ros_comm As shown in FIG. 9, it is a publish-and-subscribe model of ros_comm applicable to the embodiment of the present application.
  • the publisher 801 and the subscriber 802 in FIG. 9 have the same topic.
  • ros_comm establishes a data link between the publisher 801 and the subscriber 802 with the same topic.
  • Serialization refers to the process of converting an object into a serial form that can be transmitted.
  • Deserialization The process of restoring a transmittable sequence to an object is called object deserialization.
  • the object in this application refers to the executor who sends or receives messages.
  • objects can include data writers and data readers.
  • objects can include publishers and subscribers.
  • instance identifiers are introduced to distinguish the processes of different applications of the same subject.
  • the AUTOSAR system includes two sensors, and two application processes with the same theme of "obtaining sensor data", the instance identifier of one application process is 1, and the instance identifier of the other application process is 2.
  • the application process with the instance identifier of 1 is used to obtain the data of sensor 1
  • the application process with the instance identifier of 2 is used to obtain the data of sensor 2.
  • the method identifier is used to indicate the program called by the application process in the AUTOSAR system.
  • the service/request identifier is used to indicate the service or request requested by the application process in the ROS.
  • the parameter identifier in the AUTOSAR system is used to indicate the parameters set or acquired by the application process in the AUTOSAR system.
  • the parameter identifier in ROS is used to indicate the parameters set or obtained by the application process in ROS.
  • words such as “exemplary” or “for example” are used as examples, illustrations, or illustrations. Any embodiment or design solution described as “exemplary” or “for example” in the embodiments of the present application should not be construed as being more preferable or advantageous than other embodiments or design solutions. To be precise, words such as “exemplary” or “for example” are used to present related concepts in a specific manner.
  • At least one refers to one or more.
  • Multiple means two or more.
  • "and/or” is merely an association relationship describing associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean that A exists alone, and A and A exist at the same time. B, there are three cases of B alone.
  • the character "/" in this text generally indicates that the associated objects before and after are in an "or" relationship.
  • This application proposes to combine the AUTOSAR system with ROS to take advantage of the advantages of both to create a solution for an automatic driving system or an assisted automatic driving system.
  • the matching rules for the object sending the message and the object receiving the message are inconsistent, the receiving and sending interfaces are different, and the message formats of the two are inconsistent. Therefore, the integration of the two needs to consider the message of the two Intercommunication.
  • the intercommunication between the AUTOSAR system and ROS can be considered as: the event mode in the AUTOSAR system interoperates with the subject mode in ROS; the method mode in the AUTOSAR system interoperates with the service/request mode in ROS; The parameter mode in the AUTOSAR system communicates with the parameter mode in ROS.
  • the DDS and ros_comm at the bottom of the AUTOSAR system are completely two different communication middlewares.
  • the object sending the message and the object receiving the message match as described above.
  • they are naturally incompatible, so solving their compatibility is the core of solving the intercommunication between ROS and AUTOSAR. Specifically related to the following compatibility issues:
  • the AUTOSAR system includes message filtering functions and functions such as the reliability and real-time performance of message transmission through QoS. How to make ROS also perceive these functions.
  • Plan one is to realize the intercommunication plan between AUTOSAR system and ROS based on the agent model.
  • FIG. 11 it is a schematic diagram of the system architecture of a solution based on the agent mode to realize the intercommunication between the AUTOSAR system and the ROS provided by this embodiment of the application.
  • the AUTOSAR system 91 is connected to the agent device 92, and the agent device 92 is connected to the ROS 93.
  • the agent device 92 includes a sub-module 920 for realizing the connection between the event mode in the AUTOSAR system 91 and the theme mode in ROS93; another sub-module 921 is used to realize the connection between the method mode in the AUTOSAR system 91 and the service/request mode in ROS93 Get through; there is also a sub-module 922 used to realize the connection between the parameter mode in the AUTOSAR system 91 and the parameter mode in ROS93.
  • Each sub-module includes objects that send messages and/or receive messages.
  • Each sub-module in the agent device 92 can receive the message sent by the communication module 911 in the AUTOSAR system 91, convert the message into a message format that can be recognized by the communication module 931 in ROS93, and then send the converted message to the communication module 931 in ROS93 . It is also possible to receive a message sent by the communication module 931 in the ROS93, and convert the message into a message format that can be recognized by the communication module 911 in the AUTOSAR system 91; and send the converted message to the communication module 911 in the AUTOSAR system 91.
  • the agent device 92 is the application program in another AUTOSAR system 91 of its counterpart.
  • Their communication follows the communication logic of DDS at the bottom layer, that is, call the communication logic of DDS, read and write interfaces, message types, implement message filtering, and use QoS to ensure the reliability and real-time of message transmission, so as to achieve the matching and matching of objects on both sides. Message transmission.
  • the proxy device 92 is the application program of another ROS93 on its opposite end.
  • the agent device 92 After the agent device 92 receives the messages from both sides at the bottom layer, the message is passed to the upper layer of the agent device 92, and the upper layer will act as the actual translator. It parses the data on one side and transforms it into a recognizable pattern on the other side, and finally uses the communication logic on the other side to forward the data to solve the above problem 3.
  • agent device can be integrated in one device, or can exist independently in one device. This application does not impose restrictions on this.
  • the second scheme is to realize the intercommunication scheme between AUTOSAR system and ROS based on the direct mode.
  • the ROS communication mode layer calls the DDS interface to send and receive messages to solve the above problems 2.
  • FIG. 12 it is a schematic diagram of the system architecture of the solution for interworking between the AUTOSAR system and the ROS based on the direct mode in this application.
  • the AUTOSAR system 10 is connected to ROS11.
  • the AUTOSAR system 10 includes an application module 101 and a communication module 102.
  • the application module 101 includes application programs (such as regulation and execution, etc.).
  • the communication module 102 includes a communication mode layer 1021, a bonding layer 1022, and a DDS 1023.
  • the communication module 102 includes objects that send messages and/or receive messages, and an application program's transceiver interface, which is used for the transmission of underlying data.
  • ROS11 includes an application module 111 and a communication module 112.
  • the application module 111 includes application programs (such as perception, calculation, fusion, etc.).
  • the communication module 112 includes a DDS1123, a combination layer 1122, and a communication mode layer 1121.
  • DDS1123 includes the sending and receiving objects of messages and/or receiving messages, and the receiving and sending interface of the application program, which is used for the transmission of the underlying data.
  • the communication module 102 of the AUTOSAR system 10 is connected to the DDS1123 of the communication module 112 of the ROS11 through the DDS1023.
  • the combination layer 1122 is used to convert the messages of multiple communication modes in the AUTOSAR system 10 received by the DDS 1123 into messages of multiple communication modes that can be recognized by the application module 111 in the ROS11.
  • the combination layer 1122 includes a sub-module for converting the event mode messages that can be recognized by the application module 101 of the AUTOSAR system 10 into the theme mode messages that can be recognized by the application module 111 in the ROS11, and another sub-module is used to apply the AUTOSAR system 10
  • the message of the method mode recognized by the module 101 is converted into the message of the service/request mode recognized by the application module 111 in ROS11, and a sub-module is used to convert the message of the parameter mode recognized by the application module 101 of AUTOSAR system 10 into ROS11.
  • the intercommunication between AUTOSAR system and ROS based on proxy mode includes: initialization phase, service discovery phase and message communication phase. The following describes these stages respectively:
  • the communication module in the AUTOSAR system includes domain participants, publishers, subscribers, data writers and/or data readers of its application process.
  • the communication module in ROS includes the publisher and/or subscriber of its application process.
  • the first agent module When the message communication mode of the application process in the AUTOSAR system includes the event mode, after the initialization of the first agent module is completed, the first agent module includes domain participants that have the same subject and instance identifiers of the communication module in the AUTOSAR system and are QoS compatible. Publishers, subscribers, data writers, and/or data readers.
  • the first agent module When the message communication mode of the application process in the AUTOSAR system includes the method mode, after the initialization of the first agent module is completed, the first agent module includes the same QoS-compatible domain participation as the method identifier and instance identifier of the communication module in the AUTOSAR system. Authors, publishers, subscribers, data writers, and/or data readers.
  • the first agent module When the message communication mode of the application process in the AUTOSAR system includes the parameter mode, after the initialization of the first agent module is completed, the first agent module includes the same method identifier, parameter identifier, and instance identifier of the communication module in the AUTOSAR system and has the same QoS Compatible domain participants, publishers, subscribers, data writers and/or data readers.
  • the second agent module includes publishers and/or subscribers with the same topic as the communication module in ROS.
  • the second agent module When the message communication mode of the application process in ROS includes the service/request mode, after the initialization of the second agent module is completed, the second agent module includes the publisher and/or subscriber with the same service/request identifier as the communication module in ROS .
  • the second agent module includes the publisher and/or the same as the service/request identifier and parameter identifier of the communication module in ROS subscriber.
  • the embodiment of the application does not limit the way in which information such as the subject, instance identifier, QoS, method identifier, service/request identifier, parameter identifier in the AUTOSAR system, and parameter identifier in ROS in the agent device can be obtained.
  • the agent The device may obtain the above-mentioned information by obtaining the configuration file, or the agent device may receive the above-mentioned information sent by the AUTOSAR system and/or ROS.
  • the embodiment of the present application does not limit the trigger conditions for the initialization of the automatic driving system or the auxiliary automatic driving system.
  • the automatic driving system or the auxiliary automatic driving system is initialized after being powered on.
  • the automatic driving system or the auxiliary automatic driving system receives the user's instruction and completes the initialization according to the user's instruction.
  • the service discovery phase includes the service discovery process of the AUTOSAR system and the agent device in the first embodiment; and the service discovery process of the agent device and the ROS in the second embodiment.
  • FIG. 13 it is a schematic flowchart of an AUTOSAR system and a method for service discovery of an agent device provided by an embodiment of this application. Exemplarily, this embodiment may be applied to the system architecture shown in FIG. 11.
  • the method shown in FIG. 13 may include the following steps:
  • the AUTOSAR system sends the first data to the agent device.
  • the first data writer in the AUTOSAR system sends the first data whose subject is participant data to the first data reader in the agent device.
  • the first data includes information such as the identifier of the first domain participant, the network address, the adopted QoS, and the instance identifier.
  • the first data writer is a data writer preset in the AUTOSAR system for domain participant service discovery
  • the first data reader is a data reader preset in the agent device for domain participant service discovery By.
  • the first domain participant is any created domain participant in the AUTOSAR system.
  • S101 The proxy device judges whether the QoS in the first data is compatible with the QoS of the domain participant that has been created in the proxy device. If not, then end; if yes, then execute S102.
  • S102 The agent device adds the first data to the local information database.
  • the proxy device sends second data to the AUTOSAR system.
  • the second data includes information such as the identifier of the second domain participant, the network address, the adopted QoS, and the instance identifier.
  • the second domain participant is a domain participant created by the proxy device, and the QoS of the second domain participant is compatible with the QoS of the first domain participant.
  • the agent device sends the second data to the AUTOSAR system, and the AUTOSAR system determines whether the QoS in the second data is compatible with the QoS of the domain participant created in the AUTOSAR system. If it is compatible, after storing the second data in the local information database, and sending the first data to the agent device, the agent device stores the first data in the local information database.
  • the embodiment of the application does not limit the order in which AUTOSAR and the agent device discover each other.
  • the AUTOSAR system sends the description information of the second data writer (marked as the first description information) to the agent device.
  • the second data writer is any data writer other than the first data writer among the data writers in the AUTOSAR system.
  • the first description information includes information such as the subject of the data written by the second data writer, the QoS used, and the instance identifier.
  • the publisher data writer in the AUTOSAR system sends the first description information to the subscriber data reader in the proxy device.
  • the proxy device acquires a second data reader that matches the second data writer.
  • the second data reader is any data reader that matches the second data writer in the agent device.
  • the agent device adds the matching relationship between the second data writer and the second data reader to the local information database, that is, establishes a data link between the second data writer and the second data reader.
  • the AUTOSAR system may send a message to the agent device for the agent device to update the matching relationship in the local information database in real time.
  • the agent device can send the description information of the data reader to the AUTOSAR system,
  • the AUTOSAR system finds a data writer that matches the second data reader, it adds the matching relationship between the data reader and the data writer to the local information database.
  • the AUTOSAR system will also send a message to the domain participant in the matching proxy device Information, which is used to update the local information database in real time by domain participants that match it.
  • the above S100 to S107 are the matching process between the data writer in the AUTOSAR system and the data reader in the agent device. Similarly, the matching process between the data reader in the AUTOSAR system and the data writer in the agent device is similar, and will not be repeated.
  • FIG. 14 it is a schematic flowchart of a proxy device and a ROS service discovery method provided by an embodiment of this application. Exemplarily, this embodiment may be applied to the system architecture shown in FIG. 11.
  • the method shown in FIG. 14 may include the following steps:
  • the first publisher in the proxy device sends the first publisher information to the master node in the ROS.
  • the first publisher information includes the subject of the message published by the first publisher.
  • the first issuer is any issuer in the proxy device.
  • the master node in ROS is the process of the application in ROS.
  • the first publisher information may further include at least one of the message format, address, or port of the message published by the first publisher information.
  • the master node in the ROS stores the first publisher information in the local information database.
  • the master node in the ROS obtains the first subscriber matching the first publisher.
  • the first subscriber is any subscriber in the ROS whose topic is the same as that included in the first publisher information.
  • the master node in ROS first obtains subscriber information of any local subscriber; secondly, it determines whether the subject of the subscribed message in the subscriber information is the same as the subject in the first publisher information. If they are the same, the ROS master node regards the subscriber as the first subscriber and obtains the first subscriber information.
  • the first subscriber information includes the subject of the message subscribed by the first subscriber.
  • the first subscriber information further includes the message format, address, and port of the message subscribed by the first subscriber. If they are not the same, the ROS master node obtains the subscriber information of another subscriber in the master node, and determines whether the subject of the subscribed message in the subscriber information is the same as the subject in the first publisher information. And so on, until all subscribers in the ROS master node have been traversed.
  • S203 The master node in the ROS sends the first publisher information to the first subscriber in the ROS.
  • S204 The first subscriber in the ROS stores the first publisher information in the local information database.
  • S205 The first subscriber in the ROS sends the first subscriber information to the first publisher in the proxy device.
  • the first publisher in the proxy device stores the first subscriber information in the local information database.
  • S207 The first publisher in the proxy device sends a response message to the first subscriber in the ROS.
  • the first publisher in the proxy device has established a publish-subscribe relationship with the first subscriber in the ROS.
  • the ROS master node can regard all subscribers in the ROS master node with the same subject of the message subscribed in the subscriber information as the first subscriber, and perform S203-S207.
  • Each publisher in the proxy device can find a matching subscriber through the above method, and store the information of the matched subscriber in the local information database.
  • the publisher in ROS can send publisher information to the master node in ROS, and the subscriber in the proxy device sends subscriber information to the master node in ROS to complete the subscribers in the proxy device and the ROS.
  • the publisher's service discovery can also be implemented by using existing technology, which is not limited in the embodiment of the present application.
  • a data link is established between the data writer and the data reader.
  • the AUTOSAR system and the agent device can communicate business data messages.
  • a publish-subscribe relationship is established between the publisher and the subscriber.
  • the business data message communication can be carried out between the proxy device and the ROS.
  • ROS master node is an application process, which can be in the agent device or in ROS.
  • the embodiments of the present application do not limit this.
  • ROS1.0 There is no ROS master node in ROS2.0.
  • ROS2.0 publishers send publisher information to subscribers, and subscribers judge the received publisher information Whether it matches with its own topic, if it matches, store the publisher's information to the local repository; and send the subscriber's information to the publisher.
  • the publisher stores the matched subscriber information to the local repository.
  • the publisher and the subscriber establish a publish-subscribe relationship.
  • the subscriber in ROS can send subscriber information to the publisher, and the publisher judges whether the received subscriber information matches its own topic, and if it matches, it stores the subscriber information in the local database; Subscribers send publisher information.
  • the subscriber stores the matching publisher information to the local information database to complete the service discovery of subscribers and publishers.
  • FIG. 15 it is a schematic flow diagram of a method for the AUTOSAR system to send messages to the ROS through the proxy device in the method for implementing the message communication between the AUTOSAR system and the ROS based on the proxy mode provided by the embodiment of this application.
  • this embodiment may be applied to the system architecture shown in FIG. 11.
  • the method shown in FIG. 15 may include the following steps:
  • AUTOSAR system generates message 1. Specifically, the application module in the AUTOSAR system generates message 1.
  • the format of message 1 is a format that can be recognized by the application module of the AUTOSAR system.
  • message 1 When message 1 is a message in event mode, message 1 may include an event, an instance identifier, message content, and so on. Among them, the event is the subject for finding the message recipient, and the instance identifier indicates the process of the application that generated the message 1. The content of the message is the specific information sent.
  • message 1 may include a first message identifier, an instance identifier, and so on.
  • the first message identifier includes a method identifier and/or a parameter identifier.
  • the first message identifier includes: a method identifier indicating the SET method, a parameter identifier indicating a certain parameter, and so on.
  • the method identifier and/or the parameter identifier are the subject, which is used to find the message recipient.
  • the instance identifier indicates the process of the application that generated the message 1.
  • the AUTOSAR system uses the first serialization function to serialize message 1 into message 2.
  • Serialization is the conversion of a message into a form that can be transmitted.
  • the format of message 2 is a format that can be recognized by the communication module of the AUTOSAR system.
  • the application module in the AUTOSAR system calls the write interface of the DDS to send message 1 to the DDS of the communication module.
  • the communication module uses the first serialization function to serialize message 1 into message 2.
  • the first object of the DDS of the communication module in the AUTOSAR system sends the message 2 through the write interface.
  • the first object is the data writer assigned by the DDS to the message 1 when the message 1 passes through the DDS.
  • message 1 is an event mode message
  • the subject of the first object is the same as the event in message 1
  • the instance identifier of the first object is the same as the instance identifier in message 1.
  • message 1 is a method or parameter mode message
  • the subject of the first object is the same as the method identifier and/or parameter identifier in message 1
  • the instance identifier of the first object is the same as the instance identifier in message 1.
  • the proxy device deserializes message 2 into message 3 by using the first serialization function.
  • the format of message 3 is a format that can be recognized by the application module in the AUTOSAR system. Among them, deserialization is the opposite process of serialization.
  • the proxy device filters the message 3 according to the instance identifier in the message 3.
  • the agent device assigns message 3 to the second object, where the second object is a data reader in the agent device that matches the first object, and the instance identifier of the second object is the same as the instance identifier in message 3. .
  • the proxy device filters messages that are different from the instance identifier of the second object.
  • S305 The proxy device converts message 3 into message 4, where the format of message 4 is a format that can be recognized by the application module of ROS. specific:
  • the second object in the proxy device reads message 3 through the DDS read interface. Then, perform the following steps:
  • the proxy device obtains the corresponding relationship with the first message identifier according to the pre-stored correspondence between the method identifier in the AUTOSAR system and the service/request identifier in the ROS.
  • the message 4 includes the second message identifier, and the second message identifier includes the service/request identifier in the ROS.
  • the method identifier and the service request identifier in Table 1 are only examples. In actual use, the method identifier may be the name of the method, and the service request identifier may be the name of the service/request.
  • the proxy device acquires the parameter identifier in the first message identifier according to the correspondence between the parameter identifier in the AUTOSAR system and the parameter identifier in ROS.
  • the parameter identifier corresponding to the symbol.
  • the message 4 generated by the proxy device converting the format of the message 3 includes the second message identifier.
  • the second message identifier includes the parameter identifier in ROS.
  • the service/request identifier in the corresponding ROS is 2230, and the first message identifier
  • the first parameter identifier in the symbol is: AUTOSAR system parameter identifier 1.
  • the parameter identifier in the second message identifier is: ROS parameter identifier 1.
  • the proxy device serializes the message 4 into the message 5 by using the second serialization function.
  • the format of message 5 is a format that can be recognized by the ROS communication module.
  • S305 and S306 can be integrated in one step, or can be separated into separate steps, which is not limited in this application.
  • the proxy device sends message 5 to the ROS. Specifically, the second object in the proxy device sends the message 5 to the third object in the proxy device.
  • the third object uses the ROS publishing interface to send message 5 to ROS.
  • the third object is the publisher in the proxy device.
  • message 5 is a message in topic mode
  • the subject of the message published by the third object is the same as that of message 5.
  • message 5 is a service/request or parameter mode message
  • the subject of the message published by the third object is the same as the service/request identifier or parameter identifier in message 5.
  • ROS uses the second serialization function to deserialize message 5 into message 6, and the format of message 6 is a format that can be recognized by the application module of ROS.
  • ROS allocates message 6 to the fourth object, and the fourth object reads message 6 from the subscription interface of ROS.
  • the fourth object is a subscriber in ROS that matches the third object.
  • the ROS finishes executing S309, and performs actions according to the message 6 (such as modifying the configuration in the ROS) or no action, and then ends.
  • ROS finishes executing S309, and then executes S310.
  • ROS provides the service/request indicated by the identifier according to the service/request identifier in the second message identifier in message 6.
  • the service/request identifier included in the second message identifier indicates a set request
  • the ROS parameter identifier 1 included in the second message identifier indicates parameter 1.
  • ROS sets the value of parameter 1 according to the indication of the service/request identifier.
  • ROS obtains the execution result 1 of the service/request indicated by the service/request identifier in the second message identifier.
  • execution result 1 includes: the value of parameter 1 set by ROS is Y.
  • the proxy device when the AUTOSAR system sends a message to the ROS through the proxy device, the proxy device can filter the message according to the instance identifier and convert it into a format that can be recognized by ROS, thus realizing multiple modes of message communication between the AUTOSAR system and ROS ( Including event/theme mode, method/service request mode, parameter mode, etc.). At the same time, it can take into account the selection of services in the AUTOSAR system, and use QoS to ensure the reliability and real-time performance of message transmission.
  • ROS can send the execution result 1 to the AUTOSAR system through the proxy device. Specifically, refer to the method in which the ROS sends messages to the AUTOSAR system through the proxy device in the fourth embodiment below.
  • FIG. 16 it is a schematic flow diagram of the method for ROS to send messages to the AUTOSAR system through the proxy device in the method for implementing the message communication between the AUTOSAR system and the ROS based on the proxy mode provided by the embodiment of this application.
  • this embodiment may be applied to the system architecture shown in FIG. 11.
  • the method shown in FIG. 16 may include the following steps:
  • ROS generates message 7. Specifically, the application module in ROS generates message 7.
  • the format of message 7 is a format that can be recognized by the application module of ROS.
  • message 7 When message 7 is a message in topic mode, message 7 may include the topic, message content, and so on. Among them, the topic is used to find subscribers. The content of the message is the specific information sent.
  • the message 7 may include the first message identifier.
  • the first message identifier includes a service/request identifier and/or parameter identifier.
  • the first message identifier includes: a service/request identifier indicating a SET request, a parameter identifier indicating a certain parameter, and so on.
  • the service/request identifier and/or parameter identifier are the subject, which is used to find the subscriber.
  • S401 ROS serializes message 7 into message 8 by using the second serialization function. Among them, serialization is to convert the message into a form that can be transmitted.
  • the format of message 7 is a format that can be recognized by the ROS communication module.
  • the application module in ROS calls the publishing interface of the communication module to send a message 7 to the ros_comm of the communication module.
  • the ros_comm of the communication module uses the second serialization function to serialize message 7 into message 8.
  • the fifth object of the DDS of the communication module in the ROS sends a message 8 to the agent device using the publishing interface.
  • the fifth object is a publisher whose topic of the published message is the same as that of message 8.
  • the proxy device deserializes the message 8 into the message 9 by using the second serialization function.
  • the format of message 9 is a format that can be recognized by the ROS application module. Among them, deserialization is the opposite process of serialization.
  • the proxy device distributes the message 9 to the sixth object, the sixth object reads the message 9 from the subscription interface of the ROS, and the sixth object is a subscriber matching the fifth object.
  • the proxy device converts the message 9 into the message 10.
  • the format of the message 10 is a format that can be recognized by the application module of the AUTOSAR system.
  • the proxy device obtains the parameter identifier in the AUTOSAR system corresponding to the parameter identifier in the ROS according to the correspondence between the parameter identifier in the AUTOSAR system and the parameter identifier in the ROS.
  • the message 10 that the agent device converts the message 9 into includes the acquired parameter identifier in the AUTOSAR system.
  • the proxy device obtains the AUTOSAR system corresponding to the service/request identifier in the ROS according to the correspondence between the method identifier in the AUTOSAR system and the service/request identifier in the ROS The method identifier in.
  • the message 10 that the agent device converts the message 9 into includes the acquired method identifier in the AUTOSAR system.
  • the sixth object in the proxy device sends a message 10 to the seventh object.
  • the seventh object is a data writer, and the subject of the written data is the same as the subject of message 10.
  • the proxy device adds the configured instance identifier to message 10, and obtains message 11. Among them, the instance identifier indicates the process of the application that generated the message 7.
  • S407 is optional. When the message 10 includes the configured instance identifier, S407 does not need to be executed.
  • the proxy device serializes the message 11 into the message 12 by using the first serialization function.
  • S409 The agent device sends a message 12 to the AUTOSAR system.
  • the seventh object in the proxy device sends a message 12 to the AUTOSAR system through the DDS write interface.
  • the AUTOSAR system uses the first serialization function to deserialize the message 12 to obtain the message 13, and assign the message 13 to the eighth object, which is a data reader that matches the seventh object.
  • the eighth object reads the message 13 through the DDS read interface, and the message 13 is a message format that can be recognized by the AUTOSAR system application module.
  • the proxy device when the ROS system sends a message to the AUTOSAR system through the proxy device, the proxy device can convert the message into a format that can be recognized by the AUTOSAR system, and add the instance identifier to the message sent to the AUTOSAR system to achieve ROS and Various modes of message communication in the AUTOSAR system (including event/topic mode, method/service request mode, parameter mode, etc.). Similarly, the service selection in the AUTOSAR system can be taken into consideration, and QoS can be used to ensure the reliability and real-time performance of message transmission.
  • the intercommunication between AUTOSAR system and the ROS based on the pass-through mode also includes: initialization phase, service discovery phase and message communication phase.
  • the communication module in the AUTOSAR system includes domain participants, publishers, subscribers, data writers and/or data readers of its application process.
  • the communication module in ROS includes the publisher and/or subscriber of its application process.
  • the message communication mode of the application process in the AUTOSAR system includes the event mode
  • the ROS underlying data distribution service includes domain participants, publishers, and publishers that have the same subject and instance identifiers of the communication module in the AUTOSAR system. Subscribers, data writers, and/or data readers.
  • the message communication mode of the application process in the AUTOSAR system includes the method mode
  • the ROS underlying data distribution service includes domain participants and releases that are the same as the method identifier and instance identifier of the communication module in the AUTOSAR system and are compatible with QoS. Readers, subscribers, data writers, and/or data readers.
  • the message communication mode of the application process in the AUTOSAR system includes the parameter mode
  • the ROS underlying data distribution service includes domain participants and releases that are the same as the communication module parameter identifier and instance identifier of the AUTOSAR system and are compatible with QoS. Readers, subscribers, data writers, and/or data readers.
  • the embodiment of the application does not limit the method of obtaining the instance identifier in the conversion layer of the ROS communication module.
  • the conversion layer of the ROS communication module can obtain the instance identifier by obtaining the configuration file, or the conversion layer of the ROS communication module can receive the AUTOSAR system and/or ROS.
  • the instance identifier sent by the application module can be obtained by obtaining the configuration file, or the conversion layer of the ROS communication module can receive the AUTOSAR system and/or ROS.
  • the embodiment of the present application does not limit the trigger conditions for the initialization of the automatic driving system or the auxiliary automatic driving system.
  • the automatic driving system or the auxiliary automatic driving system is initialized after being powered on.
  • the automatic driving system or the auxiliary automatic driving system receives the user's instruction and completes the initialization according to the user's instruction.
  • the flow of the service discovery method for the data writer in the AUTOSAR system and the data reader in the ROS can refer to the service of the data writer in the AUTOSAR system and the data reader in the proxy device in S100 ⁇ S108 in the first embodiment.
  • the discovery process can also refer to other methods in the prior art, which is not limited in this application. No longer.
  • FIG. 17 it is a schematic flowchart of a method for realizing the message communication between the AUTOSAR system and the ROS based on the direct mode provided by the embodiment of this application.
  • This embodiment can be applied to the system architecture shown in FIG. 12.
  • the method shown in FIG. 17 may include the following steps:
  • ROS uses the first serialization function to deserialize message 2 into message 3.
  • the format of message 3 is a format that can be recognized by the application module in the AUTOSAR system.
  • ROS assigns message 3 to a second object, where the second object is a data reader that matches the first object in the DDS of the bottom layer of the ROS communication module.
  • the instance identifier of the second object is the same as the instance identifier in message 3. In this way, the ROS filters messages that are different from the instance identifier of the second object.
  • ROS converts message 3 to message 4.
  • the format of message 4 is a format that can be recognized by the ROS application module.
  • the execution subject "agent device" in S305 is replaced with "the conversion layer of the ROS communication module".
  • the conversion layer of the ROS communication module sends the message 4 to the application module of the ROS. Then it ends.
  • S505 is executed and S506 is executed.
  • the application module of the ROS provides the service/request indicated by the identifier according to the service/request identifier in the message 4.
  • the ROS parameter identifier included in the second message identifier indicates parameter 1.
  • ROS obtains the value of parameter 1 according to the instructions of the service/request.
  • ROS obtains the execution result 1 of the service/request provided by ROS.
  • the format of execution result 1 is a format that can be recognized by the ROS application module. Later, ROS can send execution result 1 to the AUTOSAR system.
  • execution result 1 includes: the value of parameter 1 acquired by ROS is Y.
  • the DDS and conversion layer added in the ROS can filter the messages in the AUTOSAR system and convert them into a format that can be recognized by the ROS, thus realizing multiple modes of the AUTOSAR system and ROS Message communication (including event/topic mode, method/service request mode, parameter mode, etc.).
  • it can take into account the selection of services in the AUTOSAR system, and use QoS to ensure the reliability and real-time performance of message transmission.
  • FIG. 18 it is a schematic flowchart of another method for realizing the message communication between the AUTOSAR system and the ROS based on the direct mode provided by the embodiment of this application.
  • this embodiment may be applied to the system architecture shown in FIG. 12.
  • the method shown in FIG. 18 may include the following steps:
  • ROS generates message 5.
  • the format of message 5 is a format that can be recognized by the application module of ROS.
  • ROS converts message 5 to message 6.
  • the format of message 6 is a format that can be recognized by the AUTOSAR system application module.
  • the ROS application module sends a message 5 to the conversion layer of the communication module.
  • the conversion layer of the ROS communication module converts the message 5 into the message 6 with reference to the method of S405 in the fourth embodiment, which will not be repeated here.
  • S602 ROS adds the configured instance identifier to message 6, and message 7 is obtained.
  • the instance identifier indicates the process of the application that generated the message 5.
  • S602 is optional. When the message 6 includes the configured instance identifier, S602 does not need to be executed.
  • ROS uses the first serialization function to serialize message 7 into message 8.
  • the format of message 8 is a format that can be recognized by the AUTOSAR system communication module.
  • the first object in ROS calls the write interface of DDS to send a message 8 to the AUTOSAR system.
  • the first object is any data writer in ROS, and the subject of the data written by the data writer is the same as the subject in message 8, and the instance identifier is the same.
  • the AUTOSAR system uses the first serialization function to deserialize message 8 into message 9.
  • the format of message 9 is a format that can be recognized by the AUTOSAR system application module.
  • the AUTOSAR system performs message filtering on the message 9 according to the instance identifier in the message 9. Specifically, the AUTOSAR system assigns message 9 to the second object.
  • the second object is the data reader who matches the first object in the AUTOSAR system.
  • the instance identifier of the second object is the same as the instance identifier in message 9. In this way, the ROS filters messages that are different from the instance identifier of the second object.
  • the communication module of the AUTOSAR system sends a message 9 to the application process indicated by the instance identifier in the message 9 of the application module of the AUTOSAR system.
  • the application process takes corresponding actions according to message 9.
  • the application process in the AUTOSAR system receives the value of the parameter 1 in the AUTOSAR system in message 9 as Y, and the parameter 1 in the AUTOSAR system indicates whether to turn on the fog lights, and the AUTOSAR system turns on the fog lights according to the value of this parameter.
  • S606 is executed and then ends.
  • the message 9 includes the method identifier, after executing S606, the AUTOSAR system obtains the execution result, and the AUTOSAR system sends the execution result to ROS.
  • the steps in S500 to S505 in the fifth embodiment which will not be repeated here.
  • the DDS and conversion layer added in the ROS system can convert the message format that can be recognized by the communication mode layer of the ROS communication module to the communication mode layer that can be recognized by the AUTOSAR system communication module.
  • the message format is added and the instance identifier is added and then converted into a format that the AUTOSAR system DDS can transmit, which realizes the message communication between the AUTOSAR system and ROS in various modes (including event/topic mode, method/service request mode, parameter mode, etc.).
  • it can take into account the selection of services in the AUTOSAR system, and use QoS to ensure the reliability and real-time performance of message transmission.
  • the embodiment of the present application may divide the function modules of the agent device according to the foregoing method examples.
  • each function module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 19 it is a schematic structural diagram of an agent device provided by an embodiment of this application.
  • the proxy device 50 can be used to perform the functions performed by the proxy device in any of the above embodiments (the embodiments shown in FIGS. 13 to 16).
  • the agent device 50 is applied to an automatic driving system or an auxiliary automatic driving system, and the automatic driving system or an auxiliary automatic driving system further includes: a first computer system and a second computer system.
  • the proxy device 50 may include: a first proxy module 501 and a second proxy module 502. Wherein, the first agent module 501 is configured to receive the first message sent by the first computer system.
  • the format of the first message is a format that can be recognized by the first computer system
  • the first message is converted into a second message
  • the format of the second message is a format that can be recognized by the second computer system.
  • the second agent module 502 is configured to send a second message to the second computer system.
  • the first proxy module 501 can be used to execute the receiving steps in S100 and S105, and the sending steps in S101 to S102 and S103, S106 to S107.
  • the second proxy module 502 can be used to perform the sending steps in S200 and S207, the receiving step in S205, and S206.
  • the first agent module 501 can be used to execute the receiving steps in S302, S303-S304.
  • the second proxy module 502 can be used to perform the sending steps in S305 to S306 and S307. With reference to FIG. 16, the second proxy module 502 can be used to execute the receiving steps in S402, S403 to S404. The first proxy module 501 can be used to execute the sending steps in S405-S408 and S409.
  • the first computer system includes an AUTOSAR system
  • the second computer system includes ROS
  • the first computer system includes ROS
  • the second computer system includes an AUTOSAR system
  • the subject of the message sent by the first object included in the first computer system is the same as the subject of the message received by the second object included in the proxy device 50.
  • the first object is the sender of the message sent in the first computer system, and the second object is the recipient of the received message in the agent device 50.
  • the message sent by the first object includes the first message.
  • the subject of the message sent by the third object included in the proxy device 50 is the same as the subject of the message received by the fourth object included in the second computer system.
  • the third object is the sender of the message sent in the agent device 50, and the fourth object is the recipient of the message received in the second computer system.
  • the message sent by the third object includes the second message.
  • the first computer system includes an AUTOSAR system
  • the second computer system includes ROS
  • the first agent module 501 supports the same message format as the communication module of the AUTOSAR system.
  • the second agent module 502 supports the same message format as the ROS communication module.
  • the first computer system includes ROS
  • the second computer system includes an AUTOSAR system
  • the message format supported by the first agent module 501 and the communication module of the ROS is the same.
  • the second agent module 502 supports the same message format as the communication module of the AUTOSAR system.
  • the first computer system includes an AUTOSAR system and the second computer system includes ROS, and the QoS used by the first object is compatible with the QoS used by the second object.
  • the first message is a remote procedure call RPC mode message or a parameter mode message
  • the first message includes the first message identifier.
  • the first message identifier includes a method identifier and/or a parameter identifier.
  • the first proxy module 501 is further configured to determine the second message identifier corresponding to the first identifier according to the correspondence between the message identifier that can be recognized by the first computer system and the message identifier that can be recognized by the second computer system.
  • the second message includes a second message identifier, and the second message identifier includes a method identifier and/or a parameter identifier.
  • the first proxy module 501 includes a first read interface and a first write interface, the first read interface is the same as the read interface of the first computer system, and the first write interface is the same as the write interface of the first computer system.
  • the first proxy module 501 is specifically configured to: use the first read interface to receive the first message sent by the write interface of the first computer system.
  • the second proxy module 502 includes a second read interface and a second write interface.
  • the second read interface is the same as the read interface of the second computer system
  • the second write interface is the same as the write interface of the second computer system.
  • the second proxy module 502 is specifically configured to: use the second write interface to send the second message to the read interface of the second computer system.
  • the first computer system includes an AUTOSAR system
  • the second computer system includes ROS.
  • the first proxy module 501 is also used to filter the first message.
  • the first proxy module 501 is specifically configured to convert the filtered first message into a second message.
  • the first computer system includes ROS
  • the second computer system includes an AUTOSAR system
  • the second message does not include an instance identifier.
  • the first agent module 501 is specifically configured to add an instance identifier to the second message, where the instance identifier is used for the AUTOSAR system to determine the fourth object.
  • both the first agent module 501 and the second agent module 502 described above may be implemented by the processor 103 in FIG. 3 calling a computer program stored in the system memory 135.
  • both the above-mentioned first agent module 501 and the second agent module 502 may be implemented by the processor 113 in FIG. 2 calling a computer program stored in the memory 114.
  • FIG. 20 it is a schematic structural diagram of a computer system provided by an embodiment of this application.
  • the computer system 90 can be used to perform the functions performed by the ROS in any of the above embodiments (FIG. 17 or FIG. 18).
  • the computer system 90 is applied to an automatic driving system or an auxiliary automatic driving system, and the automatic driving system or an auxiliary automatic driving system further includes: a first computer system.
  • the computer system 90 includes: a second application module 901 and a second communication module 902.
  • the second communication module 902 is configured to receive the first message sent by the first computer system.
  • the format of the first message is a format that can be recognized by the first computer system, and the first message is converted into a second message.
  • the format of the second message is a format that can be recognized by the second application module 901, and the second message is sent to the second application module 901.
  • the second application module 901 is configured to receive a second message.
  • the second application module 901 is configured to send the first message to the second communication module 902.
  • the second communication module 902 is configured to convert the first message into a second message.
  • the format of the second message is a format that can be recognized by the first computer system, and the second message is sent to the first computer system.
  • the second communication module 902 may be used to perform the receiving steps in S502, S503 to S505, and the second application module 901 may be used to perform S506 to S507.
  • the second application module 901 may be used to execute S600-S602.
  • the second communication module 902 may be used to: execute the sending steps in S603 and S604.
  • the first computer system includes an automotive open system architecture AUTOSAR system
  • the computer system 90 includes a robot computer system ROS.
  • the first computer system includes ROS
  • the computer system 90 includes an AUTOSAR system.
  • the subject of the message sent by the first object included in the first computer system is the same as the subject of the message received by the second object included in the computer system 90.
  • the subject of the message received by the first object included in the first computer system is the same as the subject of the message sent by the second object included in the computer system 90.
  • the first object is the sender of the message sent in the first computer system
  • the second object is the recipient of the received message in the computer system 90.
  • the message sent by the first object includes the first message; or, the message received by the first object includes the second message.
  • the message formats supported by the first computer system and the second communication module 902 are the same.
  • the first computer system includes an AUTOSAR system and the computer system 90 includes ROS, and the QoS used by the first object is compatible with the QoS used by the second object.
  • the first message is a remote procedure call RPC mode message or a parameter mode message, and the first message includes the first message identifier.
  • the first message identifier includes a method identifier and/or a parameter identifier;
  • the second communication module 902 is also used to, according to the correspondence between the message identifier that can be recognized by the first computer system and the message identifier that can be recognized by the computer system 90, Determine the second message identifier corresponding to the first identifier.
  • the second communication module 902 is specifically configured to convert the first message into a second message, the second message includes a second message identifier, and the second message identifier includes a method identifier and/or a parameter identifier.
  • the first computer system includes an AUTOSAR system
  • the computer system 90 includes ROS.
  • the second communication module 902 is further configured to filter the first message.
  • the second communication module 902 is specifically configured to convert the filtered first message into a second message.
  • the first computer system includes ROS
  • the computer system 90 includes an AUTOSAR system.
  • the second message does not include the instance identifier; the second communication module 902 is also used to add the instance identifier to the second message.
  • the second communication module 902 is specifically configured to send a second message with an instance identifier added to the second application module 901. Among them, the instance identifier is used in the AUTOSAR system to determine the second object.
  • both the second application module 901 and the second communication module 902 described above may be implemented by the processor 103 in FIG. 3 calling a computer program stored in the system memory 135.
  • both the second application module 901 and the second communication module 902 described above may be implemented by the processor 113 in FIG. 2 calling a computer program stored in the memory 114.
  • the embodiment of the present application also provides a device (such as a computer device or a chip), including: a memory and a processor; the memory is used to store a computer program, and the processor is used to call the computer program to execute any of the above-provided computer programs. Actions or steps mentioned in the embodiment.
  • the embodiments of the present application also provide a computer-readable storage medium with a computer program stored on the computer-readable storage medium.
  • the computer program runs on a computer, the computer executes any of the above-provided embodiments. The action or step mentioned.
  • the embodiment of the application also provides a chip.
  • the chip integrates a circuit and one or more interfaces for realizing the function of the above-mentioned positioning problem device.
  • the functions supported by the chip may include processing actions based on the embodiments described in FIG. 13 to FIG. 18, which will not be repeated here.
  • Those of ordinary skill in the art can understand that all or part of the steps for implementing the above-mentioned embodiments can be completed by a program instructing related hardware.
  • the program can be stored in a computer-readable storage medium.
  • the aforementioned storage medium may be a read-only memory, a random access memory, and the like.
  • the aforementioned processing unit or processor may be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), and a field programmable gate array (field programmable gate array).
  • ASIC application specific integrated circuit
  • DSP digital signal processor
  • field programmable gate array field programmable gate array
  • FPGA field programmable gate array
  • the embodiments of the present application also provide a computer program product containing instructions, which when the instructions run on a computer, cause the computer to execute any one of the methods in the foregoing embodiments.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • computer instructions may be transmitted from a website, computer, server, or data center through a cable (such as Coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (such as infrared, wireless, microwave, etc.) transmission to another website site, computer, server or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or may include one or more data storage devices such as a server or a data center that can be integrated with the medium.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • the foregoing devices for storing computer instructions or computer programs provided in the embodiments of the present application are non-transitory. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Automation & Control Theory (AREA)
  • Traffic Control Systems (AREA)

Abstract

本申请公开了消息通信方法、计算机系统及代理装置,有助于使得自动驾驶系统或辅助自动驾驶系统能够同时具备第一计算机系统与第二计算机系统的优良特性,从而提高自动驾驶系统或辅助自动驾驶系统的性能。该消息通信方法应用于自动驾驶系统或辅助自动驾驶系统,该自动驾驶系统或辅助自动驾驶系统包括:第一计算机系统、第二计算机系统和代理装置,该方法包括:代理装置接收第一计算机系统发送的第一消息,第一消息的格式是第一计算机系统能够识别的格式,将第一消息转换为第二消息;第二消息的格式是第二计算机系统能够识别的格式;代理装置向第二计算机系统发送第二消息。

Description

消息通信方法、计算机系统及代理装置
本申请要求于2020年01月19日提交国家知识产权局、申请号为202010060807.X、申请名称为“消息通信方法、计算机系统及代理装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及自动驾驶或辅助自动驾驶技术领域,尤其涉及消息通信方法、计算机系统及代理装置。
背景技术
如图1所示,自动驾驶车辆软件架构可以包括应用层和框架层。应用层包含了感知、融合、规控和执行等应用。框架层用于为应用层提供基础逻辑及规则,包括计算逻辑,通信逻辑等。当前业界一般使用汽车开放系统架构(automotive open system architecture,AUTOSAR)或者机器人操作系统(robot operating system,ROS)作为框架层。
AUTOSAR系统虽然对于车辆传统的控制、执行等部分的功能比较完善,但是对于自动驾驶系统的开发支持力度不够,具体体现在,应用层的感知、融合、规控和执行等功能不容易开发。ROS系统最初是面向机器人系统开发的面向数据面的软件架构,因此对计算、决策等功能比较擅长,但是,对于车辆传统的控制、执行等部分需要进行额外的开发。因此,如何设计自动驾驶系统或辅助自动驾驶系统,成为亟待解决的技术问题。
发明内容
本申请的实施例提供消息通信方法、计算机系统及代理装置,有助于使得自动驾驶系统或辅助自动驾驶系统能够同时具备第一计算机系统与第二计算机系统的优良特性,从而提高了自动驾驶系统或辅助自动驾驶系统的性能。
为达到上述目的,本申请的实施例采用如下技术方案:
第一方面,提供一种消息通信方法,应用于自动驾驶系统或辅助自动驾驶系统,该自动驾驶系统或辅助自动驾驶系统包括:第一计算机系统、第二计算机系统和代理装置,该方法包括:代理装置接收第一计算机系统发送的第一消息,第一消息的格式是第一计算机系统能够识别的格式。代理装置将第一消息转换为第二消息。第二消息的格式是第二计算机系统能够识别的格式。代理装置向第二计算机系统发送第二消息。这样,在自动驾驶系统或辅助自动驾驶系统中加入代理装置用于转换第一计算机系统和第二计算机系统的消息格式,以使得第一计算机系统与第二计算机系统进行消息的通信,有助于使得自动驾驶系统或辅助自动驾驶系统能够同时具备第一计算机系统与第二计算机系统的优良特性(例如,能够兼顾AUTOSAR系统对车辆的传统控制,以及ROS的感知、计算、融合和仿真等高级功能)。
在一种可能的实现方式中,第一计算机系统包括AUTOSAR系统,且第二计算机 系统包括ROS。或者,第一计算机系统包括ROS,且第二计算机系统包括AUTOSAR系统。这样,可以实现AUTOSAR系统与ROS消息的互通。
在一种可能的实现方式中,第一消息是远程过程调用RPC模式的消息或参数模式的消息,第一消息包括第一消息标识符,第一消息标识符包括方法标识符和/或参数标识符。该方法还包括:根据第一计算机系统能够识别的消息标识符与第二计算机系统能够识别的消息标识符的对应关系,确定第一消息标识符对应的第二消息标识符。其中,第二消息包括第二消息标识符,第二消息标识符包括方法标识符和/或参数标识符。这样,可以实现第一计算机系统的应用程序调用第二计算机系统中的应用程序,以及使得第一计算机系统能够获取或设置第二计算机系统中的参数,从而实现第一计算机系统与第二计算机系统中远程过程调用模式和参数模式的消息的通信。
在一种可能的实现方式中,第一计算机系统包括的第一对象发送的消息的主题,与代理装置包括的第二对象接收的消息的主题相同。第一对象是第一计算机系统中发送消息的发送者,第二对象是代理装置中的接收消息的接收者。第一对象发送的消息包括第一消息。代理装置包括的第三对象发送的消息的主题,与第二计算机系统包括的第四对象接收的消息的主题相同。第三对象是代理装置中发送消息的发送者。第四对象是第二计算机系统中接收消息的接收者。第三对象发送的消息包括第二消息。这样,可以使得代理装置中的对象分别与第一计算机系统和第二计算机系统中的对象匹配,用于消息的发送和接收。
在一种可能的实现方式中,第一计算机系统包括AUTOSAR系统,且第二计算机系统包括ROS,该方法还包括,代理装置对第一消息进行过滤。代理装置将第一消息转换为第二消息,具体包括:代理装置将过滤后的第一消息转换为第二消息。这样,使得AUTOSAR系统中发送的消息可以准确对应到ROS中的应用程序的进程。
在一种可能的实现方式中,第一计算机系统包括ROS,第二计算机系统包括AUTOSAR系统,且第二消息不包括实例标识符,该方法还包括:代理装置将实例标识符添加至第二消息,其中,实例标识符用于AUTOSAR系统确定第四对象。这样,由ROS发送给AUTOSAR系统的消息也可以准确对应到AUTOSAR系统中的应用程序的进程。
在一种可能的实现方式中,第一计算机系统包括AUTOSAR系统,且第二计算机系统包括ROS,第一对象所使用的服务质量(quality of service,QoS)与第二对象所使用的QoS兼容,或者,当第一计算机系统包括ROS,且第二计算机系统包括AUTOSAR,第三对象所使用的QoS与第四对象所使用的QoS兼容。这样,可以保障在代理装置与AUTOSAR系统通信时,发送消息的发送者与接收消息的接收者,主题一致且QoS兼容。在一种可能的实现方式中,发送者的QoS需要与接收者的QoS兼容。发送者的QoS的值定义发送者所提供的服务质量;接收者的QoS的值定义接收者要求的服务质量。发送者的QoS与接收者的QoS兼容指发送者提供的服务质量必须满足接收者要求的服务质量。
第二方面,提供一种消息通信方法,应用于自动驾驶系统或辅助自动驾驶系统,该自动驾驶系统或辅助自动驾驶系统包括:第一计算机系统和第二计算机系统,该方法包括:第二计算机系统接收第一计算机系统发送的第一消息,第一消息的格式是第 一计算机系统能够识别的格式,第二计算机系统将第一消息转换为第二消息,第二消息的格式是第二计算机系统能够识别的格式。这样,第二计算机系统中增加了对第一计算机系统中格式转换至第二计算机系统的格式的逻辑,使得第一计算机系统与第二计算机系统实现消息的通信。
在一种可能的实现方式中,第一计算机系统包括汽车开放系统架构AUTOSAR系统,且第二计算机系统包括机器人操作系统ROS;或者,第一计算机系统包括ROS,且第二计算机系统包括AUTOSAR系统。这样,可以实现AUTOSAR系统与ROS消息的互通。
在一种可能的实现方式中,第一消息是远程过程调用RPC模式的消息或参数模式的消息,第一消息包括第一消息标识符,第一消息标识符包括方法标识符和/或参数标识符。该方法还包括:第二计算机系统根据第一计算机系统能够识别的消息标识符与第二计算机系统能够识别的消息标识符的对应关系,确定第一消息标识符对应的第二消息标识符。第二消息包括第二消息标识符第二消息标识符包括方法标识符和/或参数标识符。这样,可以实现第一计算机系统的应用程序调用第二计算机系统中的应用程序,以及使得第一计算机系统能够获取或设置第二计算机系统中的参数,从而实现第一计算机系统与第二计算机系统中远程过程调用模式和参数模式的消息的通信。
在一种可能的实现方式中,第一计算机系统包括的第一对象发送的消息的主题,与第二计算机系统包括的第二对象接收的消息的主题相同。第一计算机系统包括的第一对象接收的消息的主题,与第二计算机系统包括的第二对象发送的消息的主题相同。第一对象是第一计算机系统中发送消息的发送者,第二对象是第二计算机系统中的接收消息的接收者。第一对象发送的消息包括第一消息;或者,第二对象发送的消息包括第二消息。这样,可以使得第一计算机系统中的对象与第二计算机系统中的对象匹配,用于消息的发送和接收。
在一种可能的实现方式中,第一计算机系统包括AUTOSAR系统,且第二计算机系统包括ROS,该方法还包括:第二计算机系统对第一消息进行过滤。第二计算机系统将第一消息转换为第二消息,包括:第二计算机系统将过滤后的第一消息转换为第二消息。这样,使得AUTOSAR系统中发送的消息可以准确对应到ROS中的应用程序的进程。
在一种可能的实现方式中,第一计算机系统包括ROS,第二计算机系统包括AUTOSAR系统,且第一消息不包括实例标识符,该方法还包括:第二计算机系统将实例标识符添加至第二消息,其中,实例标识符用于AUTOSAR系统确定第二对象。这样,由ROS发送给AUTOSAR系统的消息也可以准确对应到AUTOSAR系统中的应用程序的进程。
在一种可能的实现方式中,第一计算机系统包括AUTOSAR系统,且第二计算机系统包括ROS,所述第一对象所使用的QoS与所述第二对象所使用的QoS相兼容。这样,可以保障在ROS与AUTOSAR系统通信时,发送消息的发送者与接收消息的接收者,主题一致且QoS兼容。
第三方面,提供一种代理装置,该装置可用于执行上述第一方面至第一方面的任一种可能的实现方式中提供的任一种方法。示例的,该代理装置可以是计算机设备(如 终端设备、服务器或云端服务器)或芯片等。
根据第三方面,在第三方面的第一种可能的实现方式中,可以根据上述第一方面提供的任一种方法,对该装置进行功能模块的划分。例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。
根据第三方面或第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,该装置可以包括处理器,处理器用于执行上述第一方面提供的任一种方法。
第四方面,提供了一种计算机可读存储介质,如计算机非瞬态的可读存储介质。其上储存有计算机程序(或指令),当该计算机程序(或指令)在计算机上运行时,使得该计算机执行上述第一方面或第一方面的任一种可能的实现方式提供的任一种方法。
第五方面,提供了一种计算机程序产品,当其在计算机上运行时,使得第一方面或第一方面的任一种可能的实现方式提供的任一种方法被执行。
第六方面,提供了一种芯片,包括:处理器,用于从存储器中调用并运行该存储器中存储的计算机程序,执行第一方面或第一方面的任一种可能的实现方式提供的任一种方法。
第七方面,提供了一种计算机系统,该计算机系统可用于执行上述第二方面或第二方面的任一种可能的实现方式提供的任一种方法被执行。根据第二方面,在第二方面的第一种可能的实现方式中,可以根据上述第二方面提供的任一种方法,对该计算机系统进行功能模块的划分。例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。
根据第二方面或第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,该计算机系统可以包括处理器,处理器用于执行上述第二方面提供的任一种方法。
第八方面,提供了一种计算机可读存储介质,如计算机非瞬态的可读存储介质。其上储存有计算机程序(或指令),当该计算机程序(或指令)在计算机上运行时,使得该计算机执行上述第二方面或第二方面的任一种可能的实现方式提供的任一种方法。
第九方面,提供了一种计算机程序产品,当其在计算机上运行时,使得第二方面或第二方面的任一种可能的实现方式提供的任一种方法被执行。
第十方面,提供了一种芯片,包括:处理器,用于从存储器中调用并运行该存储器中存储的计算机程序,执行第二方面或第二方面的任一种可能的实现方式提供的任一种方法。
可以理解的是,上述提供的任一种代理装置、计算机系统、计算机存储介质、计算机程序产品或芯片等均可以应用于上文所提供的对应的方法,因此,其所能达到的有益效果可参考对应的方法中的有益效果,此处不再赘述。
附图说明
图1为可适用于本申请实施例的一种自动驾驶车辆软件架构结构示意图;
图2为可适用于本申请实施例提供的一种车辆100的功能框图;
图3为可适用于本申请实施例提供的一种计算机系统的结构示意图;
图4为可适用于本申请实施例的基于AUTOSAR系统的自动驾驶或辅助自动驾驶系统的结构示意图;
图5为可适用于本申请实施例的域参与者、发布者、订阅者、数据写入者和数据读取者的关系图;
图6为可适用于本申请实施例的一种DDS的发布订阅模型;
图7为可适用于本申请实施例的域、域参与者与应用程序的关系示意图;
图8为可适用于本申请实施例的基于ROS的自动驾驶或辅助自动驾驶系统的结构示意图;
图9为可适用于本申请实施例的ros_comm的发布订阅模型;
图10为本申请实施例提供的AUTOSAR系统与ROS的互通示意图;
图11为本申请实施例提供的一种基于代理模式实现AUTOSAR系统与ROS的互通方案的系统架构示意图;
图12为本申请实施例提供的一种基于直通模式实现AUTOSAR系统与ROS的互通方案的系统架构示意图;
图13为本申请实施例提供的一种AUTOSAR系统与代理装置服务发现方法的流程示意图;
图14为本申请实施例提供的一种代理装置与ROS服务发现方法的流程示意图;
图15为本申请实施例提供的一种基于代理模式实现AUTOSAR系统与ROS消息通信方法中AUTOSAR系统通过代理装置向ROS发送消息的方法的流程示意图;
图16为本申请实施例提供的一种基于代理模式实现AUTOSAR系统与ROS消息通信方法中ROS通过代理装置向AUTOSAR系统发送消息的方法流程示意图;
图17为本申请实施例提供的一种基于直通模式实现AUTOSAR系统与ROS消息通信方法的流程示意图;
图18为本申请实施例提供的另一种基于直通模式实现AUTOSAR系统与ROS消息通信方法的流程示意图;
图19为本申请实施例提供的一种代理装置的结构示意图;
图20为本申请实施例提供的一种计算机系统的结构示意图。
具体实施方式
图2为可适用于本申请实施例提供的一种车辆100的功能框图。在一个实施例中,将车辆100配置为完全或部分地自动驾驶模式。例如,车辆100可以在处于自动驾驶模式中的同时控制自身,并且可通过人为操作来确定车辆及其周边环境的当前状态,确定周边环境中的至少一个其他车辆的可能行为,并确定该其他车辆执行可能行为的可能性相对应的置信水平,基于所确定的信息来控制车辆100。在车辆100处于自动驾驶模式中时,可以将车辆100置为在没有和人交互的情况下操作。
车辆100可包括各种子系统,例如行进系统102、传感系统104、控制系统106、一个或多个外围设备108以及电源110、计算机系统112和用户接口116。可选地,车辆100可包括更多或更少的子系统,并且每个子系统可包括多个元件。另外,车辆100的每个子系统和元件可以通过有线或者无线互连。
行进系统102可包括为车辆100提供动力运动的组件。在一个实施例中,行进系统102可包括引擎118、能量源119、传动装置120和车轮121。引擎118可以是内燃引擎、电动机、空气压缩引擎或其他类型的引擎组合,例如气油发动机和电动机组成的混动引擎,内燃引擎和空气压缩引擎组成的混动引擎。引擎118将能量源119转换成机械能量。
能量源119的示例包括汽油、柴油、其他基于石油的燃料、丙烷、其他基于压缩气体的燃料、乙醇、太阳能电池板、电池和其他电力来源。能量源119也可以为车辆100的其他系统提供能量。
传动装置120可以将来自引擎118的机械动力传送到车轮121。传动装置120可包括变速箱、差速器和驱动轴。在一个实施例中,传动装置120还可以包括其他器件,比如离合器。其中,驱动轴可包括可耦合到一个或多个车轮121的一个或多个轴。
传感系统104可包括感测关于车辆100周边的环境的信息的若干个传感器。例如,传感系统104可包括定位系统122(定位系统可以是GPS系统,也可以是北斗系统或者其他定位系统)、惯性测量单元(inertial measurement unit,IMU)124、雷达126、激光测距仪128以及相机130。传感系统104还可包括被监视车辆100的内部系统的传感器(例如,车内空气质量监测器、燃油量表、机油温度表等)。来自这些传感器中的一个或多个的传感器数据可用于检测对象及其相应特性(位置、形状、方向、速度等)。这种检测和识别是车辆100的安全操作的关键功能。
定位系统122可用于估计车辆100的地理位置。惯性测量单元124用于基于惯性加速度来感测车辆100的位置和朝向变化。在一个实施例中,惯性测量单元124可以是加速度计和陀螺仪的组合。
雷达126可利用无线电信号来感测车辆100的周边环境内的物体。在一些实施例中,除了感测物体以外,雷达126还可用于感测物体的速度和/或前进方向。
激光测距仪128可利用激光来感测车辆100所位于的环境中的物体。在一些实施例中,激光测距仪128可包括一个或多个激光源、激光扫描器以及一个或多个检测器,以及其他系统组件。
相机130可用于捕捉车辆100的周边环境的多个图像。相机130可以是静态相机或视频相机。
控制系统106为控制车辆100及其组件的操作。控制系统106可包括各种元件,其中包括转向系统132、油门134、制动单元136、计算机视觉系统140、路线控制系统142以及障碍规避系统144。
转向系统132可操作来调整车辆100的前进方向。例如在一个实施例中可以为方向盘系统。
油门134用于控制引擎118的操作速度并进而控制车辆100的速度。
制动单元136用于控制车辆100减速。制动单元136可使用摩擦力来减慢车轮121。在其他实施例中,制动单元136可将车轮121的动能转换为电流。制动单元136也可采取其他形式来减慢车轮121转速从而控制车辆100的速度。
计算机视觉系统140可以操作来处理和分析由相机130捕捉的图像以便识别车辆100周边环境中的物体和/或特征。所述物体和/或特征可包括交通信号、道路边界和障 碍物。计算机视觉系统140可使用物体识别算法、运动中恢复结构(Structure from Motion,SFM)算法、视频跟踪和其他计算机视觉技术。在一些实施例中,计算机视觉系统140可以用于为环境绘制地图、跟踪物体、估计物体的速度等等。
路线控制系统142用于确定车辆100的行驶路线。在一些实施例中,路线控制系统142可结合来自雷达126、定位系统122和一个或多个预定地图的数据以为车辆100确定行驶路线。
障碍规避系统144用于识别、评估和避免或者以其他方式越过车辆100的环境中的潜在障碍物。
当然,在一个实例中,控制系统106可以增加或替换地包括除了所示出和描述的那些以外的组件。或者也可以减少一部分上述示出的组件。
车辆100通过外围设备108与外部传感器、其他车辆、其他计算机系统或用户之间进行交互。外围设备108可包括无线通信系统146、车载电脑148、麦克风150和/或扬声器152。
在一些实施例中,外围设备108提供车辆100的用户与用户接口116交互的手段。例如,车载电脑148可向车辆100的用户提供信息。用户接口116还可操作车载电脑148来接收用户的输入。车载电脑148可以通过触摸屏进行操作。在其他情况中,外围设备108可提供用于车辆100与位于车内的其它设备通信的手段。例如,麦克风150可从车辆100的用户接收音频(例如,语音命令或其他音频输入)。类似地,扬声器152可向车辆100的用户输出音频。
无线通信系统146可以直接地或者经由通信网络来与一个或多个设备无线通信。例如,无线通信系统146可使用3G蜂窝通信,例如CDMA、EVD0、GSM/GPRS,或者4G蜂窝通信,例如LTE。或者5G蜂窝通信。无线通信系统146可利用WiFi与无线局域网(wireless local area network,WLAN)通信。在一些实施例中,无线通信系统146可利用红外链路、蓝牙或ZigBee与设备直接通信。其他无线协议,例如各种车辆通信系统,例如,无线通信系统146可包括一个或多个专用短程通信(dedicated short range communications,DSRC)设备,这些设备可包括车辆和/或路边台站之间的公共和/或私有数据通信。
电源110可向车辆100的各种组件提供电力。在一个实施例中,电源110可以为可再充电锂离子或铅酸电池。这种电池的一个或多个电池组可被配置为电源为车辆100的各种组件提供电力。在一些实施例中,电源110和能量源119可一起实现,例如一些全电动车中那样。
车辆100的部分或所有功能受计算机系统112控制。计算机系统112可包括至少一个处理器113,处理器113执行存储在例如存储器114这样的非暂态计算机可读介质中的指令115。计算机系统112还可以是采用分布式方式控制车辆100的个体组件或子系统的多个计算设备。
处理器113可以是任何常规的处理器,诸如商业可获得的CPU。替选地,该处理器可以是诸如ASIC或其它基于硬件的处理器的专用设备。尽管图2功能性地图示了处理器、存储器、和在相同块中的计算机的其它元件,但是本领域的普通技术人员应该理解该处理器、计算机、或存储器实际上可以包括可以或者可以不存储在相同的物 理外壳内的多个处理器、计算机、或存储器。例如,存储器可以是硬盘驱动器或位于不同于计算机的外壳内的其它存储介质。因此,对处理器或计算机的引用将被理解为包括对可以或者可以不并行操作的处理器或计算机或存储器的集合的引用。不同于使用单一的处理器来执行此处所描述的步骤,诸如转向组件和减速组件的一些组件每个都可以具有其自己的处理器,所述处理器只执行与特定于组件的功能相关的计算。
在此处所描述的各个方面中,处理器可以位于远离该车辆并且与该车辆进行无线通信。在其它方面中,此处所描述的过程中的一些在布置于车辆内的处理器上执行而其它则由远程处理器执行,包括采取执行单一操纵的必要步骤。
在一些实施例中,存储器114可包含指令115(例如,程序逻辑),指令115可被处理器113执行来执行车辆100的各种功能,包括以上描述的那些功能。存储器114也可包含额外的指令,包括行进系统102、传感系统104、控制系统106和外围设备108中的一个或多个发送数据、从其接收数据、与其交互和/或对其进行控制的指令。
除了指令115以外,存储器114还可存储数据,例如道路地图、路线信息,车辆的位置、方向、速度以及其它这样的车辆数据,以及其他信息。这种信息可在车辆100在自主、半自主和/或手动模式中操作期间被车辆100和计算机系统112使用。
用户接口116,用于向车辆100的用户提供信息或从其接收信息。可选地,用户接口116可包括在外围设备108的集合内的一个或多个输入/输出设备,例如无线通信系统146、车载电脑148、麦克风150和扬声器152。
计算机系统112可基于从各种子系统(例如,行进系统102、传感系统104和控制系统106)以及从用户接口116接收的输入来控制车辆100的功能。例如,计算机系统112可利用来自控制系统106的输入以便控制转向系统132来避免由传感系统104和障碍规避系统144检测到的障碍物。在一些实施例中,计算机系统112可操作来对车辆100及其子系统的许多方面提供控制。
可选地,上述这些组件中的一个或多个可与车辆100分开安装或关联。例如,存储器114可以部分或完全地与车辆100分开存在。上述组件可以按有线和/或无线方式来通信地耦合在一起。
可选地,上述组件只是一个示例,实际应用中,上述各个模块中的组件有可能根据实际需要增添或者删除,图2不应理解为对本申请实施例的限制。
上述车辆100可以为轿车、卡车、摩托车、公共汽车、船、飞机、直升飞机、割草机、娱乐车、游乐场车辆、施工设备、电车、高尔夫球车、火车、和手推车等,本申请实施例不做特别的限定。
如图3所示,为可适用于本申请实施例的计算机系统的结构示意图,计算机系统101包括处理器103,处理器103和系统总线105耦合。处理器103可以是一个或者多个处理器,其中每个处理器都可以包括一个或多个处理器核。显示适配器(video adapter)107,显示适配器107可以驱动显示器109,显示器109和系统总线105耦合。系统总线105通过总线桥111和输入输出(I/O)总线175耦合。I/O接口157和I/O总线175耦合。I/O接口157和多种I/O设备进行通信,比如输入设备117(如:键盘,鼠标,触摸屏等),媒体盘(media tray)121(例如:CD-ROM,多媒体接口等),收发器123(可以发送和/或接受无线电通信信号),摄像头155(可以捕捉景田和动态 数字视频图像),传感器153和USB端口125。其中,可选地,和I/O接口157相连接的接口可以是USB接口。
其中,处理器103可以是任何传统处理器,包括精简指令集计算(“RISC”)处理器、复杂指令集计算(“CISC”)处理器或上述的组合。可选地,处理器可以是诸如专用集成电路(“ASIC”)的专用装置。可选地,处理器103可以是神经网络处理器或者是神经网络处理器和上述传统处理器的组合。
可选地,在本文所述的各种实施例中,计算机系统101可位于远离自动驾驶车辆的地方,并且可与自动驾驶车辆进行无线通信。在其它方面,本文所述的一些过程在设置在自动驾驶车辆内的处理器上执行,其它由远程处理器执行,包括采取执行单个操纵所需的动作。
计算机系统101可以通过网络接口129和软件部署服务器149通信。网络接口129是硬件网络接口,比如,网卡。网络127可以是外部网络,比如因特网,也可以是内部网络,比如以太网或者虚拟私人网络(VPN)。可选地,网络127还可以是无线网络,比如WiFi网络,蜂窝网络等。
硬盘驱动器接口131和系统总线105耦合。硬盘驱动器接口131和硬盘驱动器133相连接。系统内存135和系统总线105耦合。运行在系统内存135的数据可以包括计算机系统101的操作系统137和应用程序143。
操作系统137包括Shell 139和内核(kernel)141。Shell 139是介于使用者和操作系统137间的一个接口。Shell139是操作系统137最外面的一层。Shell139管理使用者与操作系统137之间的交互:等待使用者的输入,向操作系统137解释使用者的输入,并且处理各种各样的操作系统137的输出结果。
内核141由操作系统137中用于管理存储器、文件、外设和系统资源的那些部分组成。直接与硬件交互,内核141通常运行进程,并提供进程间的通信,提供CPU时间片管理、中断、内存管理、IO管理等等。
应用程序143包括自动驾驶相关程序147,比如,管理自动驾驶的汽车和路上障碍物交互的程序,控制自动驾驶汽车路线或者速度的程序,控制自动驾驶汽车和路上其他自动驾驶汽车交互的程序。应用程序143也存在于软件部署服务器149的系统上。在一个实施例中,在需要执行应用程序143时,计算机系统101可以从软件部署服务器149下载应用程序143。
传感器153可以通过I/O接口157和计算机系统101关联。传感器153用于探测计算机系统101周围的环境。举例来说,传感器153可以探测动物,汽车,障碍物和人行横道等,进一步传感器还可以探测上述动物,汽车,障碍物和人行横道等物体周围的环境,比如:动物周围的环境,例如,动物周围出现的其他动物,天气条件,周围环境的光亮度等。可选地,如果计算机系统101位于自动驾驶的汽车上,传感器可以是摄像头,红外线感应器,化学检测器,麦克风等。
在一个示例中,图2中计算机系统112可以是图3中的计算机系统101。图2中的处理器113可以是图3中的处理器103,图2中的存储器114可以是图3中的系统内存135或媒体盘121。
在另一个示例中,图3中的操作系统137的软件架构可以是图1所示的自动驾驶 车辆软件架构。
以下,对本申请实施例中所涉及的部分术语和技术进行简单介绍:
1)、AUTOSAR系统
AUTOSAR系统为汽车工业开发的一个开放的、标准化软件架构体系。该软件架构体系中底层可以通过数据分发服务(data distribution service,DDS)实现数据的传输,当然不限于此。如图4所示的AUTOSAR系统20(为基于AUTOSAR的自动驾驶或辅助自动驾驶系统),可以包括应用模块201和通信模块202。应用模块201可以对应于图1中的应用层101a,包括应用程序。通信模块202可以对应于图1中的框架层102a,主要用于进行应用模块201中不同应用程序之间数据的传输。
通信模块202可以包括沟通模式层301、结合层(DDS binding layer)302和DDS303。
沟通模式层301可以提供如下消息沟通模式:事件(event)模式、方法(method)模式和参数(field)模式。不同的消息沟通模式具有不同的消息格式。事件模式是消息直送的消息沟通模式。该模式中,应用程序1向应用程序2发送消息,应用程序2接收该消息。方法模式是远程过程调用(remote procedure call,RPC)的消息沟通模式。该模式中,应用程序1向应用程序2发送请求服务的消息;应用程序2根据该消息向应用程序1回复响应消息。参数模式是请求获取参数的值或者请求改变参数的值的消息沟通模式。该模式中,需要获取参数或改变某个参数的值的应用程序1,向应用程序2发送消息。应用程序2根据该消息向应用程序1发送所请求的参数的值;或者根据该消息更改参数的值,并向应用程序1发送更改后的参数的值。消息沟通模式是用户可见的,它们的具体实现借助了DDS303。
沟通模式层301通过结合层302调用DDS303的接口。
DDS303是一种分布式的、高可靠、高实时的消息通信中间件。DDS303强调以数据为中心,主题(topic)是唯一标识某种数据的标识符。特定主题的消息有确定的数据类型,数据类型通过基本类型char、byte、int等进行定义。示例性的,主题可以是“TEXT”,该主题的消息的数据类型为char。DDS303提供消息接口用于定义所收发消息的消息格式和数据类型,DDS303提供的消息接口包括写(write)接口和读(read)接口等。
DDS303的通信模式是一种发布订阅模型,该发布订阅模型将系统划分为逻辑独立的若干域(domain),每个域内包含若干实体(entity),由这些实体完成数据的发布、订阅及其他交互任务。实体包括:域参与者(domain participant)、发布者(publisher)、订阅者(subscriber)、主题、数据写入者(data writer)和数据读取者(data reader)。这些实体都有与其对应的若干QoS。
域是一个范围概念,由域号(domain ID)唯一标识,通常,在同一个域内的实体才能通信,不同域内的实体间一般无逻辑关系。
域参与者作为DDS303的入口,用于创建主题,注册数据类型。管理发布者、订阅者等实体。
发布者负责管理(如创建、删除)数据写入者。发布者可以在DDS中注册声明为数据的发布者时,声明其生产的数据类型、主题,并描述提供的QoS等注册声明信息。 订阅者负责管理(如创建、删除)数据读取者。订阅者可以在DDS中注册声明为数据的订阅者时,声明其需要的数据类型、主题以及QoS等注册声明信息。
数据写入者负责利用写函数(如write())生成数据。数据读取者负责读取数据。需要说明的是,DDS303中包括一类用于服务发现的数据读取者和数据写入者,如下文实施例一中的第一数据写入者与第一数据读取者;或者,AUTOSAR系统中的发布者数据读取者(pb-datareader)、代理装置中的订阅者数据写入者(sb–datawriter);或者,代理装置中的订阅者数据读取者(sb-datareader)、AUTOSAR系统中的发布者数据写入者(pb-datawriter))。以及,DDS303中还包括一类用于应用程序之间的数据传输的数据读取者和数据写入者(如下文实施例一中的第二数据读取者、第二数据写入者)。
域参与者、发布者、订阅者、数据写入者和数据读取者的关系可以如图5所示。在图5中,一个域参与者401可以创建多个发布者402和/或订阅者403,一个发布者402可以创建多个数据写入者404(如图5中的数据写入者404-1和数据写入者404-2),一个订阅者403可以创建多个数据读取者405(如图5中的数据读取者405-1和数据读取者405-2)。如果一个数据写入者或者数据读取者是由一个发布者或者订阅者创建的,则该数据写入者或数据读取者与创建该发布者或者订阅者的域参与者关联。
每个数据写入者和数据读取者可以与一个主题绑定。相互通信的数据写入者与数据读取者之间的主题相同。当消息沟通模式为事件模式时,主题包括事件的标识符。当消息沟通模式为方法模式时,主题包括方法标识符。当消息沟通模式为参数模式时,主题包括参数标识符。
QoS是一组可配置的参数,使用QoS能够保证DDS303消息通信的服务质量。
在一种实现方式中,数据写入者的QoS需要与数据读取者的QoS兼容。数据写入者的QoS的值定义数据写入者所提供的服务质量;数据读取者的QoS的值定义数据读取者要求的服务质量。数据写入者的QoS与数据读取者的QoS兼容指数据写入者提供的服务质量必须满足数据读取者要求的服务质量。
在一种可能的实现方式中,数据写入者和数据读取者的QoS兼容为:数据写入者的QoS的值的大于或等于数据读取者的QoS的值,例如,数据写入者的DEADLINE QoS与数据读取者的DEADLINE QoS兼容指数据写入者的DEADLINE QoS的持续时间小于数据读取者的DEADLINE QoS的持续时间。又如,数据写入者的可靠性(reliability)QoS与数据读取者的可靠性QoS兼容包括数据读取者的可靠性QoS为最大努力(best-effort)时,数据写入者的可靠性QoS为可靠(reliable)或最大努力。数据读取者的可靠性QoS为可靠时,数据写入者的可靠性QoS必须为可靠。
DDS303可以为主题相同且QoS兼容的数据写入者和数据读取者建立数据链路。
如图6所示,为可适用于本申请实施例的一种DDS的发布订阅模型。图6中发布者402创建了两个数据写入者(如图6中的数据写入者404-1和数据写入者404-2),订阅者403创建了两个数据读取者(如图6中的数据读取者405-1和数据读取者405-2)。若图6中数据写入者404-1与数据读取者405-1具有相同的主题1和相兼容的QoS,且数据写入者404-2与数据读取者405-2具有相同的主题1和相兼容的QoS,则DDS可以建立数据写入者404-1与数据读取者405-1之间的数据链路,以及数据写入者 404-2与数据读取者405-2之间的数据链路。
使用DDS实现AUTOSAR系统底层数据传输时,域、域参与者与应用模块201的应用程序的关系如图7所示。在图7中,应用模块201中包括应用程序601A、应用程序601B、应用程序601C和应用程序601D。一个应用程序的进程对应一个或多个域参与者。图7中域参与者1和域参与者2具有相同的域号(标记为域610)。域参与者3和域参与者4具有相同的域号(标记为域620)。域参与者5、域参与者6和域参与者7具有相同的域号(标记为域630)。同属于一个域的域参与者的数据读取者和数据写入者才能根据主题与QoS建立数据链路。
2)、ROS
ROS提供类似于计算机系统的服务,包括硬件抽象描述、底层驱动程序管理、共用功能的执行、程序间消息传递、程序发行包管理等。提供工具和库用于获取、建立、编写和执行多机融合的程序。需要说明的是,本申请实施例对ROS的版本不进行限制,例如ROS可以是ROS1.0也可以是ROS2.0。以下均以ROS1.0为例进行说明。
如图8所示的ROS70(为基于ROS的自动驾驶或辅助自动驾驶系统)可以包括应用模块701和通信模块702。应用模块701可以对应于图1中的应用层101a,包括应用程序。通信模块702可以对应于图1中的框架层102a,用于进行应用模块701中不同应用程序之间数据的传输。
通信模块702可以包括沟通模式层7020和ros_comm7021。
沟通模式层7020可以提供如下消息沟通模式:主题模式、服务/请求(service/client)模式和参数(ros parameter service)模式。不同的消息沟通模式具有不同的消息格式。主题模式是消息直送的消息沟通模式,该模式中,应用程序1向应用程序2发送消息,应用程序2接收该消息。服务/请求模式是RPC的消息沟通模式,该模式中,应用程序1向应用程序2发送请求服务的消息;应用程序2根据该消息向应用程序1回复响应消息。参数模式是请求获取参数的值或者请求改变参数的值的消息沟通模式。该模式中,需要获取参数或改变某个参数的值的应用程序1,向参数服务器发送消息。参数服务器根据该消息向请求获取参数的应用程序1发送所请求的参数的值。或者,根据该消息更改参数的值,并向应用程序1发送更改后的参数的值。消息沟通模式是用户可见的逻辑,它们的具体实现借助了ros_comm7021。
ros_comm7021是一种能够提供消息传送的中间件。ros_comm7021提供的消息接口包括发布接口和订阅接口,用于定义ROS的消息格式等。
ros_comm7021的通信模式也是一种发布订阅模型。该发布订阅模型中包括主节点、节点和参数服务器。一个节点可以是一个可执行文件,用来与其他节点进行通信。
节点可以发布一个主题的消息成为发布者,也可以订阅一个主题的消息成为订阅者。
发布者,负责利用发布接口发送数据。
订阅者,负责利用订阅接口接收数据。
主节点管理各个节点,用于为发布者和订阅者找到彼此。
一个参数服务器是一个多变量的、共享的、能够通过网络API进入的词典。参数服务器可看作一个节点,节点使用参数服务器在运行时来存储、检索或更改参数的值。
主题是发布者和订阅者相互通信时约定的主题,每个发布者和订阅者可以与一个主题绑定。相互通信的发布者与订阅者之间的主题相同。当消息沟通模式为主题模式时,主题包括主题。当消息沟通模式为方法模式时,主题包括方法标识符。当消息沟通模式为参数模式时,主题包括参数标识符。
ros_comm7021可以为主题相同的发布者与订阅者建立数据链路。
如图9所示,为可适用于本申请实施例的ros_comm的发布订阅模型。图9中发布者801与订阅者802主题相同。ros_comm为主题相同的发布者801与订阅者802建立数据链路。
3)、序列化、反序列化
序列化:指将对象转换为可以传输的序列形式的过程。
反序列化:将可传输的序列恢复为对象的过程称为对象的反序列化。
4)、对象
本申请中对象指发送消息或接收消息的执行者。在AUTOSAR系统中,对象可以包括数据写入者和数据读取者。在ROS中,对象可以包括发布者和订阅者。
5)、实例标识符
本申请实施例中的DDS中为了区分同一主题的不同应用程序的进程引入了实例标识符,用于区分同一主题的不同应用程序的进程。示例性的,AUTOSAR系统中包括两个传感器,主题同为“获取传感器数据”的两个应用程序进程,一个应用程序进程的实例标识符为1,另一个应用程序进程的实例标识符为2。实例标识符为1的应用程序进程用于获取传感器1的数据,实例标识符为2的应用程序进程用于获取传感器2的数据。
6)、方法标识符、参数标识符、服务/请求标识符
方法标识符用于指示AUTOSAR系统中应用程序进程调用的程序。
服务/请求标识符用于指示ROS中应用程序进程所请求的服务或请求。
AUTOSAR系统中参数标识符用于指示AUTOSAR系统中应用程序进程设置或者获取的参数。ROS中参数标识符用于指示ROS中应用程序进程设置或者获取的参数。
7)、其他术语
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
在本申请实施例中,“至少一个”是指一个或多个。“多个”是指两个或两个以上。
在本申请实施例中,“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
本申请提出将AUTOSAR系统与ROS结合,以利用二者的优势,创建一个自动驾驶系统或辅助自动驾驶系统的解决方案。但是,由于AUTOSAR系统与ROS的软件架构不同,发送消息的对象与接收消息的对象匹配时遵循的规则不一致,收发接口不同,两者消息格式不一致,因此,二者的融合需要考虑二者消息的互通。
作为示例,如图10所示,AUTOSAR系统与ROS的互通,可以认为是:AUTOSAR系统中的事件模式与ROS中的主题模式互通;AUTOSAR系统中的方法模式与ROS中的服务/请求模式互通;AUTOSAR系统中的参数模式与ROS中的参数模式互通。
但是,对于AUTOSAR系统与ROS通信模块底层来说,由于AUTOSAR系统底层借助的DDS和ROS底层的ros_comm是完全两种不同的通信中间件,如上所述的发送消息的对象与接收消息的对象的匹配和数据传输机制不同,它们是天然不能兼容在一起的,所以解决它们的兼容,是解决ROS与AUTOSAR互通的核心。具体涉及到如下几个兼容问题:
问题1、两个不同软件架构的发送消息的对象与接收消息的对象如何匹配。
问题2、两者发布订阅模型不同,收发接口不同,如何成功发送消息和成功接收消息。
问题3、两者消息类型不一致,存在序列化的差异。
问题4、AUTOSAR系统包括消息过滤功能和通过QoS保障消息传输的可靠性、实时性等功能,如何让ROS也可以感知这些功能。
基于此本申请实施例提出了如下技术方案:
方案一,基于代理模式实现AUTOSAR系统与ROS的互通方案。
基于代理模式实现AUTOSAR系统与ROS的互通,让中间的代理装置作为AUTOSAR系统与ROS通信的媒介,分别与AUTOSAR系统和ROS进行沟通,然后作为翻译者,负责两者消息解析、消息转化和运行逻辑兼容,从而打通AUTOSAR系统与ROS的通信。这种方式中,AUTOSAR系统与ROS可以不需做改变。
如图11所示,为本申请实施例提供的一种基于代理模式实现AUTOSAR系统与ROS的互通方案的系统架构示意图。在图11中,AUTOSAR系统91与代理装置92连接,代理装置92与ROS93连接。
作为示例,代理装置92包括一个子模块920用于实现AUTOSAR系统91中事件模式与ROS93中主题模式的打通;再一个子模块921用于实现AUTOSAR系统91中方法模式与ROS93中服务/请求模式的打通;还一个子模块922用于实现AUTOSAR系统91中参数模式与ROS93中参数模式的打通。每个子模块包括发送消息和/或接收消息的对象。
代理装置92中每个子模块可以接收AUTOSAR系统91中通信模块911发送的消息,并将该消息转换为ROS93中通信模块931能够识别的消息格式,然后向ROS93中通信模块931发送格式转换后的消息。也可以接收ROS93中通信模块931发送的消息,并将该消息转换为AUTOSAR系统91中通信模块911能够识别的消息格式;向AUTOSAR系统91中通信模块911发送格式转换后的消息。
对于AUTOSAR系统91中应用模块910的应用程序来说,代理装置92就是它对端另一个AUTOSAR系统91中的应用程序。它们的通信,在底层遵循DDS的通信逻 辑,即调用DDS的通信逻辑、读写接口、消息类型、实现消息过滤,使用QoS保障消息传输的可靠性、实时性,从而实现两边的对象的匹配与消息传输。以解决上述问题4。同样地,对于ROS93中应用模块930的应用程序来说,代理装置92就是它对端另一个ROS93的应用程序。它们的通信,在底层遵循ros_comm的通信逻辑,即调用ros_comm的通信逻辑,发布接口和订阅接口和消息类型,从而实现两边的对象的匹配与消息传输,以解决上述问题1和上述问题2。
代理装置92在底层收到两边的消息后,消息传递给代理装置92的上层,上层将起到实际翻译者的作用。它将一边的数据解析出来,并转化为另一边可以识别的样式,最后使用另一边的通信逻辑,将数据转发出去,以解决上述问题3。
需要说明的是,基于代理模式实现AUTOSAR系统与ROS的互通方案的系统架构中的代理装置、AUTOSAR系统或ROS中的多个可以集成在一个设备中,也可以各自独立存在于一个设备中。本申请对此不进行限制。
方案二,基于直通模式实现AUTOSAR系统与ROS的互通方案。
基于直通模式实现AUTOSAR系统与ROS的互通,使AUTOSAR系统与ROS拥有相同的底层基础通信模块。以下以AUTOSAR系统不变,在ROS底层引入DDS基础通信模块,做到与AUTOSAR的底层通信对等为例进行说明。在ROS底层引入DDS基础通信模块以解决上述问题1,在ROS中间加入一层DDS结合层(DDS broker layer)。其中,DDS结合层用于实现:
1.ROS沟通模式层调用DDS的接口收发消息,以解决上述问题2。
2.ROS应用模块消息格式向AUTOSAR系统应用模块消息格式的转换,或其相反的过程,以解决上述问题3。
3.AUTOSAR的通信逻辑实现,如消息过滤、QoS控制消息的接收或者发送等,以解决上述问题4。
需要说明的是,基于直通模式实现AUTOSAR系统与ROS的互通,使AUTOSAR系统与ROS拥有相同的底层基础通信模块。AUTOSAR系统不变,若ROS版本为ROS2.0,ROS2.0中本身底层已经包含了DDS基础通信模块,因此只需要将上述DDS结合层中在ROS2.0中没有的逻辑加入ROS2.0的中间件层(ros middleware,RMW)。其中,ROS2.0中的中间件层可以实现上述ROS1.0中的ros_comm所实现的功能。不再赘述。
如图12所示,为本申请中基于直通模式实现AUTOSAR系统与ROS的互通方案的系统架构示意图。该系统中AUTOSAR系统10与ROS11连接。
AUTOSAR系统10包括应用模块101和通信模块102。其中,应用模块101包括应用程序(如规控和执行等)。通信模块102包括沟通模式层1021、结合层1022和DDS1023。通信模块102包括发送消息和/或接收消息的对象、应用程序的收发接口,用于底层数据的传输。
ROS11包括应用模块111和通信模块112。应用模块111包括应用程序(如感知、计算、融合等)。通信模块112包括DDS1123、结合层1122和沟通模式层1121。DDS1123包括发送消息和/或接收消息的对象、应用程序的收发接口,用于底层数据的传输。
AUTOSAR系统10的通信模块102通过DDS1023与ROS11的通信模块112的 DDS1123连接。
结合层1122用于将DDS1123接收到的AUTOSAR系统10中的多种消息沟通模式的消息,转换为ROS11中应用模块111能够识别的多种沟通模式的消息。结合层1122包括一个子模块用于将AUTOSAR系统10应用模块101能够识别的事件模式的消息转换为ROS11中应用模块111能够识别的主题模式的消息,再一个子模块用于将AUTOSAR系统10中应用模块101能够识别的方法模式的消息转换为ROS11中应用模块111能够识别的服务/请求模式的消息,还一个子模块用于将AUTOSAR系统10应用模块101能够识别的参数模式的消息转换为ROS11中应用模块111能够识别的参数模式的消息。
以下,结合实施例详细说明基于代理模式实现AUTOSAR系统与ROS的互通。基于代理模式实现AUTOSAR系统与ROS的互通包括:初始化阶段、服务发现阶段和消息通信阶段。以下,分别对这几个阶段进行说明:
初始化阶段
AUTOSAR系统中应用程序进程与ROS中应用程序进程创建完毕之后,AUTOSAR系统中通信模块包括其应用程序进程的域参与者、发布者、订阅者、数据写入者和/或数据读取者。ROS中通信模块包括其应用程序进程的发布者和/或订阅者。
当AUTOSAR系统中应用程序的进程的消息沟通模式包括事件模式时,第一代理模块初始化完成后,第一代理模块包括与AUTOSAR系统中通信模块主题和实例标识符相同且QoS兼容的域参与者、发布者、订阅者、数据写入者和/或数据读取者。
当AUTOSAR系统中应用程序的进程的消息沟通模式包括方法模式时,第一代理模块初始化完成后,第一代理模块包括与AUTOSAR系统中通信模块方法标识符和实例标识符相同且QoS兼容的域参与者、发布者、订阅者、数据写入者和/或数据读取者。
当AUTOSAR系统中应用程序的进程的消息沟通模式包括参数模式时,第一代理模块初始化完成后,第一代理模块包括与AUTOSAR系统中通信模块方法标识符、参数标识符和实例标识符相同且QoS兼容的域参与者、发布者、订阅者、数据写入者和/或数据读取者。
当ROS中应用程序的进程的消息沟通模式包括主题模式时,第二代理模块初始化完成后,第二代理模块包括与ROS中通信模块主题相同的发布者和/或订阅者。
当ROS中应用程序的进程的消息沟通模式包括服务/请求模式时,第二代理模块初始化完成后,第二代理模块包括与ROS中通信模块服务/请求标识符相同的发布者和/或订阅者。
当ROS中应用程序的进程的消息沟通模式包括参数模式时,第二代理模块初始化完成后,第二代理模块包括与ROS中通信模块服务/请求标识符和参数标识符相同的发布者和/或订阅者。
本申请实施例对代理装置中主题、实例标识符、QoS、方法标识符、服务/请求标识符、AUTOSAR系统中参数标识符和ROS中参数标识符等信息的获取方式不进行限制,例如,代理装置可以通过获取配置文件获取上述信息,或者代理装置接收AUTOSAR系统和/或ROS发送的上述信息。
本申请实施例对自动驾驶系统或辅助自动驾驶系统初始化的触发条件不进行限 制,例如,自动驾驶系统或辅助自动驾驶系统上电后,完成初始化。或者,自动驾驶系统或辅助自动驾驶系统接收用户的指示,并按照用户的指示完成初始化。
服务发现阶段
服务发现阶段包括实施例一中AUTOSAR系统与代理装置的服务发现流程;以及实施例二中代理装置与ROS的服务发现流程。
实施例一
如图13所示,为本申请实施例提供的一种AUTOSAR系统与代理装置服务发现方法的流程示意图。示例性的,本实施例可以应用于图11所示的系统架构。图13所示的方法可以包括以下步骤:
S100:AUTOSAR系统向代理装置发送第一数据。
具体的,AUTOSAR系统中第一数据写入者向代理装置中的第一数据读取者发送主题为参与者数据(participant data)的第一数据。第一数据包括第一域参与者的标识符、网络地址、采用的QoS、实例标识符等信息。第一数据写入者为AUTOSAR系统中预置的用于域参与者服务发现的数据写入者,第一数据读取者为代理装置中预置的用于域参与者服务发现的数据读取者。第一域参与者是AUTOSAR系统中任意一个已创建的域参与者。
S101:代理装置判断第一数据中的QoS是否与代理装置中已创建的域参与者的QoS兼容。若否,则结束;若是,则执行S102。
S102:代理装置将第一数据添加至本地信息库。
S103:代理装置向AUTOSAR系统发送第二数据,第二数据包括第二域参与者的标识符、网络地址、采用的QoS、实例标识符等信息。第二域参与者是代理装置已创建的一个域参与者,且第二域参与者的QoS与第一域参与者的QoS兼容。
S104:AUTOSAR系统将第二数据添加至本地信息库。
至此,AUTOSAR系统与代理装置交换了彼此的DDS域参与者信息,并记录在本地信息库中,域参与者自动发现过程结束。
可替换地,由代理装置向AUTOSAR系统发送第二数据,AUTOSAR系统判断第二数据中的QoS是否与AUTOSAR系统中创建的域参与者的QoS兼容。若兼容,则存储第二数据至本地信息库后,并向代理装置发送第一数据,代理装置存储第一数据至本地信息库。本申请实施例对AUTOSAR与代理装置发现对方的顺序不进行限定。
S105:AUTOSAR系统向代理装置发送第二数据写入者的描述信息(标记为第一描述信息)。其中,第二数据写入者是AUTOSAR系统中的数据写入者中除第一数据写入者之外的任意一个数据写入者。第一描述信息包括第二数据写入者写入的数据的主题、采用的QoS、实例标识符等信息。
具体的,AUTOSAR系统中的发布者数据写入者向代理装置中的订阅者数据读取者发送第一描述信息。
S106:代理装置获取与第二数据写入者相匹配的第二数据读取者。其中,第二数据读取者是代理装置中与第二数据写入者匹配的任意一个数据读取者。
S107:代理装置将第二数据写入者与第二数据读取者的匹配关系添加至本地信息库,即建立第二数据写入者与第二数据读取者之间的数据链路。
可选的,当第二数据写入者的QoS改变或第二数据写入者被删除时,AUTOSAR系统可以向代理装置发送消息,用于代理装置实时更新本地信息库中的匹配关系。
可替换的,代理装置可以向AUTOSAR系统发送数据读取者的描述信息,
AUTOSAR系统如果查询到与第二数据读取者匹配的数据写入者,则将该数据读取者和该数据写入者的匹配关系添加至本地信息库。当与域参与者关联的数据写入者/数据读取者的QoS生变化或数据写入者/数据读取者被删除时,AUTOSAR系统也会向与其匹配的代理装置中的域参与者发送信息,用于与其匹配的域参与者实时更新本地信息库。
上述S100~S107为AUTOSAR系统中的数据写入者与代理装置中的数据读取者的匹配过程。同样的,AUTOSAR系统中的数据读取者与代理装置中的数据写入者的匹配过程与此类似,不再赘述。
需要说明的是,S100~S107中的AUTOSAR系统与代理装置服务发现的过程,可以是现有技术中的其他方法,本申请对此不作限定。
实施例二
如图14所示,为本申请实施例提供的一种代理装置与ROS服务发现方法的流程示意图。示例性的,本实施例可以应用于图11所示的系统架构。图14所示的方法可以包括以下步骤:
S200:代理装置中的第一发布者向ROS中的主节点发送第一发布者信息。第一发布者信息包括第一发布者发布的消息的主题。
其中,第一发布者是代理装置中的任意一个发布者。ROS中的主节点为ROS中的应用程序的进程。可选的,第一发布者信息还可以包括第一发布者信息发布的消息的消息格式、地址或端口等中的至少一项。
S201:ROS中的主节点将第一发布者信息存储至本地信息库。
S202:ROS中的主节点获取与第一发布者匹配的第一订阅者。第一订阅者是ROS中的任意一个与第一发布者信息包括的主题相同的订阅者。
具体的,ROS中的主节点首先获取本地任意一个订阅者的订阅者信息;其次,判断该订阅者信息中订阅的消息的主题与第一发布者信息中的主题相同是否相同。若相同,则ROS主节点将该订阅者作为第一订阅者,并获取第一订阅者信息。第一订阅者信息包括第一订阅者订阅的消息的主题。可选的,第一订阅者信息还包括第一订阅者订阅的消息的消息格式、地址和端口等。若不相同,则ROS主节点获取主节点中的另一个订阅者的订阅者信息,并判断该订阅者信息中订阅的消息的主题与第一发布者信息中的主题是否相同。依此类推,直至遍历完ROS主节点中所有订阅者。
S203:ROS中的主节点向ROS中的第一订阅者发送第一发布者信息。
S204:ROS中的第一订阅者将第一发布者信息存至本地信息库。
S205:ROS中的第一订阅者向代理装置中的第一发布者发送第一订阅者信息。
S206:代理装置中的第一发布者存储第一订阅者信息至本地信息库。
S207:代理装置中的第一发布者向ROS中的第一订阅者发送响应消息。
至此,代理装置中的第一发布者与ROS中的第一订阅者建立了发布订阅关系。
ROS主节点可以将ROS主节点中所有订阅者信息中订阅的消息的主题与第一发 布者信息中的主题相同的订阅者作为第一订阅者,执行S203-S207。代理装置中的每一个发布者都可以通过上述方法找到与之匹配订阅者,并将与之匹配的订阅者的信息存储至本地信息库。
可替换的,ROS中的发布者可以向ROS中的主节点发送发布者信息,代理装置中的订阅者向ROS中的主节点发送订阅者信息,以完成代理装置中的订阅者与ROS中的发布者的服务发现。代理装置与ROS的服务发现还可采用现有技术实现,本申请实施例对此不进行限制。
AUTOSAR系统与代理装置的服务发现完成之后,数据写入者与数据读取者之间建立了数据链路,此时,AUTOSAR系统与代理装置之间就可以进行业务数据的消息通信。代理装置与ROS之间服务发现完成之后,发布者与订阅者之间建立了发布订阅关系,此时,代理装置与ROS之间就可以进行业务数据的消息通信。
需要说明的是,上述的ROS主节点为一个应用程序的进程,可以在代理装置中,也可以在ROS中。本申请实施例对此不进行限制。
上述为ROS1.0中的发布者与订阅者的服务发现过程,在ROS2.0中没有ROS主节点,ROS2.0中发布者向订阅者发送发布者信息,订阅者判断接收到的发布者信息是否与自身的主题相匹配,若匹配,则存储发布者信息至本地信息库;并向发布者发送订阅者信息。发布者存储与之匹配的订阅者信息至本地信息库。至此,发布者与订阅者建立发布订阅关系。可替换的,ROS中的订阅者可以向发布者发送订阅者信息,发布者判断接收到的订阅者信息是否与自身的主题相匹配,若匹配,则存储订阅者信息至本地信息库;并向订阅者发送发布者信息。订阅者存储与之匹配的发布者信息至本地信息库,以完成订阅者与发布者的服务发现。
消息通信阶段
实施例三
如图15所示,为本申请实施例提供的基于代理模式实现AUTOSAR系统与ROS消息通信方法中AUTOSAR系统通过代理装置向ROS发送消息的方法的流程示意图。示例性的,本实施例可以应用于图11所示的系统架构。图15所示的方法可以包括以下步骤:
S300:AUTOSAR系统生成消息1。具体的,AUTOSAR系统中的应用模块生成消息1。消息1的格式是能够被AUTOSAR系统的应用模块识别的格式。
当消息1是事件模式的消息时,消息1可以包括事件、实例标识符、消息内容等。其中,事件为主题用于找到消息接收者,实例标识符指示产生消息1的应用程序的进程。消息内容为发送的具体信息。
当消息1是方法或参数模式的消息时,消息1可以包括第一消息标识符、实例标识符等。第一消息标识符包括方法标识符和/或参数标识符。示例性的,第一消息标识符包括:指示SET方法的方法标识符、指示某个参数的参数标识符等。其中,方法标识符和/或参数标识符为主题,用于找到消息接收者。实例标识符指示产生消息1的应用程序的进程。
S301:AUTOSAR系统利用第一序列化函数将消息1序列化为消息2。序列化是将消息转换为可以传输的形式。消息2的格式是能够被AUTOSAR系统的通信模块识 别的格式。
具体的,AUTOSAR系统中的应用模块调用DDS的写接口向通信模块的DDS发送消息1。通信模块利用第一序列化函数将消息1序列化为消息2。
S302:AUTOSAR系统向代理装置发送消息2。
具体的,AUTOSAR系统中通信模块的DDS的第一对象通过写接口发送消息2。其中,第一对象是消息1通过DDS时,DDS为消息1分配的数据写入者。
当消息1是事件模式的消息时,第一对象的主题与消息1中的事件相同,第一对象的实例标识符与消息1中的实例标识符相同。
当消息1是方法或参数模式的消息时,第一对象的主题与消息1中的方法标识符和/或参数标识符相同,第一对象的实例标识符与消息1中的实例标识符相同。
S303:代理装置利用第一序列化函数将消息2反序列化为消息3。消息3的格式是能够被AUTOSAR系统中应用模块识别的格式。其中,反序列化是与序列化相反的过程。
S304:代理装置根据消息3中的实例标识符对消息3进行过滤。
具体的,代理装置将消息3分配给第二对象,其中,第二对象为代理装置中与第一对象匹配的数据读取者,第二对象的实例标识符与消息3中的实例标识符相同。从而实现了代理装置将与第二对象的实例标识符不同的消息进行过滤。
S305:代理装置将消息3转换为消息4,其中,消息4的格式是能够被ROS的应用模块识别的格式。具体的:
代理装置中的第二对象通过DDS读接口读取消息3。然后,执行以下步骤:
当消息3中的第一消息标识符包括方法标识符时,代理装置根据预存的“AUTOSAR系统中的方法标识符与ROS中的服务/请求标识符”的对应关系,获取与第一消息标识符中的方法标识符对应的服务/请求标识符。消息4中包括第二消息标识符,第二消息标识符包括ROS中服务/请求标识符。
示例性的,AUTOSAR系统中的方法标识符与ROS中服务/请求标识符的对应关系如表1所示:
表1
AUTOSAR系统中的方法标识符 ROS中服务/请求标识符
110 2210
120 2220
130 2230
140 2240
基于表1中的示例,如果消息3中的方法标识符为110,那么,消息4中包括的服务/请求标识符为2210。
可以理解的是,表1中方法标识符与服务请求标识符仅为一种示例,实际使用时,方法标识符可以是方法的名称,服务请求标识符可以是服务/请求的名称。
当消息3中的第一消息标识符包括参数标识符时,代理装置根据“AUTOSAR系统中的参数标识符与ROS中的参数标识符”的对应关系,获取与第一消息标识符中的参数标识符对应的参数标识符。代理装置对消息3进行格式转换生成的消息4中包括第 二消息标识符。第二消息标识符包括ROS中的参数标识符。
示例性的,AUTOSAR系统中的参数标识符与ROS中的参数标识符的对应关系如表2所示:
表2
AUTOSAR系统中的参数标识符 ROS中的参数标识符
AUTOSAR系统参数标识符1 ROS参数标识符1
AUTOSAR系统参数标识符2 ROS参数标识符2
基于表1与表2中的示例,如果第一消息标识符中的方法标识符为130,该方法标识符指示set方法,那么对应的ROS中的服务/请求标识符为2230,第一消息标识符中的第一参数标识符为:AUTOSAR系统参数标识符1。第二消息标识符中的参数标识符为:ROS参数标识符1。
S306:代理装置利用第二序列化函数将消息4序列化为消息5。消息5的格式是能够被ROS的通信模块识别的格式。
需要说明的是,在实际实施过程中S305与S306可以集成在一个步骤,也可以分开单独的步骤,本申请对此不进行限制。
S307:代理装置向ROS发送消息5。具体的,代理装置中的第二对象将消息5发送给代理装置中的第三对象。第三对象利用ROS发布接口向ROS发送消息5。第三对象是代理装置中的发布者。
当消息5是主题模式的消息时,第三对象发布的消息的主题与消息5的主题相同。
当消息5是服务/请求或参数模式的消息时,第三对象发布的消息的主题与消息5中的服务/请求标识符或参数标识符相同。
S308:ROS利用第二序列化函数将消息5反序列化为消息6,消息6的格式是能够被ROS的应用模块识别的格式。
S309:ROS将消息6分配给第四对象,第四对象从ROS的订阅接口读取消息6。其中,第四对象是与第三对象匹配的ROS中的订阅者。
需要说明的是,当消息6不包括第二消息标识符时,ROS执行完S309,并根据消息6进行动作(如修改ROS中的配置)或者不动作,然后结束。当消息6包括第二消息标识符时,ROS执行完S309,再执行S310。
S310:ROS根据消息6中第二消息标识符中的服务/请求标识符,提供该标识符指示的服务/请求。
示例性的,第二消息标识符中包括的服务/请求标识符指示set请求,第二消息标识符中包括的ROS参数标识符1指示参数1。ROS根据该服务/请求标识符的指示设置参数1的值。
S311:ROS获取第二消息标识符中的服务/请求标识符指示的服务/请求的执行结果1。
基于S310中的示例,执行结果1包括:ROS设置的参数1的值为Y。
至此,S300~S309实现了AUTOSAR系统通过代理装置向ROS发送消息。
本实施例中,AUTOSAR系统通过代理装置向ROS发送消息时,代理装置可以根据实例标识符过滤该消息,并转换为ROS可以识别的格式,实现了AUTOSAR系统与 ROS的多种模式的消息通信(包括事件/主题模式、方法/服务请求模式、参数模式等)。同时,可以兼顾AUTOSAR系统中的服务选择,可以使用QoS保障消息传输的可靠性和实时性。
后续,ROS可以通过代理装置向AUTOSAR系统发送执行结果1。具体,可以参考以下实施例四中的ROS通过代理装置向AUTOSAR系统发送消息的方法。
实施例四
如图16所示,为本申请实施例提供的基于代理模式实现AUTOSAR系统与ROS消息通信方法中ROS通过代理装置向AUTOSAR系统发送消息的方法流程示意图。示例性的,本实施例可以应用于图11所示的系统架构。图16所示的方法可以包括以下步骤:
S400:ROS生成消息7。具体的,ROS中的应用模块生成消息7。消息7的格式是能够被ROS的应用模块识别的格式。
当消息7是主题模式的消息时,消息7可以包括主题、消息内容等。其中,主题用于找到订阅者。消息内容为发送的具体信息。
当消息7是服务/请求模式或参数模式的消息时,消息7可以包括第一消息标识符。第一消息标识符包括服务/请求标识符和/或参数标识符。示例性的,第一消息标识符包括:指示SET请求的服务/请求标识符、指示某个参数的参数标识符等。其中,服务/请求标识符和/或参数标识符为主题,用于找到订阅者。
S401:ROS利用第二序列化函数将消息7序列化为消息8。其中,序列化是将消息转换为可以传输的形式。消息7的格式是能够被ROS的通信模块识别的格式。
具体的,ROS中的应用模块调用通信模块的发布接口向通信模块的ros_comm发送消息7。通信模块的ros_comm利用第二序列化函数将消息7序列化为消息8。
S402:ROS向代理装置发送消息8。
具体的,ROS中通信模块的DDS的第五对象利用发布接口向代理装置发送消息8。其中,第五对象是发布的消息的主题与消息8的主题相同的发布者。
S403:代理装置利用第二序列化函数将消息8反序列化为消息9。消息9的格式是能够被ROS应用模块识别的格式。其中,反序列化是与序列化相反的过程。
S404:代理装置将消息9分配给第六对象,第六对象从ROS的订阅接口读取消息9,第六对象是与第五对象匹配的订阅者。
S405:代理装置将消息9转换为消息10。消息10的格式是能够被AUTOSAR系统的应用模块识别的格式。
当消息9包括ROS中的参数标识符时,代理装置根据AUTOSAR系统中的参数标识符与ROS中的参数标识符的对应关系,获取ROS中的参数标识符对应的AUTOSAR系统中的参数标识符。代理装置将消息9转换为的消息10包括所获取的AUTOSAR系统中的参数标识符。
当消息9包括ROS中的服务/请求标识符时,代理装置根据AUTOSAR系统中的方法标识符与ROS中的服务/请求标识符的对应关系,获取ROS中的服务/请求标识符对应的AUTOSAR系统中的方法标识符。代理装置将消息9转换为的消息10包括所获取的AUTOSAR系统中的方法标识符。
S406:代理装置中的第六对象向第七对象发送消息10。其中,第七对象是一个数据写入者,且写入数据的主题与消息10的主题相同。
S407:代理装置将配置的实例标识符添加至消息10,得到消息11。其中,该实例标识符指示产生消息7的应用程序的进程。
需要说明的是S407是可选的,当消息10包括配置的实例标识符时,则不用执行S407。
S408:代理装置利用第一序列化函数将消息11序列化为消息12。
S409:代理装置向AUTOSAR系统发送消息12。
具体的,代理装置中的第七对象通过DDS写接口向AUTOSAR系统发送消息12。
后续,AUTOSAR系统利用第一序列化函数反序列化消息12得到消息13,并将消息13分配给第八对象,第八对象是与第七对象匹配的数据读取者。第八对象通过DDS读接口读取消息13,消息13是能够被AUTOSAR系统应用模块识别的消息格式。
本实施例中,ROS系统通过代理装置向AUTOSAR系统发送消息时,代理装置可以将该消息转换为AUTOSAR系统可以识别的格式,并将实例标识符添加至发送给AUTOSAR系统的消息中,实现ROS与AUTOSAR系统的多种模式的消息通信(包括事件/主题模式、方法/服务请求模式、参数模式等)。同样,可以兼顾AUTOSAR系统中的服务选择,可以使用QoS保障消息传输的可靠性和实时性。
以下,结合实施例详细说明基于直通模式实现AUTOSAR系统与ROS的互通。基于直通模式实现AUTOSAR系统与ROS的互通同样包括:初始化阶段、服务发现阶段和消息通信阶段。
初始化阶段
AUTOSAR系统中应用程序进程与ROS中应用程序进程创建完毕之后,AUTOSAR系统中通信模块包括其应用程序进程的域参与者、发布者、订阅者、数据写入者和/或数据读取者。ROS中通信模块包括其应用程序进程的发布者和/或订阅者。
当AUTOSAR系统中应用程序的进程的消息沟通模式包括事件模式时,ROS底层数据分发服务初始化完成后,包括与AUTOSAR系统中通信模块主题和实例标识符相同且QoS兼容的域参与者、发布者、订阅者、数据写入者和/或数据读取者。
当AUTOSAR系统中应用程序的进程的消息沟通模式包括方法模式时,ROS底层数据分发服务初始化完成后,包括与AUTOSAR系统中通信模块方法标识符和实例标识符相同且QoS兼容的域参与者、发布者、订阅者、数据写入者和/或数据读取者。
当AUTOSAR系统中应用程序的进程的消息沟通模式包括参数模式时,ROS底层数据分发服务初始化完成后,包括与AUTOSAR系统中通信模块参数标识符和实例标识符相同且QoS兼容的域参与者、发布者、订阅者、数据写入者和/或数据读取者。
本申请实施例对ROS通信模块转换层中实例标识符的获取方式不进行限制,例如ROS通信模块转换层可以通过获取配置文件获取实例标识符,或者ROS通信模块转换层接收AUTOSAR系统和/或ROS应用模块发送的实例标识符。
本申请实施例对自动驾驶系统或辅助自动驾驶系统初始化的触发条件不进行限制,例如,自动驾驶系统或辅助自动驾驶系统上电后,完成初始化。或者,自动驾驶系统或辅助自动驾驶系统接收用户的指示,并按照用户的指示完成初始化。
服务发现阶段
实施例五
AUTOSAR系统中的数据写入者与ROS中的数据读取者服务发现方法流程可以参考实施例一中S100~S108中的AUTOSAR系统中的数据写入者与代理装置中的数据读取者的服务发现过程,也可以参考现有技术中的其他方法,本申请对此不作限定。不再赘述。
AUTOSAR系统与ROS的服务发现完成之后,数据写入者与数据读取者之间建立了数据链路,此时,AUTOSAR系统与ROS之间就可以进行业务数据的消息通信。
消息通信阶段
具体参考实施例六中基于直通模式实现AUTOSAR系统与ROS的互通中的消息通信方法流程。
实施例六
如图17所示,为本申请实施例提供的一种基于直通模式实现AUTOSAR系统与ROS消息通信方法的流程示意图。本实施例可以应用于图12所示的系统架构。图17所示的方法可以包括以下步骤:
S500~S502:可以参考上述S300~S302,当然不限于此。
S503:ROS利用第一序列化函数将消息2反序列化为消息3。消息3的格式是能够被AUTOSAR系统中应用模块识别的格式。
S504:ROS根据消息3中的实例标识符对消息3进行过滤。
具体的,ROS将消息3分配给第二对象,其中,第二对象为ROS通信模块底层DDS中与第一对象匹配的数据读取者。第二对象的实例标识符与消息3中的实例标识符相同。从而实现了ROS将与第二对象的实例标识符不同的消息进行过滤。
S505:ROS将消息3转换为消息4。消息4的格式是能够被ROS应用模块识别的格式。
具体的,参考实施例三中的S305,将S305中的执行主体“代理装置”替换为“ROS通信模块的转换层”。
当消息4不包括第二消息标识符时,执行完S505,ROS通信模块的转换层将消息4发送给ROS的应用模块。然后结束。当消息4包括第二消息标识符时,执行完S505,执行S506。
S506:ROS根据消息4中的第二消息标识符,提供该标识符中指示的服务/请求。
具体的,当ROS通信模块的转换层将消息4发送给ROS的应用模块后,ROS的应用模块根据消息4中的服务/请求标识符,提供该标识符指示的服务/请求。
示例性的,如果第二消息标识符中包括的服务/请求标识符指示get请求,第二消息标识符中包括的ROS参数标识符指示参数1。ROS根据该服务/请求的指示获取参数1的值。
S507:ROS获取ROS提供的服务/请求的执行结果1。执行结果1的格式为能够被ROS应用模块识别的格式。后续,ROS可以向AUTOSAR系统发送执行结果1。
基于S506中的示例,执行结果1包括:ROS获取的参数1的值为Y。
至此,S500~S505实现了AUTOSAR系统向ROS发送消息。
本实施例中,AUTOSAR系统向ROS发送消息时,ROS中增加的DDS与转换层可以实现对AUTOSAR系统中消息的过滤,并转换为ROS可以识别的格式,实现了AUTOSAR系统与ROS的多种模式的消息通信(包括事件/主题模式、方法/服务请求模式、参数模式等)。同时,可以兼顾AUTOSAR系统中的服务选择,可以使用QoS保障消息传输的可靠性和实时性。
实施例七
如图18所示,为本申请实施例提供的另一种基于直通模式实现AUTOSAR系统与ROS消息通信方法的流程示意图。示例性的,本实施例可以应用于图12所示的系统架构。图18所示的方法可以包括以下步骤:
S600:ROS生成消息5。消息5的格式是能够被ROS的应用模块识别的格式。
具体的,消息5的解释参考实施例四中S400,不再赘述。
S601:ROS将消息5转换为消息6。消息6的格式是能够被AUTOSAR系统应用模块识别的格式。
具体的,ROS应用模块向通信模块的转换层发送消息5。ROS通信模块的转换层将消息5转换为消息6参考实施例四中S405的方法,此处不再赘述。
S602:ROS将配置的实例标识符添加至消息6,得到消息7。其中,该实例标识符指示产生消息5的应用程序的进程。
需要说明的是,S602是可选的,当消息6包括配置的实例标识符时,不需要执行S602。
S603:ROS利用第一序列化函数将消息7序列化为消息8。消息8的格式是能够被AUTOSAR系统通信模块识别的格式。
S604:ROS向AUTOSAR系统发送消息8。
具体的,ROS中的第一对象调用DDS的写接口向AUTOSAR系统发送消息8。第一对象是ROS中的任意一个数据写入者,且该数据写入者写入数据的主题与消息8中的主题相同,实例标识符相同。
S605:AUTOSAR系统利用第一序列化函数将消息8反序列化为消息9。消息9的格式是能够被AUTOSAR系统应用模块识别的格式。
S606:AUTOSAR系统根据消息9中的实例标识符对消息9进行消息过滤。具体的,AUTOSAR系统将消息9分配给第二对象。第二对象是AUTOSAR系统中与第一对象匹配的数据读取者。第二对象的实例标识符与消息9中的实例标识符相同。从而实现了ROS将与第二对象的实例标识符不同的消息进行过滤。
后续,AUTOSAR系统的通信模块向AUTOSAR系统的应用模块的消息9中实例标识符指示的应用程序进程发送消息9。应用程序进程根据消息9做出相应的动作。例如:AUTOSAR系统中的应用程序进程收到消息9中AUTOSAR系统中参数1的值为Y,AUTOSAR系统中参数1指示是否开启雾灯,AUTOSAR系统根据该参数的值为Y开启雾灯。
当消息9不包括方法标识符时,执行完S606然后结束。当消息9包括方法标识符时,执行完S606,AUTOSAR系统获取执行结果,执行AUTOSAR系统向ROS发送执行结果。具体过程参考实施例五中的S500~S505中的步骤,不再赘述。
本实施例中,ROS向AUTOSAR系统发送消息时,ROS系统中增加的DDS与转换层可以实现将ROS通信模块的沟通模式层可以识别的消息格式转换为AUTOSAR系统通信模块的沟通模式层可以识别的消息格式,并添加实例标识符然后转换为AUTOSAR系统DDS可以传输的格式,实现了AUTOSAR系统与ROS的多种模式的消息通信(包括事件/主题模式、方法/服务请求模式、参数模式等)。同时,可以兼顾AUTOSAR系统中的服务选择,可以使用QoS保障消息传输的可靠性和实时性。
上述主要从方法的角度对本申请实施例提供的方案进行了介绍。为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的方法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据上述方法示例对代理装置进行功能模块的划分,例如可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
如图19所示,为本申请实施例提供的一种代理装置的结构示意图。该代理装置50可以用于执行上文中任意一个实施例(如图13~图16所示的实施例)中代理装置所执行的功能。代理装置50应用于自动驾驶系统或辅助自动驾驶系统,该自动驾驶系统或辅助自动驾驶系统还包括:第一计算机系统和第二计算机系统。代理装置50可以包括:第一代理模块501和第二代理模块502。其中,第一代理模块501用于接收第一计算机系统发送的第一消息。其中,第一消息的格式是第一计算机系统能够识别的格式,将第一消息转换为第二消息,第二消息的格式是第二计算机系统能够识别的格式。第二代理模块502,用于向第二计算机系统发送第二消息。例如结合图13,第一代理模块501可以用于执行S100、S105中的接收步骤,S101~S102、S103中的发送步骤,S106~S107。结合图14第二代理模块502可以用于执行S200、S207中的发送步骤,S205中的接收步骤,S206。结合图15第一代理模块501可以用于执行S302中的接收步骤,S303~S304。第二代理模块502可以用于执行S305~S306,S307中的发送步骤。结合图16第二代理模块502可以用于执行S402中的接收步骤,S403~S404。第一代理模块501可以用于执行S405~S408,S409中的发送步骤。
可选的,第一计算机系统包括AUTOSAR系统,且第二计算机系统包括ROS。或者,第一计算机系统包括ROS,且第二计算机系统包括AUTOSAR系统。
可选的,第一计算机系统包括的第一对象发送的消息的主题,与代理装置50包括的第二对象接收的消息的主题相同。第一对象是第一计算机系统中发送消息的发送者,第二对象是代理装置50中的接收消息的接收者。第一对象发送的消息包括第一消息。代理装置50包括的第三对象发送的消息的主题,与第二计算机系统包括的第四对象接收的消息的主题相同。第三对象是代理装置50中发送消息的发送者,第四对象是第二 计算机系统中接收消息的接收者。第三对象发送的消息包括第二消息。
可选的,第一计算机系统包括AUTOSAR系统,且第二计算机系统包括ROS,第一代理模块501与AUTOSAR系统的通信模块支持的消息格式相同。第二代理模块502与ROS的通信模块支持的消息格式相同。或者,第一计算机系统包括ROS,且第二计算机系统包括AUTOSAR系统,第一代理模块501与ROS的通信模块支持的消息格式相同。第二代理模块502与AUTOSAR系统的通信模块支持的消息格式相同。
可选的,第一计算机系统包括AUTOSAR系统且第二计算机系统包括ROS,第一对象所使用的QoS与第二对象所使用的QoS兼容。
可选的,第一消息是远程过程调用RPC模式的消息或参数模式的消息,第一消息包括第一消息标识符。第一消息标识符包括方法标识符和/或参数标识符。第一代理模块501还用于,根据第一计算机系统能够识别的消息标识符与第二计算机系统能够识别的消息标识符的对应关系,确定第一标识符对应的第二消息标识符。第二消息包括第二消息标识符,第二消息标识符包括方法标识符和/或参数标识符。
可选的,第一代理模块501包括第一读接口和第一写接口,第一读接口与第一计算机系统的读接口相同,第一写接口与第一计算机系统的写接口相同。第一代理模块501具体用于:利用第一读接口接收第一计算机系统写接口发送的第一消息。
可选的,第二代理模块502包括第二读接口和第二写接口。第二读接口与第二计算机系统的读接口相同,第二写接口与第二计算机系统的写接口相同。第二代理模块502具体用于:利用第二写接口向第二计算机系统的读接口发送第二消息。
可选的,第一计算机系统包括AUTOSAR系统,且第二计算机系统包括ROS。第一代理模块501还用于,对第一消息进行过滤。第一代理模块501具体用于,将过滤后的第一消息转换为第二消息。
可选的,第一计算机系统包括ROS,第二计算机系统包括AUTOSAR系统,且第二消息不包括实例标识符。第一代理模块501具体用于,将实例标识符添加至第二消息,其中,实例标识符用于AUTOSAR系统确定第四对象。
在一个示例中,参见图3,上述第一代理模块501和第二代理模块502均可以由图3中的处理器103调用系统内存135中存储的计算机程序实现。
在一个示例中,参见图2,上述第一代理模块501和第二代理模块502均可以由图2中的处理器113调用存储器114中存储的计算机程序实现。
关于上述可选方式的具体描述参见前述的方法实施例,此处不再赘述。此外,上述提供的任一种代理装置50的解释以及有益效果的描述均可参考上述对应的方法实施例,不再赘述。
需要说明的是,上述各个模块对应执行的动作仅是具体举例,各个单元实际执行的动作参照上述基于图13~图16所述的实施例的描述中提及的动作或步骤。
如图20所示,为本申请实施例提供的一种计算机系统的结构示意图,该计算机系统90可以用于执行上文中任意一个实施例(图17或图18)中ROS所执行的功能。该计算机系统90应用于自动驾驶系统或辅助自动驾驶系统,该自动驾驶系统或辅助自动驾驶系统还包括:第一计算机系统。计算机系统90包括:第二应用模块901和第二通信模块902。第二通信模块902,用于接收第一计算机系统发送的第一消息。第一消息的格 式是第一计算机系统能够识别的格式,并将第一消息转换为第二消息。第二消息的格式是第二应用模块901能够识别的格式,向第二应用模块901发送第二消息。第二应用模块901,用于接收第二消息。或者,第二应用模块901,用于向第二通信模块902发送第一消息。第二通信模块902,用于将第一消息转换为第二消息。第二消息的格式是第一计算机系统能够识别的格式,并向第一计算机系统发送第二消息。例如结合图17,第二通信模块902可以用于:执行S502中的接收步骤,S503~S505,第二应用模块901可以用于:执行S506~S507。结合图18,第二应用模块901可以用于执行S600~S602。第二通信模块902可以用于:执行S603,S604中的发送步骤。
可选的,第一计算机系统包括汽车开放系统架构AUTOSAR系统,且计算机系统90包括机器人计算机系统ROS。或者,第一计算机系统包括ROS,且计算机系统90包括AUTOSAR系统。
可选的,第一计算机系统包括的第一对象发送的消息的主题,与计算机系统90包括的第二对象接收的消息的主题相同。第一计算机系统包括的第一对象接收的消息的主题,与计算机系统90包括的第二对象发送的消息的主题相同。第一对象是第一计算机系统中发送消息的发送者,第二对象是计算机系统90中的接收消息的接收者。第一对象发送的消息包括第一消息;或者,第一对象接收的消息包括第二消息。
可选的,第一计算机系统与第二通信模块902支持的消息格式相同。
可选的,第一计算机系统包括AUTOSAR系统且计算机系统90包括ROS,第一对象所使用的QoS与第二对象所使用的QoS兼容。
可选的,第一消息是远程过程调用RPC模式的消息或参数模式的消息,第一消息包括第一消息标识符。第一消息标识符包括方法标识符和/或参数标识符;第二通信模块902还用于,根据第一计算机系统能够识别的消息标识符与计算机系统90能够识别的消息标识符的对应关系,确定第一标识符对应的第二消息标识符。第二通信模块902具体用于,将第一消息转换为第二消息,第二消息包括第二消息标识符,第二消息标识符包括方法标识符和/或参数标识符。
可选的,第一计算机系统包括AUTOSAR系统,计算机系统90包括ROS。第二通信模块902还用于,对第一消息进行过滤。第二通信模块902具体用于,将过滤后的第一消息转换为第二消息。
可选的,第一计算机系统包括ROS,计算机系统90包括AUTOSAR系统。第二消息不包括实例标识符;第二通信模块902还用于,将实例标识符添加至第二消息。第二通信模块902具体用于,向第二应用模块901发送添加了实例标识符的第二消息。其中,实例标识符用于AUTOSAR系统确定第二对象。
在一个示例中,参见图3,上述第二应用模块901和第二通信模块902均可以由图3中的处理器103调用系统内存135中存储的计算机程序实现。
在一个示例中,参见图2,上述第二应用模块901和第二通信模块902均可以由图2中的处理器113调用存储器114中存储的计算机程序实现。
关于上述可选方式的具体描述参见前述的方法实施例,此处不再赘述。此外,上述提供的任一种计算机系统90的解释以及有益效果的描述均可参考上述对应的方法实施例,不再赘述。
需要说明的是,上述各个模块对应执行的动作仅是具体举例,各个单元实际执行的动作参照上述基于图17~图18所述的实施例的描述中提及的动作或步骤。
本申请实施例还提供了一种装置(如计算机设备或芯片),包括:存储器和处理器;该存储器用于存储计算机程序,该处理器用于调用该计算机程序,以执行上文提供的任一实施例中提及的动作或步骤。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,当该计算机程序在计算机上运行时,使得该计算机执行上文提供的任一实施例中提及的动作或步骤。
本申请实施例还提供了一种芯片。该芯片中集成了用于实现上述定位问题的装置的功能的电路和一个或者多个接口。可选的,该芯片支持的功能可以包括基于图13-图18所述的实施例中的处理动作,此处不再赘述。本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可通过程序来指令相关的硬件完成。所述的程序可以存储于一种计算机可读存储介质中。上述提到的存储介质可以是只读存储器,随机接入存储器等。上述处理单元或处理器可以是中央处理器,通用处理器、特定集成电路(application specific integrated circuit,ASIC)、微处理器(digital signal processor,DSP),现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。
本申请实施例还提供了一种包含指令的计算机程序产品,当该指令在计算机上运行时,使得计算机执行上述实施例中的任意一种方法。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
应注意,本申请实施例提供的上述用于存储计算机指令或者计算机程序的器件,例如但不限于,上述存储器、计算机可读存储介质和通信芯片等,均具有非易失性(non-transitory)。
在实施所要求保护的本申请过程中,本领域技术人员通过查看附图、公开内容、以及所附权利要求书,可理解并实现公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。
尽管结合具体特征及其实施例对本申请进行了描述,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利 要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。

Claims (34)

  1. 一种消息通信方法,其特征在于,应用于自动驾驶系统或辅助自动驾驶系统,所述自动驾驶系统或辅助自动驾驶系统包括:第一计算机系统、第二计算机系统和代理装置,所述方法包括:
    所述代理装置接收所述第一计算机系统发送的第一消息;所述第一消息的格式是所述第一计算机系统能够识别的格式;
    所述代理装置将所述第一消息转换为第二消息;所述第二消息的格式是所述第二计算机系统能够识别的格式;
    所述代理装置向所述第二计算机系统发送所述第二消息。
  2. 根据权利要求1所述的方法,其特征在于,
    所述第一计算机系统包括汽车开放系统架构AUTOSAR系统,且所述第二计算机系统包括机器人操作系统ROS;
    或者,所述第一计算机系统包括ROS,且所述第二计算机系统包括AUTOSAR系统。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一消息是远程过程调用RPC模式的消息或参数模式的消息,所述第一消息包括第一消息标识符,所述第一消息标识符包括方法标识符和/或参数标识符;
    所述方法还包括:
    根据所述第一计算机系统能够识别的消息标识符与所述第二计算机系统能够识别的消息标识符的对应关系,确定所述第一消息标识符对应的第二消息标识符,其中,所述第二消息包括所述第二消息标识符,所述第二消息标识符包括方法标识符和/或参数标识符。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一计算机系统包括的第一对象发送的消息的主题,与所述代理装置包括的第二对象接收的消息的主题相同;所述第一对象是所述第一计算机系统中发送消息的发送者,所述第二对象是所述代理装置中的接收消息的接收者;所述第一对象发送的消息包括所述第一消息;
    所述代理装置包括的第三对象发送的消息的主题,与所述第二计算机系统包括的第四对象接收的消息的主题相同;所述第三对象是所述代理装置中发送消息的发送者,所述第四对象是所述第二计算机系统中接收消息的接收者;所述第三对象发送的消息包括所述第二消息。
  5. 根据权利要求4所述的方法,其特征在于,所述第一计算机系统包括AUTOSAR系统,且所述第二计算机系统包括ROS,所述方法还包括:
    所述代理装置对所述第一消息进行过滤;
    所述代理装置将所述第一消息转换为第二消息,包括:
    所述代理装置将过滤后的所述第一消息转换为第二消息。
  6. 根据权利要求4所述的方法,其特征在于,所述第一计算机系统包括ROS,所述第二计算机系统包括AUTOSAR系统,且所述第二消息不包括实例标识符,所述方法还包括:
    所述代理装置将实例标识符添加至所述第二消息,其中,所述实例标识符用于所述AUTOSAR系统确定所述第四对象。
  7. 根据权利要求4-6任一项所述的方法,其特征在于,
    所述第一计算机系统包括AUTOSAR系统,且所述第二计算机系统包括ROS,所述第一对象所使用的服务质量与所述第二对象所使用的服务质量兼容;
    或者,当所述第一计算机系统包括ROS,且所述第二计算机系统包括AUTOSAR时,所述第三对象所使用的服务质量与所述第四对象所使用的服务质量兼容。
  8. 一种代理装置,其特征在于,应用于自动驾驶系统或辅助自动驾驶系统,所述自动驾驶系统或辅助自动驾驶系统还包括:第一计算机系统和第二计算机系统;所述代理装置包括:
    第一代理模块,用于接收所述第一计算机系统发送的第一消息;其中,所述第一消息的格式是所述第一计算机系统能够识别的格式;将所述第一消息转换为第二消息,所述第二消息的格式是所述第二计算机系统能够识别的格式;
    第二代理模块,用于向所述第二计算机系统发送所述第二消息。
  9. 根据权利要求8所述的代理装置,其特征在于,
    所述第一计算机系统包括汽车开放系统架构AUTOSAR系统,且所述第二计算机系统包括机器人操作系统ROS;
    或者,所述第一计算机系统包括ROS,且所述第二计算机系统包括AUTOSAR系统。
  10. 根据权利要求8或9所述的代理装置,其特征在于,所述第一消息是远程过程调用RPC模式的消息或参数模式的消息,所述第一消息包括第一消息标识符;所述第一消息标识符包括方法标识符和/或参数标识符;
    所述第一代理模块还用于,根据所述第一计算机系统能够识别的消息标识符与所述第二计算机系统能够识别的消息标识符的对应关系,确定所述第一标识符对应的第二消息标识符;
    所述第二消息包括所述第二消息标识符,所述第二消息标识符包括方法标识符和/或参数标识符。
  11. 根据权利要求8-10任一项所述的代理装置,其特征在于,所述第一代理模块包括第一读接口和第一写接口;所述第一读接口与所述第一计算机系统的读接口相同,所述第一写接口与所述第一计算机系统的写接口相同;
    所述第一代理模块具体用于:利用所述第一读接口接收所述第一计算机系统写接口发送的所述第一消息。
  12. 根据权利要求8-11任一项所述的代理装置,其特征在于,所述第二代理模块包括第二读接口和第二写接口;所述第二读接口与所述第二计算机系统的读接口相同,所述第二写接口与所述第二计算机系统的写接口相同;
    所述第二代理模块具体用于:利用所述第二写接口向所述第二计算机系统的读接口发送所述第二消息。
  13. 根据权利要求8-12任一项所述的代理装置,其特征在于,
    所述第一计算机系统包括的第一对象发送的消息的主题,与所述代理装置包括的第二对象接收的消息的主题相同;所述第一对象是所述第一计算机系统中发送消息的发送者,所述第二对象是所述代理装置中的接收消息的接收者;所述第一对象发送的消息包括所述第一消息;所述代理装置包括的第三对象发送的消息的主题,与所述第 二计算机系统包括的第四对象接收的消息的主题相同;所述第三对象是所述代理装置中发送消息的发送者,所述第四对象是所述第二计算机系统中接收消息的接收者;所述第三对象发送的消息包括所述第二消息。
  14. 根据权利要求13所述的代理装置,其特征在于,
    所述第一计算机系统包括AUTOSAR系统,且所述第二计算机系统包括ROS,所述第一代理模块与所述AUTOSAR系统的通信模块支持的消息格式相同;所述第二代理模块与所述ROS的通信模块支持的消息格式相同;
    或者,所述第一计算机系统包括ROS,且所述第二计算机系统包括AUTOSAR系统,所述第一代理模块与所述ROS的通信模块支持的消息格式相同;所述第二代理模块与所述AUTOSAR系统的通信模块支持的消息格式相同。
  15. 根据权利要求13或14所述的代理装置,其特征在于,所述第一计算机系统包括AUTOSAR系统且所述第二计算机系统包括ROS,所述第一对象所使用的服务质量与所述第二对象所使用的服务质量兼容。
  16. 根据权利要求13-15任一项所述的代理装置,其特征在于,所述第一计算机系统包括AUTOSAR系统,且所述第二计算机系统包括ROS;
    所述第一代理模块还用于,对所述第一消息进行过滤;
    所述第一代理模块具体用于,将过滤后的所述第一消息转换为第二消息。
  17. 根据权利要求13-15任一项所述的代理装置,其特征在于,所述第一计算机系统包括ROS,所述第二计算机系统包括AUTOSAR系统,且所述第二消息不包括实例标识符,
    所述第一代理模块具体用于,将实例标识符添加至所述第二消息,其中,所述实例标识符用于所述AUTOSAR系统确定所述第四对象。
  18. 一种消息通信方法,其特征在于,应用于自动驾驶系统或辅助自动驾驶系统,所述自动驾驶系统或辅助自动驾驶系统包括:第一计算机系统和第二计算机系统,所述方法包括:
    所述第二计算机系统接收所述第一计算机系统发送的第一消息;所述第一消息的格式是所述第一计算机系统能够识别的格式;
    所述第二计算机系统将所述第一消息转换为第二消息;所述第二消息的格式是所述第二计算机系统能够识别的格式。
  19. 根据权利要求18所述的方法,其特征在于,
    所述第一计算机系统包括汽车开放系统架构AUTOSAR系统,且所述第二计算机系统包括机器人操作系统ROS;
    或者,所述第一计算机系统包括ROS,且所述第二计算机系统包括AUTOSAR系统。
  20. 根据权利要求18或19所述的方法,其特征在于,所述第一消息是远程过程调用RPC模式的消息或参数模式的消息,所述第一消息包括第一消息标识符,所述第一消息标识符包括方法标识符和/或参数标识符;所述方法还包括:
    所述第二计算机系统根据所述第一计算机系统能够识别的消息标识符与所述第二计算机系统能够识别的消息标识符的对应关系,确定所述第一消息标识符对应的第二消息标识符;
    所述第二消息包括所述第二消息标识符,所述第二消息标识符包括方法标识符和/或参数标识符。
  21. 根据权利要求18-20任一项所述的方法,其特征在于,
    所述第一计算机系统包括的第一对象发送的消息的主题,与所述第二计算机系统包括的第二对象接收的消息的主题相同;所述第一计算机系统包括的第一对象接收的消息的主题,与所述第二计算机系统包括的第二对象发送的消息的主题相同;所述第一对象是所述第一计算机系统中发送消息的发送者,所述第二对象是所述第二计算机系统中的接收消息的接收者;所述第一对象发送的消息包括所述第一消息;或者,所述第二对象发送的消息包括所述第二消息。
  22. 根据权利要求18-21任一项所述的方法,其特征在于,所述第一计算机系统包括AUTOSAR系统,且所述第二计算机系统包括ROS,所述方法还包括:
    所述第二计算机系统对所述第一消息进行过滤;
    所述第二计算机系统将所述第一消息转换为第二消息,包括:
    所述第二计算机系统将过滤后的所述第一消息转换为第二消息。
  23. 根据权利要求21所述的方法,所述第一计算机系统包括ROS,所述第二计算机系统包括AUTOSAR系统,且所述第一消息不包括实例标识符,其特征在于,所述方法还包括:
    所述第二计算机系统将所述实例标识符添加至所述第二消息,其中,所述实例标识符用于所述AUTOSAR系统确定所述第二对象。
  24. 根据权利要求23所述的方法,其特征在于,所述第一计算机系统包括
    AUTOSAR系统,所述第二计算机系统包括ROS,所述第一对象所使用的服务质量与所述第二对象所使用的服务质量相兼容。
  25. 一种计算机系统,其特征在于,应用于自动驾驶系统或辅助自动驾驶系统,所述自动驾驶系统或辅助自动驾驶系统还包括:第一计算机系统;所述计算机系统包括:第二应用模块和第二通信模块:
    所述第二通信模块,用于接收所述第一计算机系统发送的第一消息;所述第一消息的格式是所述第一计算机系统能够识别的格式;并将所述第一消息转换为第二消息;所述第二消息的格式是所述第二应用模块能够识别的格式;向所述第二应用模块发送所述第二消息;
    所述第二应用模块,用于接收所述第二消息;
    或者,
    所述第二应用模块,用于向所述第二通信模块发送第一消息;
    所述第二通信模块,用于将所述第一消息转换为第二消息;所述第二消息的格式是所述第一计算机系统能够识别的格式;并向所述第一计算机系统发送所述第二消息。
  26. 根据权利要求25所述的计算机系统,其特征在于,
    所述第一计算机系统包括汽车开放系统架构AUTOSAR系统,且所述计算机系统包括机器人计算机系统ROS;
    或者,所述第一计算机系统包括ROS,且所述计算机系统包括AUTOSAR系统。
  27. 根据权利要求25或26所述的计算机系统,其特征在于,
    所述第一计算机系统与所述第二通信模块支持的消息格式相同。
  28. 根据权利要求25-27任一项所述的计算机系统,其特征在于,所述第一消息是远程过程调用RPC模式的消息或参数模式的消息,所述第一消息包括第一消息标识符;所述第一消息标识符包括方法标识符和/或参数标识符;
    所述第二通信模块还用于,根据所述第一计算机系统能够识别的消息标识符与所述计算机系统能够识别的消息标识符的对应关系,确定所述第一标识符对应的第二消息标识符;
    所述第二通信模块具体用于,将所述第一消息转换为第二消息,所述第二消息包括所述第二消息标识符,所述第二消息标识符包括方法标识符和/或参数标识符。
  29. 根据权利要求25-28任一项所述的计算机系统,其特征在于,
    所述第一计算机系统包括的第一对象发送的消息的主题,与所述计算机系统包括的第二对象接收的消息的主题相同;所述第一计算机系统包括的第一对象接收的消息的主题,与所述计算机系统包括的第二对象发送的消息的主题相同;所述第一对象是所述第一计算机系统中发送消息的发送者,所述第二对象是所述计算机系统中的接收消息的接收者;所述第一对象发送的消息包括所述第一消息;或者,所述第一对象接收的消息包括所述第二消息。
  30. 根据权利要求29所述的计算机系统,其特征在于,所述第一计算机系统包括AUTOSAR系统且所述计算机系统包括ROS,所述第一对象所使用的服务质量与所述第二对象所使用的服务质量兼容。
  31. 根据权利要求29或30所述的计算机系统,其特征在于,所述第一计算机系统包括AUTOSAR系统,所述计算机系统包括ROS;
    所述第二通信模块还用于,对所述第一消息进行过滤;
    所述第二通信模块具体用于,将过滤后的所述第一消息转换为所述第二消息。
  32. 根据权利要求29或30所述的计算机系统,其特征在于,所述第一计算机系统包括ROS,所述计算机系统包括AUTOSAR系统;所述第二消息不包括实例标识符;
    所述第二通信模块还用于,将所述实例标识符添加至所述第二消息;
    所述第二通信模块具体用于,向所述第二应用模块发送添加了所述实例标识符的所述第二消息其中,所述实例标识符用于所述AUTOSAR系统确定所述第二对象。
  33. 一种消息通信装置,其特征在于,包括:存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于执行所述计算机程序,以执行权利要求1-7或18-24中任意一项所述的方法。
  34. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行权利要求1-7或18-24中任意一项所述的方法。
PCT/CN2020/116862 2020-01-19 2020-09-22 消息通信方法、计算机系统及代理装置 WO2021143190A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010060807.XA CN113138864A (zh) 2020-01-19 2020-01-19 消息通信方法、计算机系统及代理装置
CN202010060807.X 2020-01-19

Publications (1)

Publication Number Publication Date
WO2021143190A1 true WO2021143190A1 (zh) 2021-07-22

Family

ID=76809637

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116862 WO2021143190A1 (zh) 2020-01-19 2020-09-22 消息通信方法、计算机系统及代理装置

Country Status (2)

Country Link
CN (1) CN113138864A (zh)
WO (1) WO2021143190A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112882987A (zh) * 2021-03-12 2021-06-01 北京小米移动软件有限公司 多核通信方法、装置、电子设备及存储介质
EP4258626A1 (en) * 2022-04-04 2023-10-11 Aptiv Technologies Limited Data transmission system, vehicle comprising the data transmission system, data transmission method and computer program

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113442856B (zh) * 2021-08-31 2021-12-10 国汽智控(北京)科技有限公司 基于自适应平台和ros2的控制方法、装置及存储介质
CN113806109A (zh) * 2021-09-15 2021-12-17 诚迈科技(南京)股份有限公司 基于ros2实现soa架构的座舱系统及其运行方法
CN114124611B (zh) * 2021-11-08 2023-06-23 国汽智控(北京)科技有限公司 一种车辆数据传输方法及装置
CN114895987B (zh) * 2022-07-08 2022-09-30 英诺达(成都)电子科技有限公司 消息处理方法、装置、设备及计算机存储介质
WO2024108608A1 (zh) * 2022-11-26 2024-05-30 华为技术有限公司 通信方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130103379A1 (en) * 2011-10-20 2013-04-25 Electronics And Elecommunications Research Institute Apparatus and method for verifying interoperability between application software and autosar service
US20140229504A1 (en) * 2013-02-12 2014-08-14 Samsung Techwin Co., Ltd. System and method for managing database in data distribution service
CN105429858A (zh) * 2015-12-11 2016-03-23 中国人民解放军国防科学技术大学 一种多机器人间实时消息传递方法
CN110398953A (zh) * 2018-04-25 2019-11-01 长沙智能驾驶研究院有限公司 智能驾驶系统、方法及计算机可读存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0375950A (ja) * 1989-08-18 1991-03-29 Fujitsu Ltd 不定長メッセージのデータ構造変換方式
CN101848236A (zh) * 2010-05-06 2010-09-29 北京邮电大学 具有分布式网络架构的实时数据分发系统及其工作方法
KR101663412B1 (ko) * 2015-03-09 2016-10-17 충남대학교산학협력단 사물 인터넷에서 dds 기반 사물 품질의 설정 방법
CN105446338B (zh) * 2015-12-21 2017-04-05 福州华鹰重工机械有限公司 云辅助自动驾驶方法及系统
US10198877B1 (en) * 2018-05-23 2019-02-05 Google Llc Providing a communications channel between instances of automated assistants
US11042675B2 (en) * 2018-06-01 2021-06-22 The Mathworks, Inc. Systems and methods for automatically realizing models for co-simulation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130103379A1 (en) * 2011-10-20 2013-04-25 Electronics And Elecommunications Research Institute Apparatus and method for verifying interoperability between application software and autosar service
US20140229504A1 (en) * 2013-02-12 2014-08-14 Samsung Techwin Co., Ltd. System and method for managing database in data distribution service
CN105429858A (zh) * 2015-12-11 2016-03-23 中国人民解放军国防科学技术大学 一种多机器人间实时消息传递方法
CN110398953A (zh) * 2018-04-25 2019-11-01 长沙智能驾驶研究院有限公司 智能驾驶系统、方法及计算机可读存储介质

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112882987A (zh) * 2021-03-12 2021-06-01 北京小米移动软件有限公司 多核通信方法、装置、电子设备及存储介质
EP4258626A1 (en) * 2022-04-04 2023-10-11 Aptiv Technologies Limited Data transmission system, vehicle comprising the data transmission system, data transmission method and computer program
GB2617345A (en) * 2022-04-04 2023-10-11 Aptiv Tech Ltd Data transmission system, vehicle comprising the data transmission system, data transmission method and computer program
US20230353631A1 (en) * 2022-04-04 2023-11-02 Aptiv Technologies Limited Data transmission system, vehicle comprising the data transmission system, data transmission method and computer program
GB2617345B (en) * 2022-04-04 2024-06-05 Aptiv Technoologies Ag Data transmission system, vehicle comprising the data transmission system, data transmission method and computer program

Also Published As

Publication number Publication date
CN113138864A (zh) 2021-07-20

Similar Documents

Publication Publication Date Title
WO2021143190A1 (zh) 消息通信方法、计算机系统及代理装置
WO2021212379A1 (zh) 车道线检测方法及装置
CN110517533A (zh) 一种自主泊车方法及系统
WO2020181879A1 (zh) 一种与车辆相关联的数据处理方法及系统
WO2023051591A1 (zh) 一种进程间通信方法及相关装置
CN113479195A (zh) 用于自动代客泊车的方法和用于执行所述方法的系统
US10999719B1 (en) Peer-to-peer autonomous vehicle communication
JP2024513679A (ja) 無線ota技術に基づいてファイルを取得するための方法および関連デバイス
CN115334110A (zh) 用于车辆控制的系统架构、通信方法、车辆、介质及芯片
WO2022156309A1 (zh) 一种轨迹预测方法、装置及地图
CN115179879B (zh) 车辆自唤醒方法、装置、车辆及存储介质
US20240152380A1 (en) Service-oriented data architecture for a vehicle
CN115297461B (zh) 数据交互方法、装置、车辆、可读存储介质及芯片
CN114464007B (zh) 基于无人机的智慧城市停车监控方法、系统及云平台
CN115314526A (zh) 用于自车位置识别的系统架构、传输方法、车辆、介质及芯片
WO2022068643A1 (zh) 多任务部署的方法及装置
CN115334109A (zh) 用于交通信号识别的系统架构、传输方法,车辆,介质及芯片
CN115334111A (zh) 用于车道识别的系统架构、传输方法,车辆,介质及芯片
WO2024108608A1 (zh) 通信方法及装置
WO2023024618A1 (zh) 一种数据处理方法及相关装置
WO2024026593A1 (zh) 一种协同控车方法及相关装置
WO2024055654A1 (zh) 一种进程启动方法、进程管理方法以及管理装置
CN115237630B (zh) 数据处理方法、装置、车辆、存储介质及芯片
WO2024055252A1 (zh) 一种数据融合方法、装置及智能驾驶设备
Manasseh et al. Middleware for cooperative vehicle-infrastructure systems

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20913653

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20913653

Country of ref document: EP

Kind code of ref document: A1