CN112367233B - Vehicle network ECU communication method and device based on service-oriented architecture - Google Patents
Vehicle network ECU communication method and device based on service-oriented architecture Download PDFInfo
- Publication number
- CN112367233B CN112367233B CN202011054782.9A CN202011054782A CN112367233B CN 112367233 B CN112367233 B CN 112367233B CN 202011054782 A CN202011054782 A CN 202011054782A CN 112367233 B CN112367233 B CN 112367233B
- Authority
- CN
- China
- Prior art keywords
- service
- ecu
- protocol
- module
- session
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000006854 communication Effects 0.000 title claims abstract description 58
- 238000004891 communication Methods 0.000 title claims abstract description 57
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000006243 chemical reaction Methods 0.000 claims abstract description 86
- 230000008569 process Effects 0.000 claims abstract description 23
- 239000000284 extract Substances 0.000 claims abstract description 15
- 230000005540 biological transmission Effects 0.000 claims description 19
- 230000004044 response Effects 0.000 claims description 13
- 238000012544 monitoring process Methods 0.000 claims description 7
- 230000008859 change Effects 0.000 claims description 5
- 238000004364 calculation method Methods 0.000 claims description 3
- 238000007726 management method Methods 0.000 description 28
- 230000006399 behavior Effects 0.000 description 23
- 230000000737 periodic effect Effects 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 5
- 238000013507 mapping Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 238000003745 diagnosis Methods 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 239000000446 fuel Substances 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 102100034112 Alkyldihydroxyacetonephosphate synthase, peroxisomal Human genes 0.000 description 1
- 101000799143 Homo sapiens Alkyldihydroxyacetonephosphate synthase, peroxisomal Proteins 0.000 description 1
- 206010033799 Paralysis Diseases 0.000 description 1
- 238000000848 angular dependent Auger electron spectroscopy Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000002360 explosive Substances 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000003208 petroleum Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40267—Bus for use in transportation systems
- H04L2012/40273—Bus for use in transportation systems the transportation system being a vehicle
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Small-Scale Networks (AREA)
Abstract
Description
技术领域technical field
本发明涉及汽车领域,尤其涉及一种基于面向服务的架构下车载网络ECU 通信方法及装置。The present invention relates to the field of automobiles, and in particular, to a method and device for ECU communication in an in-vehicle network based on a service-oriented architecture.
背景技术Background technique
随着科学技术的发展,现代汽车也伴着科技进步,迈向智能化、网联化发展。随着处理器运算能力和硬件的高速发展,汽车整车功能越来越多、越来越强。鉴于ADAS技术、高品质车载娱乐以及OTA远程升级等新增功能的需求,使得ECU的网络带宽需求也呈现爆发式增长,这一需求超出了传统车载网络的容量极限。另外,为了提供汽车整车功能,车载ECU数量的增多和待传数据的体量增大,普通的CAN网络已经无法满足需求了,特别是在智能座舱,辅助驾驶、无人驾驶等功能需要很大的带宽,这类的需求CAN-FD 也是无法满足的。因此为了满足高带宽的需求,车载以太网由于具备高带宽、低延时以及能够降低车内线束重量而被车载网络引入。尽管车载以太网被引入车载网络,但是传统的CAN网络仍然具备比较大的优点,如高实时、传输距离远、抗电磁干扰能力强等优点,再加上汽车行业安全标准对新进的技术验证需要很长一段时间,目前阶段,传统的基于CAN网络的ECU以及基于车载网络的ECU将共存在车载网络中。现阶段,车载以太网通信的ECU在基于AUTOSAR架构采用了面向服务的架构进行通信,而传统基于CAN网络的ECU并不支持该模式,如何将车载网络中的基于CAN协议传输的ECU 与基于车载以太网传输的ECU在采用面向服务的架构进行通信的方法已经成为制约车载网络通信技术的瓶颈。With the development of science and technology, modern automobiles are also moving towards the development of intelligence and networking along with the progress of science and technology. With the rapid development of processor computing power and hardware, the functions of the whole vehicle are becoming more and more powerful. In view of the demand for new functions such as ADAS technology, high-quality in-vehicle entertainment, and OTA remote upgrade, the network bandwidth requirements of ECUs have also shown explosive growth, which exceeds the capacity limit of traditional in-vehicle networks. In addition, in order to provide the functions of the whole vehicle, the number of on-board ECUs and the volume of data to be transmitted increase, and the ordinary CAN network can no longer meet the demand. Especially in the intelligent cockpit, functions such as assisted driving and unmanned driving require a lot of Large bandwidth, this kind of demand CAN-FD is also unable to meet. Therefore, in order to meet the demand for high bandwidth, in-vehicle Ethernet is introduced into the in-vehicle network due to its high bandwidth, low latency, and the ability to reduce the weight of the in-vehicle wiring harness. Although the in-vehicle Ethernet is introduced into the in-vehicle network, the traditional CAN network still has relatively great advantages, such as high real-time, long transmission distance, strong anti-electromagnetic interference ability, etc., coupled with the safety standards of the automotive industry to verify the new technology It will take a long time. At this stage, traditional CAN network-based ECUs and in-vehicle network-based ECUs will coexist in the in-vehicle network. At this stage, the ECUs that communicate with in-vehicle Ethernet use a service-oriented architecture for communication based on the AUTOSAR architecture, while the traditional ECUs based on CAN networks do not support this mode. The method of using the service-oriented architecture to communicate with the ECUs transmitted by Ethernet has become a bottleneck restricting the communication technology of the in-vehicle network.
发明内容SUMMARY OF THE INVENTION
本发明提供一种基于面向服务的架构下车载网络ECU通信方法,其特征在于,至少包括:The present invention provides a vehicle network ECU communication method based on a service-oriented architecture, which is characterized by at least including:
基于CAN协议的ECU发送CAN信号给服务转化ECU并经服务转化ECU 进行将CAN信号提取有效数据后将有效数据转化为服务;The ECU based on the CAN protocol sends the CAN signal to the service conversion ECU, and the service conversion ECU extracts the valid data from the CAN signal and converts the valid data into a service;
服务提供方通过基于SOME/IP-SD协议与调用服务的客户端建立创建服务连接;The service provider establishes and creates a service connection with the client calling the service based on the SOME/IP-SD protocol;
服务转化ECU对有效数据转化为服务前需要判断有效数据是否已经被转化为服务,若有效数据与之前相比未发生变化并且已经转化为服务,则终止转化,若有效数据发生变化或未被转化为服务,则将有效数据转化为服务。The service conversion ECU needs to judge whether the valid data has been converted into a service before converting the valid data into a service. If the valid data has not changed compared with the previous one and has been converted into a service, the conversion will be terminated. If the valid data has changed or has not been converted As a service, the effective data is converted into a service.
一种基于面向服务的架构下车载网络ECU通信方法,进一步地,服务转化ECU内的CAN协议栈将CAN信号进行解析后提取有效数据,服务转化 ECU内的服务转化模块将有效数据按照基于AUTOSAR架构的标准协议将有效数据转化为供客户端调用的服务;A vehicle network ECU communication method based on a service-oriented architecture, further, the CAN protocol stack in the service conversion ECU parses the CAN signal to extract valid data, and the service conversion module in the service conversion ECU converts the valid data according to the AUTOSAR architecture. The standard protocol converts valid data into services for clients to call;
所述服务提供方和客户端包括基于CAN协议的ECU和车载以太网协议的 ECU、服务转化ECU。The service provider and the client include an ECU based on the CAN protocol, an ECU based on the in-vehicle Ethernet protocol, and a service conversion ECU.
一种基于面向服务的架构下车载网络ECU通信方法,进一步地,客户端根据需求调用服务提供方的服务执行预设任务时,设置于服务提供方的服务管理模块监视服务在执行时的行为;A vehicle-mounted network ECU communication method based on a service-oriented architecture, further, when a client invokes a service of a service provider to perform a preset task according to a requirement, a service management module arranged in the service provider monitors the behavior of the service during execution;
服务管理模块监视服务以获取预设的事件,然后封装预设的事件和相应的上下文后,发送给设置于服务提供方的服务可信模块。The service management module monitors the service to obtain preset events, and then encapsulates the preset events and the corresponding context, and sends them to the service trusted module set at the service provider.
一种基于面向服务的架构下车载网络ECU通信方法,进一步地,服务管理模块监视的服务正在执行的行为并将收集服务执行的行为过程形成的反馈信息发送给服务可信模块;A vehicle network ECU communication method based on a service-oriented architecture, further, the service management module monitors the ongoing behavior of the service and collects feedback information formed by the behavior process of the service execution to the service trusted module;
当发现服务执行的行为具有恶意时,服务管理模块暂停服务执行,并向服务可信模块请求许可并等待来自服务可信模块的响应;When the behavior of service execution is found to be malicious, the service management module suspends service execution, requests permission from the service trusted module and waits for a response from the service trusted module;
服务可信模块响应服务可信模块并根据预设策略指示服务管理模块终止服务执行或允许其正常执行或纠正服务的执行行为。The service trusted module responds to the service trusted module and instructs the service management module to terminate the service execution or allow it to execute normally or correct the execution behavior of the service according to the preset policy.
一种基于面向服务的架构下车载网络ECU通信方法,进一步地,客户端调用服务后,客户端从服务可信模块请求会话标识,请求成功后,服务可信模块将创建一个会话,会话将负责收集相应的会话反馈,客户端和服务管理模块使用请求的会话标识来维护会话并向服务可信模块报告反馈。A vehicle network ECU communication method based on a service-oriented architecture, further, after the client invokes the service, the client requests a session identifier from the service trusted module, and after the request is successful, the service trusted module will create a session, and the session will be responsible for The corresponding session feedback is collected, and the client and service management modules use the requested session ID to maintain the session and report the feedback to the service trust module.
一种基于面向服务的架构下车载网络ECU通信方法,进一步地,客户端调用服务后,客户端创建一个请求,并将客户标识和会话表示作为标头添加到该请求,调用服务;A vehicle network ECU communication method based on a service-oriented architecture, further, after the client invokes the service, the client creates a request, adds the client identifier and the session representation as headers to the request, and invokes the service;
若被客户端调用的服务在执行任务时再调用另一服务,则服务管理模块截获传入的请求并提取客户标识和会话标识以用于进一步的会话反馈;If the service invoked by the client calls another service while performing the task, the service management module intercepts the incoming request and extracts the client ID and session ID for further session feedback;
会话反馈包括:会话标识、元数据、当前服务、被当前服务即将调用的服务;Session feedback includes: session identifier, metadata, current service, and service to be called by the current service;
元数据包括额外的上下文信息。Metadata includes additional contextual information.
一种基于面向服务的架构下车载网络ECU通信方法,进一步地,调用完成后,客户端通过服务可信模块以获取会话报告,会话报告至少包括会话的综合信任值以及服务执行期间是否违反了预设策略。A vehicle network ECU communication method based on a service-oriented architecture, further, after the call is completed, the client obtains a session report through the service trust module, and the session report at least includes the comprehensive trust value of the session and whether the service is executed. Set a strategy.
一种基于面向服务的架构下车载网络ECU通信方法,进一步地,预设策略包括服务执行行为可信度,可信度是动态可变的,可信度的计算依据至少包括:服务的实际执行执行历史记录、服务信誉、客户评分。A vehicle network ECU communication method based on a service-oriented architecture, further, the preset strategy includes the credibility of the service execution behavior, the credibility is dynamically variable, and the calculation basis of the credibility at least includes: the actual execution of the service Execution history, service reputation, customer ratings.
一种基于面向服务的架构下车载网络ECU通信方法,进一步地,基于车载以太网协议ECU作为客户端需要调用基于CAN协议的ECU提供的功能包括:基于车载以太网协议ECU通过SOME/IP协议发送请求信息给服务转化 ECU请求调用相应基于CAN协议的ECU转化的服务,服务转化ECU接收到请求后开始启动对应的服务;A vehicle network ECU communication method based on a service-oriented architecture, further, the functions provided by the ECU based on the vehicle Ethernet protocol as a client to call the ECU based on the CAN protocol include: based on the vehicle Ethernet protocol, the ECU sends a message through the SOME/IP protocol. The request information is sent to the service conversion ECU to request to call the corresponding service converted by the ECU based on the CAN protocol, and the service conversion ECU starts the corresponding service after receiving the request;
服务启动后,服务转化ECU内设有服务转化模块提取服务的有效数据并经CAN协议发送给相应的基于CAN协议的ECU进行进行执行预设任务。After the service is started, a service conversion module is set in the service conversion ECU to extract the valid data of the service and send it to the corresponding CAN protocol-based ECU to perform preset tasks.
一种基于面向服务的架构下车载网络ECU通信装置,包括:基于车载以太网协议的ECU、基于CAN协议的ECU、服务转化ECU、车载以太网交换机,其中,基于CAN协议的ECU与服务转化ECU相连,服务转化ECU、车载以太网ECU通过车载以太网交换机相连接;An in-vehicle network ECU communication device based on a service-oriented architecture, comprising: an ECU based on an in-vehicle Ethernet protocol, an ECU based on a CAN protocol, a service conversion ECU, and an in-vehicle Ethernet switch, wherein the ECU based on the CAN protocol and the service conversion ECU Connected, the service conversion ECU and the vehicle Ethernet ECU are connected through the vehicle Ethernet switch;
基于CAN协议的ECU发送CAN信号给服务转化ECU并经服务转化ECU 进行将CAN信号提取有效数据后将有效数据转化为基于面向服务的服务。The ECU based on the CAN protocol sends the CAN signal to the service conversion ECU, and the service conversion ECU extracts the valid data from the CAN signal and converts the valid data into a service-oriented service.
一种基于面向服务的架构下车载网络ECU通信装置,进一步地,服务转化ECU包括:CAN协议栈,被配置于用于对基于CAN协议传输信号进行解析并从中提取有效数据或将有效数据转化CAN协议的传输信号;An in-vehicle network ECU communication device based on a service-oriented architecture, further, the service conversion ECU includes: a CAN protocol stack, which is configured to parse a signal transmitted based on the CAN protocol and extract valid data from it or convert valid data into CAN the transmission signal of the protocol;
服务转化模块,被配置于将有效数据转化成基于AUTOSAR标准的服务或将从服务中提取有效数据;The service conversion module is configured to convert valid data into services based on the AUTOSAR standard or extract valid data from services;
服务转化ECU对有效数据转化为基于面向服务的服务转化前需要判断有效数据是否已经被转化为服务,若有效数据与之前相比未发生变化并且已经转化为服务,则终止转化,若有效数据发生变化或未被转化为服务,则将有效数据转化为服务。The service conversion ECU needs to determine whether the valid data has been converted into a service before converting the valid data into a service-based service. If the valid data has not changed compared with the previous one and has been converted into a service, the conversion will be terminated. If the valid data occurs Changes or not converted into services, then convert valid data into services.
一种基于面向服务的架构下车载网络ECU通信装置,进一步地,服务转化ECU还包括:服务管理模块,被配置为用于负责在运行时监视服务的执行情况,以检测恶意服务调用或恶意数据泄漏;每当将要进行服务调用时,会向服务可信模块发送反馈消息;当检测到服务恶意行为时,具备停止执行服务并等待从服务可信模块返回的响应,响应将指示阻止服务调用或将其恢复为正常执行;An in-vehicle network ECU communication device based on a service-oriented architecture, further, the service conversion ECU further includes: a service management module, configured to be responsible for monitoring the execution of services at runtime to detect malicious service calls or malicious data Leak; whenever a service call is about to be made, a feedback message will be sent to the service trusted module; when malicious behavior of the service is detected, it has the ability to stop executing the service and wait for a response from the service trusted module, which will indicate that the service call is blocked or restore it to normal execution;
服务可信模块,被配置为用于根据来自服务转化模块的反馈消息,通过预设策略的执行决定响应服务管理模块;服务可信模块包括用于定义可信数据库,用于分析被调用的服务的执行行为,并在被调用的服务执行后,根据客户端的会话请求将服务的执行过程形成会话报告发送给客户端。The service trust module is configured to respond to the service management module through the execution of the preset policy according to the feedback message from the service conversion module; the service trust module includes a trust database for defining a trust database for analyzing the called service and after the called service is executed, according to the client's session request, a session report of the execution process of the service is formed and sent to the client.
一种基于面向服务的架构下车载网络ECU通信装置,进一步地,车载以太网协议的ECU包括服务管理模块,被配置为用于负责在运行时监视服务的执行情况,以检测恶意服务调用或恶意数据泄漏;每当将要进行服务调用时,会向服务可信模块发送反馈消息;当检测到服务恶意行为时,具备停止执行服务并等待从服务可信模块返回的响应,响应将指示阻止服务调用或将其恢复为正常执行;An in-vehicle network ECU communication device based on a service-oriented architecture, further, the ECU of the in-vehicle Ethernet protocol includes a service management module, which is configured to be responsible for monitoring the execution of services at runtime to detect malicious service calls or malicious services. Data leakage; whenever a service call is about to be made, a feedback message will be sent to the service trusted module; when malicious behavior of the service is detected, it has the ability to stop executing the service and wait for a response from the service trusted module, and the response will indicate that the service call is blocked or restore it to normal execution;
服务可信模块,被配置为用于根据来自服务转化模块的反馈消息,通过预设策略的执行决定响应服务管理模块;服务可信模块包括用于定义可信数据库,用于分析被调用的服务的执行行为,并在被调用的服务执行后,根据客户端的会话请求将服务的执行过程形成会话报告发送给客户端。The service trust module is configured to respond to the service management module through the execution of the preset policy according to the feedback message from the service conversion module; the service trust module includes a trust database for defining a trust database for analyzing the called service and after the called service is executed, according to the client's session request, a session report of the execution process of the service is formed and sent to the client.
一种基于面向服务的架构下车载网络ECU通信装置,进一步地,车载网络中还设置智能天线,智能天线设有包括:服务配置器,车载以太网协议栈、外部通信接口,其中,服务配置器与车载以太网协议栈、外部通信接口相连接;An in-vehicle network ECU communication device based on a service-oriented architecture, further, a smart antenna is also set in the in-vehicle network, and the smart antenna is provided with a service configurator, an in-vehicle Ethernet protocol stack, and an external communication interface, wherein the service configurator Connected with vehicle Ethernet protocol stack and external communication interface;
服务配置器包括:缓存模块,用于缓存外部信息以处理内部网络的可用性。The service configurator includes: a cache module for caching external information to handle the availability of the internal network.
有益效果:Beneficial effects:
1.本发明中提供面向服务的架构下车载网络ECU通信装置,能够将基于 CAN协议的传输的信号转化为服务以提供基于车载以太网的ECU进行调用,同时,在服务调用的过程中,对服务的执行行为进行监控。一方面,实现传统ECU与车载以太网的ECU之间基于面向服务的架构进行通信。另一方面,解决服务执行过程中,现有技术的面向服务的架构在服务执行过程中缺乏反馈与监督的技术问题,使其能够应用的适应车内网络中具有安全性、实时、可靠性的需求。1. The present invention provides an on-board network ECU communication device under a service-oriented architecture, which can convert the signal transmitted based on the CAN protocol into a service to provide an on-board Ethernet-based ECU for invocation. At the same time, in the process of service invocation, the The execution behavior of the service is monitored. On the one hand, the communication between the traditional ECU and the ECU that implements the in-vehicle Ethernet is based on a service-oriented architecture. On the other hand, in the process of service execution, the existing service-oriented architecture lacks feedback and supervision in the service execution process, so that it can be applied to the in-vehicle network with security, real-time, and reliability. need.
2.在服务转化时,由于CAN协议的信号发送时周期性的发送,首先判断从CAN信号中提取的有效数据是否发生变化或者已经转化为服务,根据判断结果执行相应操作,并非每次接受到CAN信号都需要转化,这样就降低的服务转化ECU的内部资源消耗。另外一方面,频繁的服务转化也会导致服务与客户端不停的建立通信连接以及消息订阅等,加剧车载网络负荷,严重会导致车载网络瘫痪。2. When the service is converted, due to the periodic transmission of the CAN protocol signal, first determine whether the valid data extracted from the CAN signal has changed or has been converted into a service, and perform the corresponding operation according to the judgment result, not every time it is received. CAN signals all need to be converted, so that the internal resource consumption of the service conversion ECU is reduced. On the other hand, frequent service conversion will also lead to the continuous establishment of communication connections and message subscriptions between the service and the client, which will increase the load on the in-vehicle network and will seriously lead to the paralysis of the in-vehicle network.
附图说明Description of drawings
以下附图仅对本发明做示意性说明和解释,并不限定本发明的范围。The following drawings merely illustrate and explain the present invention schematically, and do not limit the scope of the present invention.
图1为本发明一实施例中面向服务的架构下车载网络的结构示意图。FIG. 1 is a schematic structural diagram of an in-vehicle network under a service-oriented architecture according to an embodiment of the present invention.
图2为本发明一实施例中智能天线的结构示意图。FIG. 2 is a schematic structural diagram of a smart antenna according to an embodiment of the present invention.
图3为本发明一实施例中基于CAN协议ECU发送的信号转化经过服务ECU转化为服务的流程图。FIG. 3 is a flow chart of converting a signal sent by an ECU based on a CAN protocol into a service through a service ECU in an embodiment of the present invention.
图4为本发明一实施例中客户端调用服务进行执行任务的过程监控流程图。FIG. 4 is a flowchart of process monitoring in which a client invokes a service to perform a task according to an embodiment of the present invention.
具体实施方式Detailed ways
为了对本文的技术特征、目的和效果有更加清楚的理解,现对照附图1 至4说明本发明的具体实施方式,在各图中相同的标号表示相同的部分。为使图面简洁,各图中的示意性地表示出了与本发明相关部分,而并不代表其作为产品的实际结构。另外,为使图面简洁便于理解,在有些图中具有相同结构或功能的部件,仅示意性地绘示了其中的一个,或仅标出了其中的一个。In order to have a clearer understanding of the technical features, objects and effects herein, specific embodiments of the present invention will now be described with reference to Figs. 1 to 4, in which the same reference numerals denote the same parts. For the sake of brevity of the drawings, the relevant parts of the present invention are schematically shown in each drawing, and do not represent the actual structure as a product. In addition, in order to make the drawings simple and easy to understand, in some drawings, only one of the components having the same structure or function is schematically shown, or only one of them is marked.
关于控制系统,功能模块、应用程序(APP)本领域技术人员熟知的是,其可以采用任何适当的形式,既可以是硬件也可以是软件,既可以是离散设置的多个功能模块,也可以是集成到一个硬件上的多个功能单元。作为最简单的形式,所述控制系统可以是控制器,例如组合逻辑控制器、微程序控制器等,只要能够实现本申请描述的操作即可。当然,控制系统也可以作为不同的模块集成到一个物理设备上,这些都不偏离本发明的基本原理和保护范围。With regard to the control system, functional modules and application programs (APP) are well known to those skilled in the art, and can take any appropriate form, either hardware or software, a plurality of discretely set functional modules, or are multiple functional units integrated into one hardware. In the simplest form, the control system may be a controller, such as a combinational logic controller, a microprogram controller, etc., as long as the operations described in this application can be implemented. Of course, the control system can also be integrated into a physical device as different modules, which do not deviate from the basic principles and protection scope of the present invention.
本发明中“连接”,即可包括直接连接、也可以包括间接连接、通信连接、电连接,特别说明除外。In the present invention, "connection" may include direct connection, indirect connection, communication connection, and electrical connection, unless otherwise specified.
本文中所使用的术语仅为了描述特定实施方案的目的并且不旨在限制本公开。如本文中所使用地,单数形式“一个”、“一种”、以及“该”旨在也包括复数形式,除非上下文明确地另作规定。还将理解的是,当在说明书中使用时,术语“包括”和/或“包含”是指存在有所陈述的特征、数值、步骤、操作、元件和/或组分,但是并不排除存在有或额外增加一个或多个其它的特征、数值、步骤、操作、元件、组分和/或其组成的群组。作为在本文中所使用的,术语“和/或”包括列举的相关项的一个或多个的任何和全部的组合The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the present disclosure. As used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that, when used in the specification, the terms "comprising" and/or "comprising" refer to the presence of stated features, values, steps, operations, elements and/or components, but do not exclude the presence of One or more other features, values, steps, operations, elements, components, and/or groups of components thereof are present or additionally added. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items
应当理解,此处所使用的术语“车辆”或“车辆的”或其它类似术语一般包括机动车辆,例如包括运动型多用途车辆(SUV)、公共汽车、卡车、各种商用车辆的乘用汽车,包括各种舟艇、船舶的船只,航空器等,并且包括混合动力车辆、电动车辆、可插式混合动力电动车辆、氢动力车辆以及其它替代性燃料车辆(例如源于非石油的能源的燃料)。正如此处所提到的,混合动力车辆是具有两种或更多动力源的车辆,例如汽油动力和电力动力两者的车辆。It should be understood that the terms "vehicle" or "vehicle's" or other similar terms as used herein generally include motor vehicles, such as passenger cars including sport utility vehicles (SUVs), buses, trucks, various commercial vehicles, Includes various boats, marine vessels, aircraft, etc., and includes hybrid vehicles, electric vehicles, pluggable hybrid electric vehicles, hydrogen-powered vehicles, and other alternative fuel vehicles (eg, fuels derived from energy sources other than petroleum). As mentioned herein, a hybrid vehicle is a vehicle having two or more power sources, such as both gasoline-powered and electric-powered vehicles.
此外,本公开的控制器可被具体化为计算机可读介质上的非瞬态计算机可读介质,该计算机可读介质包含由处理器、控制器或类似物执行的可执行程序指令。计算机可读介质的示例包括,但不限于,ROM、RAM、光盘 (CD)-ROM、磁带、软盘、闪存驱动器、智能卡和光学数据存储设备。计算机可读记录介质也可分布在通过网络耦合的计算机系统中,使得计算机可读介质例如通过远程信息处理服务器或控制器区域网络(CAN)或车载以太网以分布式方式存储和执行。Furthermore, the controller of the present disclosure may be embodied as a non-transitory computer readable medium on a computer readable medium containing executable program instructions to be executed by a processor, controller or the like. Examples of computer-readable media include, but are not limited to, ROM, RAM, compact disc (CD)-ROMs, magnetic tapes, floppy disks, flash drives, smart cards, and optical data storage devices. The computer readable recording medium can also be distributed in network coupled computer systems so that the computer readable medium is stored and executed in a distributed fashion, eg, through a telematics server or a controller area network (CAN) or vehicle Ethernet.
本实施提供一种基于面向服务的架构下车载网络ECU通信装置,参见图 1,具体包括:基于CAN协议的ECU,服务转化ECU,车载以太网ECU,T- box,其中,基于CAN协议的ECU与服务转化ECU相连接,服务转化ECU、车载以太网协议的ECU、T-box通过车载以太网交换机进行连接;This implementation provides an in-vehicle network ECU communication device based on a service-oriented architecture, see FIG. 1 , which specifically includes: an ECU based on the CAN protocol, a service conversion ECU, an in-vehicle Ethernet ECU, and a T-box, wherein the ECU based on the CAN protocol Connected with the service conversion ECU, the service conversion ECU, the ECU of the vehicle Ethernet protocol, and the T-box are connected through the vehicle Ethernet switch;
具体地,车载网络中,传统的ECU大多数都是基于CAN协议的,由于基于CAN协议传输具备实时性和可靠性,而且成本低并且经过上百年的验证,其具有难以替换的优势。另外,为了满足现代智能汽车的高速率、低车身重量传输,传统CAN协议的ECU较难满足,基于车载以太网协议的ECU能够满足高带宽、低线束重量。但是由于汽车涉及众多的ECU,每个ECU的应用场合和需求不同,因此使得基于CAN协议的ECU和基于车载以太网的ECU在很长一段时间内进行共存。但是基于传统的CAN协议的ECU的通信效率较低,为了提高车载网络的ECU的通信效率,提出一种基于面向服务架构的通信机制在车载网络中获得应用,但是由此也带来了很多问题,基于CAN协议通信的ECU 与基于车载以太网的ECU如何通过面向服务的架构进行通信。Specifically, in the in-vehicle network, most of the traditional ECUs are based on the CAN protocol. Because the transmission based on the CAN protocol has real-time and reliability, and has low cost and has been verified for hundreds of years, it has the advantage of being difficult to replace. In addition, in order to meet the high-speed and low-body weight transmission of modern smart cars, it is difficult for the ECU of the traditional CAN protocol to meet the requirements. The ECU based on the in-vehicle Ethernet protocol can meet the requirements of high bandwidth and low wiring harness weight. However, because the car involves many ECUs, each ECU has different applications and needs, so the ECUs based on the CAN protocol and the ECUs based on the in-vehicle Ethernet coexist for a long time. However, the communication efficiency of the ECU based on the traditional CAN protocol is low. In order to improve the communication efficiency of the ECU in the in-vehicle network, a communication mechanism based on a service-oriented architecture is proposed and applied in the in-vehicle network, but it also brings many problems. , How the ECU based on CAN protocol communication and the ECU based on vehicle Ethernet communicate through the service-oriented architecture.
服务转化ECU被配置为用于作为基于CAN协议的ECU与基于车载以太网协议的ECU相互通信转化的媒介,服务转化ECU包括:CAN协议栈、服务转化模块、服务管理模块、服务可信模块、车载以太网协议栈;The service conversion ECU is configured to be used as a medium for mutual communication and conversion between the ECU based on the CAN protocol and the ECU based on the vehicle Ethernet protocol. The service conversion ECU includes: CAN protocol stack, service conversion module, service management module, service trusted module, Vehicle Ethernet protocol stack;
CAN协议栈用于将信号按照CAN协议的标准格式进行编码封装后发送给基于CAN协议的ECU或对接收到的符合CAN协议的信号进行解码;The CAN protocol stack is used to encode and encapsulate the signal according to the standard format of the CAN protocol and send it to the ECU based on the CAN protocol or decode the received signal conforming to the CAN protocol;
服务转化模块用于将对经过解码的CAN协议信号进行有效数据提取并将有效数据转化为服务;The service conversion module is used to extract valid data from the decoded CAN protocol signal and convert the valid data into services;
本实施例所定义的服务包括:一个或多个方法,一个或多个事件以及一个或多个字段的逻辑组合;服务可以独立实现某种功能。The service defined in this embodiment includes: one or more methods, one or more events, and a logical combination of one or more fields; the service can independently implement a certain function.
服务也可以调用服务,例如假设有A1、A2、A3三个服务,根据事先定义, A1服务的实现需要调用A2,而A2调用的实现需要调用A3,因此当调用A1服务时,A2和A3也要调用。The service can also call the service. For example, suppose there are three services A1, A2, and A3. According to the prior definition, the implementation of the A1 service needs to call A2, and the implementation of the A2 call needs to call A3. Therefore, when the A1 service is called, A2 and A3 also need to be called. to call.
服务管理模块用于负责在运行时监视服务的执行情况,以检测恶意服务调用或恶意数据泄漏;每当将要进行服务调用时,会向服务可信模块发送反馈消息;当检测到服务恶意行为时,具备停止执行服务并等待从服务可信模块返回的响应,响应将指示阻止服务调用或将其恢复为正常执行;The service management module is responsible for monitoring the execution of services at runtime to detect malicious service calls or malicious data leakage; whenever a service call is about to be made, a feedback message is sent to the service trust module; when a service malicious behavior is detected , with the ability to stop executing the service and wait for the response returned from the service trusted module, the response will instruct to block the service call or restore it to normal execution;
服务可信模块用于根据来自服务转化模块的反馈消息,通过预设策略的执行决定响应服务管理模块;服务可信模块包括用于定义可信数据库,用于分析被调用的服务的执行行为,并在被调用的服务执行后,根据客户端的会话请求将服务的执行过程形成会话报告发送给客户端;The service trusted module is used for responding to the service management module through the execution of the preset policy according to the feedback message from the service transformation module; the service trusted module includes a trusted database for defining a trusted database for analyzing the execution behavior of the called service, And after the called service is executed, according to the session request of the client, the execution process of the service is formed into a session report and sent to the client;
车载以太网协议栈用于将信号按照车载以太网协议的标准格式进行编码封装后发送给基于车载以太网协议的ECU或对接收到的符合车载以太网协议的信号进行解码后发给应用程序进行数据处理。The in-vehicle Ethernet protocol stack is used to encode and encapsulate the signal according to the standard format of the in-vehicle Ethernet protocol and then send it to the ECU based on the in-vehicle Ethernet protocol or decode the received signal conforming to the in-vehicle Ethernet protocol and send it to the application for processing. data processing.
车载以太网协议的ECU包括服务管理模块、服务可信模块、车载以太网协议栈;The ECU of the in-vehicle Ethernet protocol includes a service management module, a service trusted module, and an in-vehicle Ethernet protocol stack;
服务管理模块被配置为用于负责在运行时监视服务的执行情况,以检测恶意服务调用或恶意数据泄漏;每当将要进行服务调用时,会向服务可信模块发送反馈消息;当检测到服务恶意行为时,具备停止执行服务并等待从服务可信模块返回的响应,响应将指示阻止服务调用或将其恢复为正常执行;The service management module is configured to be responsible for monitoring the execution of services at runtime to detect malicious service calls or malicious data leakage; whenever a service call is about to be made, a feedback message is sent to the service trusted module; when a service is detected In the case of malicious behavior, it has to stop the execution of the service and wait for the response returned from the service trusted module, and the response will instruct to block the service call or restore it to normal execution;
服务可信模块,被配置为用于根据来自服务转化模块的反馈消息,通过预设策略的执行决定响应服务管理模块;服务可信模块包括用于定义可信数据库,用于分析被调用的服务的执行行为,并在被调用的服务执行后,根据客户端的会话请求将服务的执行过程形成会话报告发送给客户端。The service trust module is configured to respond to the service management module through the execution of the preset policy according to the feedback message from the service conversion module; the service trust module includes a trust database for defining a trust database for analyzing the called service and after the called service is executed, according to the client's session request, a session report of the execution process of the service is formed and sent to the client.
车载以太网协议栈用于将信号按照车载以太网协议的标准格式进行编码封装后发送给基于车载以太网协议的ECU或对接收到的符合车载以太网协议的信号进行解码后发给应用程序进行数据处理。The in-vehicle Ethernet protocol stack is used to encode and encapsulate the signal according to the standard format of the in-vehicle Ethernet protocol and then send it to the ECU based on the in-vehicle Ethernet protocol or decode the received signal conforming to the in-vehicle Ethernet protocol and send it to the application for processing. data processing.
具体地,服务可信模块可以单独设置一个ECU,统一设置专门的ECU内置服务可信模块,但是设计方式尽管可以节省每个ECU内的系统运行资源,但是其会带来通信成本增加。因为每次服务调用,信号都需要经过多次转化后以通过车载网络总线传输给专门的ECU内的服务可信模块,由此增加的车载网络的负荷。为了解决该问题,本实施设置于能够提供服务的ECU内,但不设置于基于CAN协议的ECU。Specifically, the service trusted module can set up an ECU separately, and set up a dedicated ECU built-in service trusted module uniformly, but although the design method can save the system running resources in each ECU, it will increase the communication cost. Because every time the service is called, the signal needs to be transformed for many times to be transmitted to the service trusted module in the dedicated ECU through the vehicle network bus, which increases the load of the vehicle network. In order to solve this problem, the present embodiment is provided in an ECU that can provide services, but is not provided in an ECU based on the CAN protocol.
在定义服务功能时,基于SOME/IP的协议,其中定义服务的消息ID (message ID),其包括服务ID(Service ID)和方法ID(Method ID),消息 ID是一个32位的标识符,用于标识消息,消息ID必须唯一地标识服务的方法或事件,消息ID的分配取决于用户,但是,消息ID对于整个系统必须是唯一的,消息ID与CAN ID进行比较,并应通过类似的过程进行处理。When defining the service function, based on the SOME/IP protocol, the message ID (message ID) of the service is defined, which includes the service ID (Service ID) and the method ID (Method ID), and the message ID is a 32-bit identifier. Used to identify the message, the message ID must uniquely identify the method or event of the service, the assignment of the message ID is up to the user, however, the message ID must be unique for the entire system, the message ID is compared with the CAN ID and should be passed through a similar process to process.
基于SOME/IP协议提供的服务,至少包括:与CAN ID对应的消息ID,服务ID、实例ID、事件组ID;The service provided based on the SOME/IP protocol at least includes: the message ID corresponding to the CAN ID, the service ID, the instance ID, and the event group ID;
所述消息ID包括服务ID和方法ID。The message ID includes a service ID and a method ID.
服务ID和实例ID用于与客户端建立连接时进行提供服务、发现服务、停止服务,服务ID和实例ID用于SOME IP_SD报文的使用。The service ID and instance ID are used to provide services, discover services, and stop services when establishing a connection with the client, and the service ID and instance ID are used for SOME IP_SD messages.
为了确保服务消息ID是在整个车载网络系统是唯一的,在提供服务的ECU 内设有CAN ID与消息ID的对应映射表以及消息ID映射表,当服务产生时,首先在消息ID映射表申请与服务对应的消息ID,系统自动从消息ID映射表未被使用的消息ID中自动分配一个消息ID给服务,同时,通过UDP协议广播车载网络节点中其它提供服务的ECU当前已经被用的消息ID,提供服务的ECU 更新内部的消息ID映射表。In order to ensure that the service message ID is unique in the entire in-vehicle network system, there is a corresponding mapping table between CAN ID and message ID and a message ID mapping table in the ECU that provides the service. When the service is generated, first apply in the message ID mapping table. The message ID corresponding to the service, the system automatically assigns a message ID to the service from the unused message IDs in the message ID mapping table, and at the same time, broadcasts the currently used messages of other ECUs that provide services in the vehicle network node through the UDP protocol. ID, the ECU providing the service updates the internal message ID mapping table.
本实施还提供了一种基于面向服务的架构下车载网络ECU的通信方法,参见图3和图4,具体包括:This implementation also provides a communication method for the vehicle network ECU based on a service-oriented architecture, see Figures 3 and 4, and specifically includes:
基于CAN协议的ECU发送CAN信号给服务转化ECU并经服务转化ECU 进行将CAN信号提取有效数据后将有效数据转化为服务;The ECU based on the CAN protocol sends the CAN signal to the service conversion ECU, and the service conversion ECU extracts the valid data from the CAN signal and converts the valid data into a service;
服务提供方通过基于SOME/IP-SD协议与调用服务的客户端建立创建服务连接;The service provider establishes and creates a service connection with the client calling the service based on the SOME/IP-SD protocol;
服务转化ECU对有效数据转化为服务前需要判断有效数据是否已经被转化为服务,若有效数据与之前相比未发生变化并且已经转化为服务,则终止转化,若有效数据发生变化或未被转化为服务,则将有效数据转化为服务。The service conversion ECU needs to judge whether the valid data has been converted into a service before converting the valid data into a service. If the valid data has not changed compared with the previous one and has been converted into a service, the conversion will be terminated. If the valid data has changed or has not been converted As a service, the effective data is converted into a service.
具体地,传统基于CAN总线传输的ECU根据触发条件不同,在车身CAN 网络中可分为事件型、周期性及混合型三种传输模式;Specifically, the traditional ECU based on CAN bus transmission can be divided into three transmission modes: event type, periodic type and hybrid type in the body CAN network according to different trigger conditions;
在事件型传输模式,随着类型或数据的转变及时发送的消息。此类型消息的好处是极少占用总线资源,但是可能会存在漏发情况,这种消息类似于网络的中断,用于故障诊断的帧可以是事件型的。In the event-based transfer mode, messages are sent in time as the type or data changes. The advantage of this type of message is that it takes up very little bus resources, but there may be missed sending. This kind of message is similar to the interruption of the network, and the frame used for fault diagnosis can be event type.
在周期型传输模式,以某个时间为周期,循环发送的消息类型。此类型的消息要求的时间精度一般小于10%,可以尽可能的保证消息的可靠性,如果周期过短,可能会使总线的负载过大,影响网络的质量。在设计网络中,可遵循如下的基本规则:如果帧的ID号越小,它的优先级越高,那么它的周期可以越小。用于监督网络状态的帧可以是周期性的。In periodic transmission mode, the type of message sent cyclically with a certain period of time. The time precision required for this type of message is generally less than 10%, which can ensure the reliability of the message as much as possible. If the period is too short, the bus load may be too large and the quality of the network will be affected. In designing a network, the following basic rules can be followed: if a frame's ID number is smaller, its priority is higher, and its period can be smaller. Frames used to monitor network status can be periodic.
在混合型传输模式:事件型与周期型混合类型的帧。事件型消息发送实时变化的帧,周期性的发送保证了消息的完备性。如用于监控外部设备的帧,如果帧中的参数无变化,将周期性的发送,如帧中的参数发生了变化,将会以事件发送此帧,然后重新计时以周期帧发送。In mixed transmission mode: event type and periodic type mixed type frame. Event messages send frames that change in real time, and periodic sending ensures message integrity. For example, a frame used to monitor external devices, if the parameters in the frame do not change, it will be sent periodically. If the parameters in the frame have changed, the frame will be sent as an event, and then re-timed and sent as a periodic frame.
因此,在本实施中,基于CAN协议的传输模式采用事件型与周期型混合类型的帧进行传输,但用于诊断传输的情形极少,大多数情况下都是周期性传输模式,基于CAN协议的ECU都是在周期性在CAN网络中发送报文数据,这将导致服务转化ECU不停对来自CAN协议周期性的报文进行转化,一方面进行重复的转化工作,另一方面,加剧了服务转化ECU的系统资源过渡消耗而无法进行其本质工作(担任与基于车载以太网ECU与基于CAN协议的ECU的通信媒介),为了解决该技术问题,每次提取来自CAN协议的ECU发送的有效数据前并非每次都要转化,因为CAN协议的ECU是周期性的发送CAN信号,因此,在转化前实现判断有效数据是否已经被转化为服务或者尽管转化为服务,但是有效数据发生了变化,若有效数据发生变化或没有被转化服务,则将有效数据转化为服务,若有效数据未发生变化或已经转化为服务,则终止转化过程。通过这种对有效数据进行判断后决定是否转化为服务,可以极大的降低服务转化ECU的负荷,以使得服务转化ECU能够正常工作。另一方面,提供的服务可以动态更改。Therefore, in this implementation, the transmission mode based on the CAN protocol adopts the mixed frame type of event type and periodic type for transmission, but it is rarely used for diagnosis transmission. In most cases, it is a periodic transmission mode, based on the CAN protocol. All ECUs are periodically sending message data in the CAN network, which will cause the service conversion ECU to continuously convert the periodic messages from the CAN protocol. On the one hand, it performs repeated conversion work. The system resources of the service conversion ECU are excessively consumed and cannot perform its essential work (acting as a communication medium with the vehicle Ethernet-based ECU and the CAN-based ECU). In order to solve this technical problem, each time the valid data sent by the ECU from the CAN protocol is extracted. It is not necessary to convert every time before the data, because the ECU of the CAN protocol sends CAN signals periodically. Therefore, before the conversion, it is realized to judge whether the valid data has been converted into a service or even though it has been converted into a service, but the valid data has changed. If the valid data has changed or has not been converted into a service, the valid data will be converted into a service. If the valid data has not changed or has been converted into a service, the conversion process will be terminated. By judging the valid data and deciding whether to convert it into a service, the load of the service conversion ECU can be greatly reduced, so that the service conversion ECU can work normally. On the other hand, the services provided can change dynamically.
具体地,服务转化ECU的转化过程包括:Specifically, the transformation process of the service transformation ECU includes:
服务转化ECU内的CAN协议栈将CAN信号进行解析后提取有效数据,服务转化ECU内的服务转化模块将有效数据按照基于AUTOSAR架构的标准协议将有效数据转化为供客户端调用的服务;The CAN protocol stack in the service conversion ECU parses the CAN signal to extract valid data, and the service conversion module in the service conversion ECU converts the valid data into a service for the client to call according to the standard protocol based on the AUTOSAR architecture;
所述服务提供方和客户端包括基于CAN协议的ECU和车载以太网协议的 ECU、服务转化ECU。The service provider and the client include an ECU based on the CAN protocol, an ECU based on the in-vehicle Ethernet protocol, and a service conversion ECU.
有效数据至少包括CAN ID、载荷数据、请求信息;Valid data includes at least CAN ID, payload data, and request information;
具体地,汽车行业相比于消费电子,如手机行业,互联网行业,具有较高的安全性,当采用基于面向服务的架构进行通信时,客户端和服务提供方相对独立,客户端只需要调用需要的服务,而对服务的执行过程并不知晓,如果服务执行恶意行为,如泄露隐私数据、串改数据等危险到安全驾驶的行为时,则可能会导致严重的安全事故发生,为了加强服务执行的过程安全控制,降低风险,本实施例设计了服务管理模块与服务可信模块进行相互配合,以解决基于面向服务的架构应用于汽车的安全问题。另外,由于客户端调用服务,及时当前调用的服务时可信的,但是调用的服务在执行过程中仍然可能调用另外一个服务或多个服务,甚至被调用的服务再次调用其它的服务,这些过程客户端是无法控制,所以存在的风险极大,需要对服务调用过程中的执行行为进行安全性监控和评估。Specifically, the automotive industry has higher security than consumer electronics, such as the mobile phone industry and the Internet industry. When a service-oriented architecture is used for communication, the client and the service provider are relatively independent, and the client only needs to call If the service performs malicious behaviors, such as leaking private data, altering data and other behaviors that are dangerous to safe driving, it may lead to serious safety accidents. In order to strengthen the service In order to control the safety of the process of execution and reduce the risk, this embodiment designs the service management module and the service trust module to cooperate with each other, so as to solve the security problem based on the service-oriented architecture applied to the automobile. In addition, since the client invokes the service, the currently invoked service is trusted in time, but the invoked service may still invoke another service or multiple services during the execution process, and even the invoked service invokes other services again. The client is uncontrollable, so there is a great risk, and it is necessary to monitor and evaluate the security of the execution behavior during the service invocation process.
具体地,参见图4,客户端根据需求调用服务提供方的服务执行预设任务时,设置于服务提供方的服务管理模块监视服务在执行时的行为;Specifically, referring to FIG. 4 , when the client invokes the service of the service provider to perform the preset task according to the requirements, the service management module arranged on the service provider monitors the behavior of the service during execution;
服务管理模块监视服务以获取预设的事件,然后封装预设的事件和相应的上下文后,发送给设置于服务提供方的服务可信模块。The service management module monitors the service to obtain preset events, and then encapsulates the preset events and the corresponding context, and sends them to the service trusted module set at the service provider.
服务管理模块监视的服务正在执行的行为并将收集服务执行的行为过程形成的反馈信息发送给服务可信模块;The service management module monitors the ongoing behavior of the service and sends the feedback information formed in the process of collecting the behavior of the service execution to the service trust module;
当发现服务执行的行为具有恶意时,服务管理模块暂停服务执行,并向服务可信模块请求许可并等待来自服务可信模块的响应;When the behavior of service execution is found to be malicious, the service management module suspends service execution, requests permission from the service trusted module and waits for a response from the service trusted module;
服务可信模块响应服务可信模块并根据预设策略指示服务管理模块终止服务执行或允许其正常执行或纠正服务的执行行为。The service trusted module responds to the service trusted module and instructs the service management module to terminate the service execution or allow it to execute normally or correct the execution behavior of the service according to the preset policy.
客户端调用服务后,客户端从服务可信模块请求会话标识,请求成功后,服务可信模块将创建一个会话,会话将负责收集相应的会话反馈,客户端和服务管理模块使用请求的会话标识来维护会话并向服务可信模块报告反馈。After the client calls the service, the client requests the session ID from the service trusted module. After the request is successful, the service trusted module will create a session, and the session will be responsible for collecting the corresponding session feedback. The client and the service management module use the requested session ID to maintain the session and report feedback to the service trusted module.
客户端调用服务后,客户端创建一个请求,并将客户标识和会话表示作为标头添加到该请求,调用服务;After the client calls the service, the client creates a request and adds the client ID and session representation as headers to the request, calling the service;
若被客户端调用的服务在执行任务时再调用另一服务,则服务管理模块截获传入的请求并提取客户标识和会话标识以用于进一步的会话反馈;If the service invoked by the client calls another service while performing the task, the service management module intercepts the incoming request and extracts the client ID and session ID for further session feedback;
会话反馈包括:会话标识、元数据、当前服务、被当前服务即将调用的服务;Session feedback includes: session identifier, metadata, current service, and service to be called by the current service;
元数据包括额外的上下文信息;Metadata includes additional contextual information;
调用完成后,客户端通过服务可信模块以获取会话报告,会话报告至少包括会话的综合信任值以及服务执行期间是否违反了预设策略;After the call is completed, the client obtains the session report through the service trust module, and the session report includes at least the comprehensive trust value of the session and whether the preset policy is violated during service execution;
预设策略包括服务执行行为可信度,可信度是动态可变的,可信度的计算依据服务的实际执行执行历史记录、服务信誉、客户评分;The preset policy includes the credibility of the service execution behavior, the credibility is dynamically variable, and the credibility is calculated based on the actual execution history of the service, service reputation, and customer ratings;
服务信誉包括其他服务使用者提供的反馈;Service reputation includes feedback provided by other service users;
传统的可信度都是定性的,及对于一个服务,要么定义为可信服务,要么定义不可信服务,但是车载网络中涉及的功能较为复杂,很难将一个服务定义为可信服务或者不可信服务,因为即使定义为可信服务,其服务在执行过程中如遇到干扰或攻击或不可预知的情况,可能导致恶意的行为,甚至影响车身安全的行为等。The traditional credibility is qualitative, and for a service, either a trusted service or an untrusted service is defined, but the functions involved in the in-vehicle network are more complex, and it is difficult to define a service as a trusted service or an untrusted service. Trust service, because even if it is defined as trusted service, if its service encounters interference or attack or unpredictable situation during the execution process, it may lead to malicious behavior, and even behavior that affects the safety of the vehicle body.
为了解决该问题,本实施对于服务的可信度采取定量化并且动态可调进行计算:In order to solve this problem, this implementation adopts quantitative and dynamically adjustable calculation for the credibility of the service:
可信度另一个评分是客户评分,它可以动态更改服务的评分;信任更新机制可以基于客户端定义的策略。Another score for trustworthiness is the client score, which can dynamically change the service's score; the trust update mechanism can be based on client-defined policies.
基于车载以太网协议ECU作为客户端需要调用基于CAN协议的ECU提供的功能,具体包括:基于车载以太网协议ECU通过SOME/IP协议发送请求信息给服务转化ECU请求调用相应基于CAN协议的ECU转化的服务,服务转化ECU接收到请求后开始启动对应的服务;The ECU based on the in-vehicle Ethernet protocol as a client needs to call the functions provided by the ECU based on the CAN protocol, which specifically includes: based on the in-vehicle Ethernet protocol, the ECU sends the request information to the service conversion ECU through the SOME/IP protocol, and requests to call the corresponding ECU conversion based on the CAN protocol. After receiving the request, the service conversion ECU starts the corresponding service;
服务启动后,服务转化ECU内设有服务转化模块提取服务的有效数据并经CAN协议发送给相应的基于CAN协议的ECU进行进行执行预设任务。After the service is started, a service conversion module is set in the service conversion ECU to extract the valid data of the service and send it to the corresponding CAN protocol-based ECU to perform preset tasks.
车载网络的ECU需要与位于云端的服务器或者与外部设备进行连接进行诊断,因此,车载网络中还设置智能天线,具体参见图2,智能天线与车载以太网交换机相连接,智能天线设有包括:服务配置器,车载以太网协议栈、外部通信接口,其中,服务配置器与车载以太网协议栈、外部通信接口相连接;The ECU of the in-vehicle network needs to be connected to the server in the cloud or with external devices for diagnosis. Therefore, a smart antenna is also set in the in-vehicle network. See Figure 2 for details. The smart antenna is connected to the in-vehicle Ethernet switch. The smart antenna includes: a service configurator, a vehicle-mounted Ethernet protocol stack and an external communication interface, wherein the service configurator is connected with the vehicle-mounted Ethernet protocol stack and an external communication interface;
服务配置器包括:The service configurator includes:
服务转化模块,对接收到来自不同的协议传来的信号进行解析后提取有效数据,并将提取有效数据翻译为服务;The service conversion module extracts valid data after parsing the signals received from different protocols, and translates the extracted valid data into services;
缓存模块,用于缓存外部信息以处理内部网络的可用性;A caching module for caching external information to handle the availability of the internal network;
安全管理模块,用于应用策略并执行服务级别的访问控制;A security management module for applying policies and enforcing service-level access control;
IoT物联网协议,用于与外部设备进行通信的协议,协议包括:MQIT、 CoAP等;IoT IoT protocols, protocols used to communicate with external devices, protocols include: MQIT, CoAP, etc.;
外部通信接口用于与外部设备进行通信。The external communication interface is used to communicate with external devices.
具体地,外部设备根据与需求需要与车载网络节点的ECU进行通信的方法包括:Specifically, the method for the external device to communicate with the ECU of the in-vehicle network node according to the requirements includes:
外部设备与智能天线建立网络连接,具体包括:The external device establishes a network connection with the smart antenna, including:
外部设备通过智能天线的外部通信接口发送访问连接请求,外部通信接口将请求信息发送给设置于服务配置器中的安全管理模块,安全管理模块对请求信息进行判断是否允许外部设备接入车内网络的请求并将信息反馈外部设备通信接口,若同意接入,则建立外部设备与智能天线的连接但并不允许外部设备直接访问车内网络节点的其它ECU;The external device sends an access connection request through the external communication interface of the smart antenna, and the external communication interface sends the request information to the security management module set in the service configurator, and the security management module judges the request information whether to allow the external device to access the in-vehicle network. request and feedback the information to the communication interface of the external device. If the access is approved, the connection between the external device and the smart antenna is established but the external device is not allowed to directly access other ECUs of the in-vehicle network node;
外部设备调用车载网络的节点的服务包括:The services of external devices calling the nodes of the in-vehicle network include:
发送信号给服务转化模块,服务转化模块对信号进行解析后提取有效数据并转化服务,判断服务是控制类型还是数据类型,若为控制类型的应用服务,应用服务作为客户端与为其提供的服务ECU建立通信连接后调用相应的服务实现对目标ECU的功能执行;若为数据类型的服务,此时,服务作为服务提供方,需要与所需服务的客户端建立连接后,客户端订阅服务后,直接向客户端发送数据。Send a signal to the service conversion module, the service conversion module parses the signal, extracts valid data and converts the service, and determines whether the service is a control type or a data type. If it is a control type application service, the application service serves as the client and the service provided for it. After the ECU establishes a communication connection, the corresponding service is called to implement the function execution of the target ECU; if it is a data type service, at this time, the service, as a service provider, needs to establish a connection with the client of the required service. After the client subscribes to the service , sending data directly to the client.
当外部数据传送的数据量大于预设的流量阈值时,例如:用户此时需要打开车载主机,在车内观看电影、听音乐,或者下载大文件,GPS导航升级等,此时传输流量的流量非常大,而车载网络采用基于SOME/IP协议的传输,由于单帧的传输数据大小的限制,大流量传输会占据较多带宽,为了不影响车内网络中涉及低延时、高可行的功能进程的正常运行,传输流量在大于预设阈值的条件下,外部设备的传送的数据暂时缓存到缓存模块中,数据按照先进先出进行排序,利用网络负载空闲时在进行传输数据。When the amount of data transmitted by external data is greater than the preset traffic threshold, for example, the user needs to turn on the vehicle host, watch movies, listen to music, download large files, upgrade GPS navigation, etc. It is very large, and the in-vehicle network adopts the transmission based on the SOME/IP protocol. Due to the limitation of the transmission data size of a single frame, large-traffic transmission will occupy more bandwidth. In order not to affect the low-latency and highly feasible functions in the in-vehicle network In the normal operation of the process, when the transmission traffic is greater than the preset threshold, the data transmitted by the external device is temporarily cached in the cache module, and the data is sorted according to the first in, first out, and the data is transmitted when the network load is idle.
以上所述的仅是本发明的优选实施方式,本发明不限于以上实施例。本领域的技术人员可以清楚,该实施例中的形式不局限于此,同时可调整方式也不局限于此。可以理解,本领域技术人员在不脱离本发明的基本构思的前提下直接导出或联想到的其他改进和变化,均应认为包含在本发明的保护范围之内。The above are only preferred embodiments of the present invention, and the present invention is not limited to the above embodiments. Those skilled in the art can understand that the form in this embodiment is not limited to this, and the adjustable manner is not limited to this. It can be understood that other improvements and changes directly derived or thought of by those skilled in the art without departing from the basic idea of the present invention should be considered to be included within the protection scope of the present invention.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011054782.9A CN112367233B (en) | 2020-09-27 | 2020-09-27 | Vehicle network ECU communication method and device based on service-oriented architecture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011054782.9A CN112367233B (en) | 2020-09-27 | 2020-09-27 | Vehicle network ECU communication method and device based on service-oriented architecture |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112367233A CN112367233A (en) | 2021-02-12 |
CN112367233B true CN112367233B (en) | 2022-04-08 |
Family
ID=74506507
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011054782.9A Active CN112367233B (en) | 2020-09-27 | 2020-09-27 | Vehicle network ECU communication method and device based on service-oriented architecture |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112367233B (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112685008B (en) * | 2020-11-30 | 2024-08-16 | 上海赫千电子科技有限公司 | A service failure control method based on AUTOSAR using service-oriented architecture |
CN113037554B (en) * | 2021-03-11 | 2022-07-29 | 浙江吉利控股集团有限公司 | Communication protocol adaptation method, device, equipment and storage medium |
CN113067855A (en) * | 2021-03-12 | 2021-07-02 | 广州小鹏汽车科技有限公司 | Communication method and device and vehicle |
CN113335018B (en) * | 2021-06-11 | 2022-12-06 | 华东理工大学 | A SOME/IP-based vehicle air-conditioning service calling system |
CN114051040A (en) * | 2021-11-05 | 2022-02-15 | 诚迈科技(南京)股份有限公司 | SOA-based communication architecture and fusion method for vehicle body domain and cockpit domain |
CN114205386B (en) * | 2021-12-06 | 2024-04-12 | 上海赫千电子科技有限公司 | Service architecture-oriented vehicle-mounted network communication method |
CN115913809B (en) * | 2022-09-26 | 2024-05-03 | 重庆长安汽车股份有限公司 | Data distribution communication method, system, computer device and storage medium |
CN115834476A (en) * | 2022-11-16 | 2023-03-21 | 嬴彻星创智能科技(上海)有限公司 | Vehicle-mounted routing device, communication conversion equipment, vehicle control system and vehicle |
CN116566790B (en) * | 2023-04-26 | 2024-05-03 | 坤联数字技术(深圳)有限公司 | Vehicle-mounted distributed service calling system and method |
CN116996551B (en) * | 2023-09-26 | 2024-01-02 | 北京云驰未来科技有限公司 | Vehicle-mounted service control system and method based on SOA central network controller |
CN118138621A (en) * | 2024-03-06 | 2024-06-04 | 小米汽车科技有限公司 | Signal-to-service conversion method, device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103901823A (en) * | 2012-12-25 | 2014-07-02 | 联合汽车电子有限公司 | Vehicle-mounted remote terminal |
WO2017104112A1 (en) * | 2015-12-16 | 2017-06-22 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ | Security processing method and server |
CN109669442A (en) * | 2018-12-25 | 2019-04-23 | 深圳市元征科技股份有限公司 | A kind of method for converting protocol and conversion equipment |
CN110855558A (en) * | 2018-08-21 | 2020-02-28 | 上海博泰悦臻网络技术服务有限公司 | Internet of vehicles gateway and CANoverTCP/IP protocol connection implementation method, ECU and upgrading method |
CN111294768A (en) * | 2020-04-07 | 2020-06-16 | 大连毅无链信息技术有限公司 | Remote vehicle-mounted system and method for fault diagnosis, information acquisition and remote upgrade |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020085422A1 (en) * | 2018-10-24 | 2020-04-30 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ | Onboard network relay device and onboard network relay method |
KR102721297B1 (en) * | 2018-12-26 | 2024-10-25 | 현대자동차주식회사 | Message routing system and method thereof |
CN110083088B (en) * | 2019-03-29 | 2020-12-08 | 上海赫千电子科技有限公司 | Signal control conversion device and signal control conversion method |
CN110460621A (en) * | 2019-09-10 | 2019-11-15 | 上海怿星电子科技有限公司 | A kind of industry ethernet based on SOME/IP agreement and CAN bus data transfer device and system |
-
2020
- 2020-09-27 CN CN202011054782.9A patent/CN112367233B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103901823A (en) * | 2012-12-25 | 2014-07-02 | 联合汽车电子有限公司 | Vehicle-mounted remote terminal |
WO2017104112A1 (en) * | 2015-12-16 | 2017-06-22 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ | Security processing method and server |
CN110855558A (en) * | 2018-08-21 | 2020-02-28 | 上海博泰悦臻网络技术服务有限公司 | Internet of vehicles gateway and CANoverTCP/IP protocol connection implementation method, ECU and upgrading method |
CN109669442A (en) * | 2018-12-25 | 2019-04-23 | 深圳市元征科技股份有限公司 | A kind of method for converting protocol and conversion equipment |
CN111294768A (en) * | 2020-04-07 | 2020-06-16 | 大连毅无链信息技术有限公司 | Remote vehicle-mounted system and method for fault diagnosis, information acquisition and remote upgrade |
Also Published As
Publication number | Publication date |
---|---|
CN112367233A (en) | 2021-02-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112367233B (en) | Vehicle network ECU communication method and device based on service-oriented architecture | |
CN112291124B (en) | Vehicle-mounted network ECU communication method based on SOME/IP protocol | |
US20220385715A1 (en) | Internet of things (iot) adaptation services | |
CN111580995B (en) | Synchronous communication method and system of distributed cloud platform and Internet of things intelligent terminal based on MQTT asynchronous communication scene | |
US9426767B2 (en) | Method, gateway, proxy and system for implementing mobile internet services | |
CN112187903B (en) | Message pushing method and device and message service system | |
CN108810170A (en) | resource allocation method and system | |
EP3783860B1 (en) | Development system and method for vehicle-specific third-party application | |
CN111245776A (en) | Vehicle-mounted data transmission method, device, equipment and storage medium | |
CN116633775B (en) | Container communication method and system of multi-container network interface | |
AU2019382495A1 (en) | Method and device for transmitting V2X message and system | |
CN102143177A (en) | Portal authentication method, Portal authentication device,Portal authentication equipment and Portal authentication system | |
CN107426299A (en) | Realize shared power assist vehicle system server TCP length connection and high concurrent method | |
CN110995829A (en) | Instance calling method and device and computer storage medium | |
CN114374583A (en) | Automobile gateway controller and control method thereof | |
CN113806709A (en) | Method for activating vehicle-mounted machine service, vehicle and readable storage medium | |
CN113254220A (en) | Networked automobile load cooperative control method, device, equipment and storage medium | |
CN114979157B (en) | Load balancing method, system, storage medium and computer based on SOME/IP protocol | |
CN116545757A (en) | Service access management system and method | |
CN110865895B (en) | Access flow control method, device, electronic equipment and storage medium | |
CN112968825A (en) | Message sending method, device, equipment and storage medium | |
Trifunović et al. | Data Exchange Interfaces in Automotive SOA | |
CN102752304A (en) | Method and system for preventing semi-connection attack | |
CN118631525B (en) | Data communication protection method and device | |
Kim et al. | Entry Merging Method for Load Reduction on SOME/IP Service Discovery |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: Room 403, block a, 1018 dongsanliqiao Road, Pudong New Area, Shanghai 200125 Patentee after: Heqian Automotive Technology (Shenzhen) Co.,Ltd. Country or region after: China Address before: Room 403, block a, 1018 dongsanliqiao Road, Pudong New Area, Shanghai 200125 Patentee before: SHANGHAI HINGE ELECTRONIC TECHNOLOGIES Co.,Ltd. Country or region before: China |