A method, device and vehicle for processing vehicle controller area network CAN signal
By introducing a gateway into the vehicle, the CAN signal is serviced and converted into Ethernet communication data, the problem of singularity of CAN signal communication between ECUs in the vehicle is solved, and diversified communication methods and efficient Ethernet communication are realized.
Patent Information
- Application Number
- CN202211352882.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-01
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-11-01
AI Technical Summary
How to realize the CAN signal service of multiple ECUs in a vehicle to meet the needs of communication between vehicle ECUs through Ethernet.
The CAN signal is serviced through the gateway, the identification of the target CAN signal is determined, and the service interface corresponding to the target CAN signal is determined based on the identification and preset mapping relationship, thereby obtaining communication data in the Ethernet communication method.
It realizes diversified communication methods between ECUs in vehicles, solves the problem of singleness of ECU communication methods, and improves the efficiency of Ethernet communication.
Smart Images

Figure CN115941380B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the vehicle field, and more specifically, to a method, device and vehicle for processing vehicle controller area network (CAN) signals in the vehicle field. Background Art
[0002] At present, in the vehicle industry, with the continuous development and improvement of network technology, the functions of vehicles are becoming more and more abundant. Multiple electronic control units (ECUs) in the vehicle can communicate through various communication methods provided on the vehicle to control the vehicle to achieve different functions. Several common communication methods in vehicles include: Controller Area Network (CAN) bus communication, Local Interconnect Network (LIN) bus communication, Flex Ray bus communication, Media Oriented Systems Transport (MOST) bus communication, Ethernet communication, etc.
[0003] For example, currently, CAN bus communication is mainly used in vehicles to achieve data interaction. However, with the rapid development of Ethernet communication technology, more and more vehicles are beginning to achieve data interaction through Ethernet communication. CAN bus communication is signal-oriented communication, and Ethernet communication is service-oriented communication. Therefore, when multiple ECUs in a vehicle use Ethernet communication, CAN signals need to be converted into Ethernet data so that vehicle ECUs can communicate through Ethernet.
[0004] In summary, how to realize the CAN signal service of multiple ECUs in the vehicle so that the vehicle ECUs can communicate through Ethernet has become an urgent problem to be solved. Summary of the invention
[0005] The present application provides a method, device and vehicle for processing vehicle controller area network (CAN) signals. The method can service the CAN signals through a gateway and obtain communication data of the Ethernet communication method corresponding to the CAN signals, so that the ECU in the vehicle can communicate through the Ethernet communication method in addition to the common CAN communication method, thereby providing a variety of communication methods for the ECU in the vehicle.
[0006] In a first aspect, a method for processing a vehicle controller area network (CAN) signal is provided, the method being executed by a gateway, the method comprising: receiving a target CAN signal sent by a first ECU; determining an identifier of the target CAN signal; determining a target service interface corresponding to the target CAN signal based on the identifier of the target CAN signal and a first mapping relationship, the first mapping relationship being used to indicate a correspondence between the identifier of the CAN signal and the identifier of the service interface; determining communication data corresponding to the target CAN signal based on the target service interface, the communication data being used to enable multiple ECUs to communicate via the gateway in an Ethernet communication manner.
[0007] In the above technical scheme, a method for processing CAN signals is proposed, specifically, after obtaining the target CAN signal sent by the ECU in the vehicle, the identifier of the target CAN signal is determined, and further according to the identifier of the target CAN signal and the first mapping relationship, the service interface corresponding to the target CAN signal is determined, wherein the first mapping relationship is used to indicate the correspondence between the identifier of the CAN signal and the identifier of the service interface. In the present application, through the correspondence between the identifier of the CAN signal in the gateway and the identifier of the service interface, the gateway can quickly determine the service interface corresponding to the target CAN signal after receiving the target CAN signal, thereby improving the efficiency of CAN signal processing. Finally, according to the service interface corresponding to the target CAN signal, the communication data corresponding to the target CAN signal is obtained. Among them, the communication data is used to enable multiple ECUs to communicate through the gateway in Ethernet communication mode. Combined with the service interface obtained in the above steps, in this process, the communication data corresponding to the target CAN signal can be directly determined according to the service interface corresponding to the target CAN signal, and the effect of converting the CAN signal into the communication data corresponding to the Ethernet communication mode is achieved, thereby enriching the types of communication modes of the ECU in the vehicle, solving the singleness of the ECU communication mode, and achieving the effect of making the ECU more efficient when communicating using the Ethernet communication mode.
[0008] In combination with the first aspect, in some possible implementations, the target service interface corresponding to the target CAN signal is determined based on the identifier of the target CAN signal and the first mapping relationship, including: determining the identifier of the target CAN message corresponding to the target CAN signal based on the identifier of the target CAN signal, wherein a CAN message includes at least one CAN signal; determining the target service corresponding to the target CAN message based on the identifier of the target CAN message and the second mapping relationship, the second mapping relationship being used to indicate the correspondence between the identifier of the CAN message and the identifier of the service, the service including at least one service interface; determining the identifier of the at least one service interface based on the identifier of the service and the at least one service interface corresponding to the service; determining the target service interface corresponding to the target CAN signal based on the identifier of the target service, the identifier of the at least one service interface and the identifier of the target CAN signal.
[0009] In the above technical scheme, a method for determining the target service interface is proposed, specifically, based on the identifier of the target CAN signal, the identifier of the target CAN message corresponding to the target CAN signal is determined, and the target service corresponding to the target CAN message is obtained according to the identifier of the target CAN message and the second mapping relationship, wherein the second mapping relationship is used to indicate the correspondence between the identifier of the CAN message and the identifier of the service. Further, the identifiers of all service interfaces corresponding to the service are determined according to the identifier of the service, and finally, the service interface corresponding to the target CAN signal is obtained according to the identifier of the target service, each service interface, and the identifier of the target CAN signal. Through the relationship between the identifier of the CAN message and the identifier of the service, and the hierarchical correspondence between the identifier of the service and the identifier of the service interface, the CAN signal is converted into communication data corresponding to the Ethernet communication method in a step-by-step manner, thereby ensuring the accuracy and efficiency of the target CAN signal in the process of converting into communication data.
[0010] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the method also includes: receiving a first request sent by the second ECU, the first request being used to request acquisition of communication data corresponding to the target CAN signal; and in response to the first request, sending the communication data corresponding to the target CAN signal to the second ECU.
[0011] In the above technical solution, after obtaining the communication data of the target CAN signal, the gateway can also send the communication data corresponding to the target CAN signal to other ECUs in the vehicle by receiving the first request, thereby achieving the effect of communication between multiple ECUs in the vehicle in Ethernet communication mode.
[0012] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the method also includes: determining the service and at least one service interface corresponding to the service based on the parameter information of the CAN signal, wherein the parameter information includes any one or more of the sending type of the CAN signal, the signal type of the CAN signal, and the device type corresponding to the CAN signal.
[0013] In the above technical solution, the service and multiple service interfaces in the service can be determined in advance through the parameter information of the CAN signal. Therefore, when the CAN signal is received, the service interface corresponding to each CAN signal can be determined according to the pre-set service and service interface. The above-mentioned method of pre-configuring services and service interfaces realizes the systematic management of CAN signals and improves the efficiency of converting CAN signals to the corresponding communication data of Ethernet.
[0014] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the connection method between the ECU and the gateway includes any one or more connection methods of CAN connection, Ethernet connection, local area interconnect network LIN connection, media oriented system transmission MOST connection, and FlexRay connection.
[0015] In combination with the first aspect and the above implementations, in some possible implementations, the type of the service interface includes any one or more of a method interface, a property interface, and an event interface.
[0016] In summary, the present application proposes a method for processing CAN signals, specifically, after obtaining the target CAN signal sent from the ECU in the vehicle, determining the identifier of the target CAN signal, and further determining the service interface corresponding to the target CAN signal according to the identifier of the target CAN signal and the first mapping relationship, wherein the first mapping relationship is used to indicate the correspondence between the identifier of the CAN signal and the identifier of the service interface. In the present application, through the correspondence between the identifier of the CAN signal in the gateway and the identifier of the service interface, the gateway can quickly determine the service interface corresponding to the target CAN signal after receiving the target CAN signal, thereby improving the efficiency of CAN signal processing. Finally, according to the service interface corresponding to the target CAN signal, the communication data corresponding to the target CAN signal is obtained. Among them, the communication data is used to enable multiple ECUs to communicate through the gateway in an Ethernet communication mode. Combined with the service interface obtained in the above steps, in this process, the communication data corresponding to the target CAN signal can be directly determined according to the service interface corresponding to the target CAN signal, realizing the effect of converting the CAN signal into the communication data corresponding to the Ethernet communication mode, thereby enriching the types of communication modes of the ECU in the vehicle, solving the singleness of the ECU communication mode, and achieving the effect of making the ECU more efficient when communicating using the Ethernet communication mode.
[0017] Specifically, the present application proposes a method for determining a target service interface, which is specifically based on the identifier of a target CAN signal, determining the identifier of a target CAN message corresponding to the target CAN signal, and obtaining the target service corresponding to the target CAN message according to the identifier of the target CAN message and a second mapping relationship, wherein the second mapping relationship is used to indicate the correspondence between the identifier of the CAN message and the identifier of the service. Further, the identifiers of all service interfaces corresponding to the service are determined according to the identifier of the service, and finally, the service interface corresponding to the target CAN signal is obtained according to the identifier of the target service, the identifier of each service interface and the identifier of the target CAN signal. Through the relationship between the identifier of the CAN message and the identifier of the service, and the hierarchical correspondence between the identifier of the service and the identifier of the service interface, the CAN signal is converted into communication data corresponding to the Ethernet communication method in a step-by-step manner, thereby ensuring the accuracy and efficiency of the target CAN signal in the process of converting into communication data.
[0018] Furthermore, after obtaining the communication data of the target CAN signal, the gateway can also send the communication data corresponding to the target CAN signal to other ECUs in the vehicle by receiving the first request, thereby achieving the effect of communication between multiple ECUs in the vehicle in an Ethernet communication manner.
[0019] In this application, multiple services and multiple service interfaces in the services can be determined in advance through the parameter information of the CAN signal. Therefore, when a CAN signal is received, the service interface corresponding to each CAN signal can be determined according to the pre-set services and service interfaces. The above-mentioned method of pre-configuring services and service interfaces realizes the systematic management of CAN signals and improves the efficiency of converting CAN signals to the corresponding communication data of Ethernet.
[0020] In a second aspect, a device for processing a vehicle controller area network CAN signal is provided, the device being included in a gateway, the device comprising: a receiving module for receiving a target CAN signal sent by a first ECU; a first determining module for determining an identifier of the target CAN signal; determining a target service interface corresponding to the target CAN signal based on the identifier of the target CAN signal and a first mapping relationship, the first mapping relationship being used to indicate a correspondence between the identifier of the CAN signal and the identifier of the service interface; determining communication data corresponding to the target CAN signal based on the target service interface, the communication data being used to enable multiple ECUs to communicate via the gateway in an Ethernet communication manner.
[0021] In combination with the second aspect, in some possible implementations, the first determination module is specifically used to: determine the identifier of the target CAN message corresponding to the target CAN signal according to the identifier of the target CAN signal, wherein a CAN message includes at least one CAN signal; determine the target service corresponding to the target CAN message according to the identifier of the target CAN message and the second mapping relationship, the second mapping relationship is used to indicate the correspondence between the identifier of the CAN message and the identifier of the service, and the service includes at least one service interface; determine the identifier of the at least one service interface according to the identifier of the service and the at least one service interface corresponding to the service; determine the target service interface corresponding to the target CAN signal according to the target service, the identifier of the at least one service interface and the identifier of the target CAN signal.
[0022] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the device also includes: a processing module, used to receive a first request sent by the second ECU, the first request is used to request to obtain the communication data corresponding to the target CAN signal; in response to the first request, the communication data corresponding to the target CAN signal is sent to the second ECU.
[0023] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the device also includes: a second determination module, used to determine the service and at least one service interface corresponding to the service based on the parameter information of the CAN signal, wherein the parameter information includes any one or more of the sending type of the CAN signal, the signal type of the CAN signal, and the device type corresponding to the CAN signal.
[0024] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the connection method between the ECU and the gateway includes any one or more of CAN connection, Ethernet connection, local area interconnect network LIN connection, media oriented system transmission MOST connection, and FlexRay connection.
[0025] In combination with the second aspect and the above implementations, in some possible implementations, the type of the service interface includes any one or more of a method interface, a property interface, and an event interface.
[0026] In a third aspect, a gateway is provided, the gateway comprising: a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the gateway executes the method in the first aspect or any possible implementation of the first aspect.
[0027] In a fourth aspect, a vehicle is provided, the vehicle comprising a gateway for executing the method in the first aspect or any possible implementation of the first aspect,
[0028] In a fifth aspect, a computer program product is provided, which includes: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0029] In a sixth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of a scenario of communication between vehicle ECUs provided in an embodiment of the present application;
[0031] Figure 2 It is a structural diagram of a CAN message provided in an embodiment of the present application;
[0032] Figure 3 It is a structural diagram of a service provided by an embodiment of the present application;
[0033] Figure 4 is a schematic flow chart of a method for processing a vehicle controller area network CAN signal provided in an embodiment of the present application;
[0034] Figure 5 It is a structural schematic diagram of a device for processing vehicle controller area network CAN signals provided in an embodiment of the present application;
[0035] Figure 6 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0037] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0038] Figure 1 This is a schematic diagram of a scenario of communication between vehicle ECUs provided in an embodiment of the present application.
[0039] For example, Figure 1 As shown, Figure 1 The system includes a gateway 101, an ECU 102 and an ECU 103. The ECU 102 and the ECU 103 are connected to the gateway 101 respectively, and the ECU 102 and the ECU 103 can realize mutual data transmission through the gateway 101.
[0040] Optionally, the gateway 101 may be a signal to service (S2S) gateway.
[0041] Optionally, the connection mode between ECU 102 and ECU 103 and gateway 101 includes any one of CAN connection, Ethernet connection, LIN connection, MOST connection, and Flex Ray connection.
[0042] In one possible scenario, ECU 102 can be connected to gateway 101 via CAN, and ECU 103 can be connected to gateway 101 via Ethernet. The following embodiment of the present application takes ECU 102 connected to gateway 101 via CAN, and ECU 103 connected to gateway 101 via Ethernet as an example to introduce in detail a method for processing vehicle controller area network CAN signals provided in the embodiment of the present application.
[0043] It should be understood that CAN communication is a signal-oriented communication mode, and Ethernet communication is a service-oriented communication. Before introducing a method for processing a vehicle controller area network CAN signal provided in an embodiment of the present application, a brief introduction is first given to the relationship between CAN messages, CAN signals, services, and service interfaces in the embodiment of the present application.
[0044] Figure 2 It is a structural diagram of a CAN message provided in an embodiment of the present application.
[0045] For example, Figure 2 As shown, in order to meet the various needs of users during driving and protect the safety of users' lives and property, multiple ECUs configured in the vehicle can be used to obtain and process various driving parameters during the vehicle's driving process, so as to process and report abnormal data during the vehicle's driving process in a timely manner.
[0046] Among them, the multiple ECUs in the vehicle include the Engine Control Module (ECM), the Battery Management System (BMS) controller, the Transmission Control Unit (TCU, also known as the transmission controller), the Hybrid Control Unit (HCU), the Battery Management System (BMS, also known as the "energy storage system"), the Air Conditioning Controller (Automatic Temperature Control, ATC) and other ECUs.
[0047] like Figure 2 As shown, combined Figure 1 ECU102 can be any one of the above multiple ECUs. For example, if ECU102 is ATC, then ATC can obtain various information such as the temperature, status information, air volume, current working mode, etc. of the air conditioner in the vehicle through the data collected by the sensors in the vehicle during the driving process of the vehicle, and send this information to the gateway 101 in the form of CAN signals. Figure 2 CAN signal 2011, CAN signal 2012, CAN signal 2013 and CAN signal 2014.
[0048] However, since CAN signals cannot be sent separately, when ATC sends the air conditioning temperature, status information, air volume, and current working mode to the gateway 101, the CAN signals 2011, 2012, 2013, and 2014 can be sent in the form of a CAN message 201 (or a frame of CAN message). In other words, a CAN message can include multiple CAN signals.
[0049] Furthermore, when other ECUs need to obtain ATC's air conditioning temperature, status information, air volume, current working mode and other information, they can send a request to the gateway 101. Based on the request, the gateway 101 can send the above-mentioned ATC's air conditioning temperature, status information, air volume, current working mode and other information to other ECUs.
[0050] Currently, with the continuous development of Ethernet communication, more and more ECUs in vehicles begin to adopt service-oriented Ethernet communication.
[0051] Figure 3 It is a structural diagram of a service provided by an embodiment of the present application.
[0052] For example, Figure 3As shown, combined Figure 1 , Figure 3 The ECU 103 in the example is connected to the gateway 101 via Ethernet. Assuming that the ECU 103 is an ECM, the ECM may have the following functions: for example, obtaining the engine speed, the engine working state, and adjusting the engine speed.
[0053] When the ECU in the vehicle communicates using Ethernet communication, the functions of the ECM can be uniformly represented by service 301. In service 301, the above different functions of the ECM can be stored in different service interfaces in different services 301, for example, service interface 3011 is used to implement the function of sending the engine speed; service interface 3012 is used to implement the function of reporting the working status of the engine; service interface 3013 is used to implement the function of adjusting the engine speed.
[0054] Furthermore, the ECM can send these service data to the gateway 101. When other ECUs need to obtain the current engine speed, they can send a request to the gateway 101 to call the service interface 3011 in the service 301 to implement the engine data acquisition process. The same applies to other service interfaces.
[0055] Combination Figure 2 and Figure 3 In the process of communication between multiple ECUs in a vehicle, when the communication connection methods corresponding to the multiple ECUs in the vehicle are different (for example, ECU102 is connected to the gateway 101 via CAN, and ECU103 is connected to the gateway 101 via Ethernet), if ECU103 needs to obtain data from ECU102, after receiving the CAN signal from ECU102, the gateway 101 first needs to convert the CAN signal into Ethernet data that can be received by ECU103 before sending the data from ECU102 to ECU103.
[0056] Figure 4 FIG. 1 is a schematic flow chart of a method for processing a vehicle local area network CAN signal provided in an embodiment of the present application. It should be understood that the method can be applied to Figure 1 In the scenario shown, Figure 1 The gateway 101 in is executed.
[0057] For example, Figure 4 As shown, the method 400 includes:
[0058] 401, receiving a target CAN signal sent by a first ECU.
[0059] It should be understood that in the embodiment of the present application, the first ECU is in communication connection with the gateway. Therefore, the gateway can receive the target CAN signal sent by the first ECU. Optionally, the first ECU is any one of the multiple ECUs in the vehicle.
[0060] Optionally, for any ECU in the vehicle, the connection method between the ECU and the gateway includes any one or more of CAN connection, Ethernet connection, LIN connection, MOST connection, and Flex Ray connection.
[0061] It should also be understood that in the embodiment of the present application, before servicing the target CAN signal, the engineer can pre-set multiple groups of correspondences between the identifiers of the CAN signal and the identifiers of the service interface in the gateway based on the parameter information of the multiple CAN signals previously obtained, and store these correspondences as the first mapping relationship. In the actual CAN servicing process, after receiving the target CAN signal, the gateway can directly find the service interface corresponding to the target CAN signal based on the pre-stored first mapping relationship.
[0062] Optionally, the parameter information of the CAN signal includes the sending type of the CAN signal, the signal type of the CAN signal, and the device type corresponding to the CAN signal.
[0063] Optionally, the transmission type of the CAN signal includes any one or more transmission types such as cyclic transmission, event transmission, cyclic and on event transmission, enable transmission, and cyclic and if active transmission.
[0064] Optionally, the device types corresponding to CAN include air conditioning, seats, engines, etc.
[0065] For example, CAN signals can be classified according to different devices. For example, all CAN signals in the air conditioner (or ATC) correspond to multiple different services; all CAN signals corresponding to the seat (or seat controller) correspond to multiple different services. In the different services corresponding to the air conditioner, different services can represent different functions, such as temperature adjustment corresponding to service 1, air volume adjustment corresponding to service 2, etc. Then, in service 1, according to the different specific CAN signal types (for example, some CAN signals represent the current temperature of the air conditioner; some CAN signals represent the working mode of the air conditioner (such as cooling, heating or air purification, etc.), different CAN signals are set as different service interfaces in one service.
[0066] Optionally, the type of the service interface includes any one or more of a method interface, a field interface, and an event interface, wherein Event indicates event sending, Method indicates method calling, and Field indicates field processing.
[0067] It should be understood that for different types of service interfaces, Method and Event service interfaces are mainly service interfaces for actions. Method is a service interface used to request a certain action, and Event is a service interface used to notify the other party that a certain action has occurred. Field is mainly a service interface used to read and write certain data.
[0068] For example, for ATC, some basic functions that can be provided include: turning the air conditioner on or off; increasing or decreasing the air volume of the air conditioner; informing the current ambient temperature; informing the current target temperature, etc.
[0069] The above functions of "turning the air conditioner on or off, increasing or decreasing the air volume of the air conditioner" can be set to correspond to two Method interfaces; the above function of "notifying the current temperature" can be represented by an Event interface, so that the current ambient temperature can be continuously reported; the above function of "notifying the current target temperature" can be represented by a Field interface, because the target temperature can not only be set but also read.
[0070] By analogy, through the above setting process, the corresponding relationship between the identifiers of the CAN signals of multiple different ECUs and the identifiers of multiple service interfaces can be obtained.
[0071] Table 1 is a schematic table of the correspondence between a CAN signal and a service interface provided in an embodiment of the present application.
[0072] Table 1 - List of correspondence between CAN signals and service interfaces
[0073]
[0074] For example, as shown in Table 1, there is not a one-to-one relationship between the service interface and the CAN signal. One service interface can correspond to multiple CAN signals, and one CAN signal can also correspond to different service interfaces. The specific setting method can be dynamically adjusted by the administrator according to the actual situation.
[0075] In the above technical solution, the service and multiple service interfaces in the service can be determined in advance through the parameter information of the CAN signal. Therefore, when the CAN signal is received, the service interface corresponding to each CAN signal can be determined according to the pre-set service and service interface. The above-mentioned method of pre-configuring services and service interfaces realizes the systematic management of CAN signals and improves the efficiency of converting CAN signals to the corresponding communication data of Ethernet.
[0076] Furthermore, when the ECU is connected to the gateway via CAN, the gateway may receive the target CAN signal sent by the ECU, and obtain the target service interface corresponding to the target CAN signal according to the above-mentioned preset multiple groups of corresponding relationships.
[0077] 402, determine the identifier of the target CAN signal.
[0078] It should be understood that each CAN signal can correspond to a unique identifier when it is sent to the gateway, so the gateway can determine the identifier of the target CAN signal when receiving the target CAN signal. The identifier of the CAN signal can be used to indicate the data type corresponding to the CAN signal and which CAN message it specifically belongs to.
[0079] It should also be understood that CAN messages are also called CAN messages, which refer to frames in which a sending unit transmits data to a receiving unit. CAN messages can transmit multiple data from a sending unit to a receiving unit via the CAN bus. Multiple data are reflected on the CAN bus as multiple CAN signals.
[0080] 403 , determining a target service interface corresponding to the target CAN signal according to the identifier of each CAN signal and a first mapping relationship, wherein the first mapping relationship is used to indicate a corresponding relationship between the identifier of the CAN signal and the identifier of the service interface.
[0081] For each CAN signal received, the gateway can determine the service interface corresponding to each CAN signal according to the identifier of each CAN signal and the preset multiple groups of corresponding relationships stored in the gateway.
[0082] In a possible implementation, since each CAN signal corresponds to a CAN message or a CAN message, and each service interface has a corresponding unique service, and each service corresponds to a unique identifier. When determining the target interface corresponding to the target CAN signal according to the identifier of the target CAN signal and the first mapping relationship, it specifically includes:
[0083] Determine, according to the identifier of the target CAN signal, an identifier of a target CAN message corresponding to the target CAN signal, wherein a CAN message includes at least one CAN signal;
[0084] Determine a target service corresponding to the target CAN message according to the identifier of the target CAN message and the second mapping relationship, the second mapping relationship is used to indicate the correspondence between the identifier of the CAN message and the identifier of the service, and the service includes at least one service interface;
[0085] Determine, according to the identifier of the service and at least one service interface corresponding to the service, an identifier of at least one service interface;
[0086] A target service interface corresponding to the target CAN signal is determined according to the target service, the identifier of at least one service interface and the identifier of the target CAN signal.
[0087] After receiving the target CAN signal, in the embodiment of the present application, the CAN message to which the target CAN signal belongs and the identifier of the CAN message can be first determined according to the identifier of the target CAN signal. Since each CAN message corresponds to a different service, the target service corresponding to the target CAN message is determined according to the correspondence between the identifier of the CAN message and the identifier of the service. Further, the target service interface corresponding to the target CAN signal is determined by combining the identifier of the service, the identifiers of all service interfaces corresponding to the service, and the identifier of the target CAN signal.
[0088] In the above technical scheme, a method for determining the target service interface is proposed, specifically, based on the identifier of the target CAN signal, the identifier of the target CAN message corresponding to the target CAN signal is determined, and the target service corresponding to the target CAN message is obtained according to the identifier of the target CAN message and the second mapping relationship, wherein the second mapping relationship is used to indicate the correspondence between the identifier of the CAN message and the identifier of the service. Further, the identifiers of all service interfaces corresponding to the service are determined according to the identifier of the service, and finally, the service interface corresponding to the target CAN signal is obtained according to the identifier of the target service, the identifier of each service interface and the identifier of the target CAN signal. Through the relationship between the identifier of the CAN message and the identifier of the service, and the hierarchical correspondence between the identifier of the service and the identifier of the service interface, the CAN signal is converted into communication data corresponding to the Ethernet communication method in a step-by-step manner, which ensures the accuracy and efficiency of the target CAN signal in the process of converting into communication data.
[0089] 404 , determining communication data corresponding to the target CAN signal according to the target service interface, where the communication data is used to enable multiple ECUs to communicate via a gateway in an Ethernet communication manner.
[0090] According to step 403, the target service interface corresponding to the target CAN signal can be determined, and according to the target service interface, the communication data corresponding to the target CAN signal, ie, Ethernet data, can be obtained.
[0091] Furthermore, when other ECUs in the vehicle need to obtain the Ethernet data corresponding to the target CAN signal stored in the gateway, they can also obtain it by sending a request to the gateway, including:
[0092] receiving a first request sent by a second ECU, where the first request is used to request to obtain communication data corresponding to a target CAN signal;
[0093] In response to the first request, the communication data corresponding to the target CAN signal is sent to the second ECU.
[0094] Specifically, if other ECUs (second ECUs) in the vehicle are connected to the gateway via Ethernet and need to obtain communication data corresponding to the target CAN signal of the first ECU, the gateway can send the communication data corresponding to the target CAN signal to the second ECU via Ethernet communication.
[0095] In the above technical solution, after obtaining the communication data of the target CAN signal, the gateway can also send the communication data corresponding to the target CAN signal to other ECUs in the vehicle by receiving the first request, thereby achieving the effect of communication between multiple ECUs in the vehicle in Ethernet communication mode.
[0096] It should be understood that in the embodiment of the present application, after the gateway has serviced the CAN signal, it can also store the original CAN signal. When receiving a data request sent by other ECUs, the corresponding data is sent to other ECUs according to the connection mode of the ECU sending the request. For example, if the other ECU sending the request is also CAN connected, the gateway sends the CAN signal to the other ECU. If the ECU sending the request is Ethernet connected, the gateway sends the serviced Ethernet data to the other ECU. Similarly, if the data received by the gateway is Ethernet data, the Ethernet data can also be converted into a CAN signal and sent to other ECUs connected by CAN. The above methods can all serve as the protection scope of this application.
[0097] Figure 5 : is a schematic diagram of a structure of a device for processing vehicle controller area network CAN signals provided in an embodiment of the present application, the device is applied to Figure 1 In the gateway 101 shown.
[0098] For example, Figure 5 As shown, the device 500 includes:
[0099] The receiving module 501 is used to receive the target CAN signal sent by the ECU;
[0100] The first determination module 502 is used to determine the identifier of the target CAN signal; determine the target service interface corresponding to the target CAN signal based on the identifier of the target CAN signal and the first mapping relationship, and the first mapping relationship is used to indicate the correspondence between the identifier of the CAN signal and the identifier of the service interface; determine the communication data corresponding to the target CAN signal based on the target service interface, and the communication data is used to enable multiple ECUs to communicate through the gateway in Ethernet communication mode.
[0101] In one possible implementation, the first determination module 502 is specifically used to: determine the identifier of the target CAN message corresponding to the target CAN signal according to the identifier of the target CAN signal, wherein each CAN message includes at least one CAN signal; determine the target service corresponding to the target CAN message according to the identifier of the target CAN message and the second mapping relationship, wherein the second mapping relationship is used to indicate the correspondence between the identifier of the CAN message and the identifier of the service, and the service includes at least one service interface; determine the identifier of the at least one service interface according to the identifier of the service and the at least one service interface corresponding to the service; determine the target service interface corresponding to the target CAN signal according to the identifier of the target service, the identifier of the at least one service interface and the identifier of the target CAN signal.
[0102] Optionally, the device also includes: a processing module, used to receive a first request sent by the first ECU, the first request being used to request acquisition of communication data corresponding to the target CAN signal; and in response to the first request, sending the communication data corresponding to the target CAN signal to the first ECU.
[0103] Optionally, the device also includes: a second determination module, used to determine the service and at least one service interface corresponding to the service based on parameter information of the CAN signal, wherein the parameter information includes any one or more of the sending type of the CAN signal, the signal type of the CAN signal, and the device type corresponding to the CAN signal.
[0104] In a possible implementation, the connection mode between the ECU and the gateway includes any one or more of a CAN connection, an Ethernet connection, a local area interconnect network LIN connection, a media oriented system transmission MOST connection, and a Flex Ray connection.
[0105] In a possible implementation, the type of the service interface includes any one or more of a method interface, a property interface, and an event interface.
[0106] Figure 6 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application.
[0107] For example, Figure 6As shown, combined Figure 1 The vehicle 600 includes Figure 1 The gateway 101 includes: a memory 601 and a processor 602, wherein the memory 601 stores an executable program code 6011, and the processor 602 is used to call and execute the executable program code 6011 to perform a method for processing a vehicle controller area network CAN signal.
[0108] In this embodiment, the functional modules of the vehicle can be divided according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0109] In the case of dividing each functional module according to each function, the gateway may include: a receiving module, a first determining module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.
[0110] The vehicle provided in this embodiment is used to execute the above-mentioned method for processing vehicle controller area network CAN signals, and thus can achieve the same effect as the above-mentioned implementation method.
[0111] In the case of an integrated unit, the vehicle may include a processing module and a storage module. The processing module may be used to control and manage the actions of the vehicle. The storage module may be used to support the vehicle to execute mutual program codes and data.
[0112] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits disclosed in the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.
[0113] This embodiment also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer, the computer executes the above-mentioned related method steps to implement a method for processing a vehicle controller area network CAN signal in the above-mentioned embodiment.
[0114] This embodiment also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement a method for processing a vehicle controller area network CAN signal in the above-mentioned embodiment.
[0115] Among them, the vehicle, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0116] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0117] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0118] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for processing vehicle controller area network (CAN) signals, characterized in that: The method is performed by a gateway, and the method includes: Receiving a target CAN signal sent by a first ECU; Determining an identification of the target CAN signal; Determine a target service interface corresponding to the target CAN signal according to the identifier of the target CAN signal and a first mapping relationship, wherein the first mapping relationship is used to indicate a corresponding relationship between the identifier of the CAN signal and the identifier of the service interface; Determining, according to the target service interface, communication data corresponding to the target CAN signal, wherein the communication data is used to enable multiple ECUs to communicate via the gateway in an Ethernet communication manner; Wherein, determining the target service interface corresponding to the target CAN signal according to the identifier of the target CAN signal and the first mapping relationship includes: Determine, according to the identifier of the target CAN signal, an identifier of a target CAN message corresponding to the target CAN signal, wherein a CAN message includes at least one CAN signal; Determine a target service corresponding to the target CAN message according to the identifier of the target CAN message and a second mapping relationship, wherein the second mapping relationship is used to indicate a correspondence between the identifier of the CAN message and the identifier of the service, wherein the service includes at least one service interface; Determining an identifier of the at least one service interface according to an identifier of the service and at least one service interface corresponding to the service; A target service interface corresponding to the target CAN signal is determined according to the target service, the identifier of the at least one service interface and the identifier of the target CAN signal.
2. The method according to claim 1, characterized in that: The method further comprises: receiving a first request sent by a second ECU, wherein the first request is used to request to obtain communication data corresponding to the target CAN signal; In response to the first request, the communication data corresponding to the target CAN signal is sent to the second ECU.
3. The method according to claim 1, characterized in that The method further comprises: The service and at least one service interface corresponding to the service are determined according to parameter information of the CAN signal, wherein the parameter information includes any one or more of a sending type of the CAN signal, a signal type of the CAN signal, and a device type corresponding to the CAN signal.
4. The method according to claim 1, characterized in that The connection mode between the ECU and the gateway includes any one or more of CAN connection, Ethernet connection, local area interconnect network LIN connection, media-oriented system transmission MOST connection, and Flex Ray connection.
5. The method according to claim 1, characterized in that The types of service interfaces include any one or more of method interfaces, property interfaces, and event interfaces.
6. A device for processing vehicle controller area network (CAN) signals, characterized in that: The device is applied to a gateway, and the device includes: A receiving module, used for receiving a target CAN signal sent by the first ECU; a first determination module, configured to determine the identifier of the target CAN signal; determine the target service interface corresponding to the target CAN signal according to the identifier of the target CAN signal and a first mapping relationship, wherein the first mapping relationship is used to indicate the correspondence between the identifier of the CAN signal and the identifier of the service interface; determine the communication data corresponding to the target CAN signal according to the target service interface, wherein the communication data is used to enable multiple ECUs to communicate in an Ethernet communication manner through a gateway; Wherein, the first determining module is specifically used for: Determine, according to the identifier of the target CAN signal, an identifier of a target CAN message corresponding to the target CAN signal, wherein a CAN message includes at least one CAN signal; Determine a target service corresponding to the target CAN message according to the identifier of the target CAN message and a second mapping relationship, wherein the second mapping relationship is used to indicate a correspondence between the identifier of the CAN message and the identifier of the service, wherein the service includes at least one service interface; Determining an identifier of the at least one service interface according to an identifier of the service and at least one service interface corresponding to the service; A target service interface corresponding to the target CAN signal is determined according to the target service, the identifier of the at least one service interface and the identifier of the target CAN signal.
7. A gateway, characterized in that: The gateway comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the gateway executes the method according to any one of claims 1 to 5.
8. A vehicle, characterized in that: The vehicle comprises a gateway for performing the method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Apparatus for monitoring status of ECU based on can communication in heterogeneous network and method thereof
KR1020140080838A