Interaction method of CAN network interface of automobile controller and related product
By obtaining and parsing the data storage address of the input signal in the CAN network interface of the automotive controller, extracting and analyzing the array data, and realizing data type conversion and mapping of physical values, the problem of low software development efficiency caused by the CAN network interface interaction method in the prior art is solved, and maintenance costs and error rates are reduced.
Patent Information
- Application Number
- CN202311413517.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2025-04-29
AI Technical Summary
In the interactive methods of existing CAN network interfaces, the interaction between the application layer and the underlying layer is to directly call the interface function of a single information, which causes frequent changes to the underlying interface function and application layer model when the DBC signal changes, which increases maintenance costs and error rates and reduces software development efficiency.
By obtaining the input signal sent by the external controller, and sending the data storage address corresponding to the input signal to the application layer based on the underlying layer of the CAN, extracting the array data corresponding to the input signal based on the data storage address, analyzing the array data, obtaining the physical value corresponding to the input signal, and converting the physical value into data type and directly mapping it to the internal controller to realize signal interaction.
It avoids the application layer and the underlying layer to directly call the interface function of a single signal, reduces the later maintenance cost and error rate, and improves the efficiency of software development.
Smart Images

Figure CN119906601A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automobile local area network, and in particular to an interaction method of a CAN network interface of an automobile controller and related products. Background Art
[0002] CAN (Controller Area Network) is equivalent to the central nervous system of a car, a serial data communication protocol in the car. It can not only connect multiple control units in the car together to achieve information synchronization, communication and data transmission, but also interact with test instruments.
[0003] Taking the CAN network interaction scenario commonly used in the TCU (Transmission Control Unit, automatic transmission controller) software development process as an example, in the existing CAN network interface interaction method, the interaction method between the application layer and the bottom layer is to directly call the interface function of a single information generated according to the DBC (Database Can, database file). Once the DBC changes, the bottom interface function and the application layer model need to be changed frequently, resulting in high subsequent maintenance costs and error rates, which directly affects the software development efficiency.
[0004] Therefore, how to improve software development efficiency is a problem that technical personnel in this field need to solve urgently. Summary of the invention
[0005] Based on the above problems, the present application provides an interaction method and related products of the CAN network interface of a vehicle controller. By transferring and extracting the input signals, it avoids the application layer and the bottom layer directly calling the interface function of a single signal to realize signal interaction, thereby solving the problem of low software development efficiency caused by the prior art.
[0006] In a first aspect, the present application provides an interaction method of a CAN network interface of an automobile controller, comprising:
[0007] Get the input signal sent by the external controller;
[0008] Based on the bottom layer of the controller area network CAN, the data storage address corresponding to the input signal is sent to the application layer of the CAN;
[0009] Based on the application layer, extracting array data corresponding to the input signal according to the data storage address;
[0010] Parsing the array data to obtain a physical value corresponding to the input signal;
[0011] The physical value is converted into a data type and directly mapped to the internal controller, so as to realize signal interaction from the external controller to the internal controller.
[0012] Optionally, the bottom layer based on the controller area network CAN, sending the data storage address corresponding to the input signal to the application layer of the CAN, includes:
[0013] Based on the bottom layer of the controller area network CAN, determining the data to be stored corresponding to the input signal;
[0014] The data to be stored is stored in a buffer area Buffer, and the first address corresponding to the data to be stored in the Buffer is sent to the application layer of the CAN.
[0015] Optionally, extracting array data corresponding to the input signal according to the data storage address based on the application layer includes:
[0016] In the application layer, based on the first address, a file reading function is called to extract array data corresponding to the input signal in the Buffer.
[0017] Optionally, parsing the array data to obtain a physical value corresponding to the input signal includes:
[0018] Based on the application layer, the array data is converted into structure data using a message packing CAN Pack module;
[0019] Based on the application layer, the structure data is parsed using a message parsing CAN Unpack module to obtain a physical value corresponding to the input signal.
[0020] Optionally, the method further includes:
[0021] Based on the application layer, obtaining an output signal sent by an internal controller;
[0022] When the output signal includes cyclic redundancy check CRC data, extracting first data other than the CRC data from the output signal;
[0023] Verifying the first data to obtain verification data;
[0024] Based on the application layer, the output signal and the verification data are packaged to obtain structure data;
[0025] The array Data data in the structure data is extracted, and the file write function is called to pass the Data data to the external controller, so as to realize the signal interaction from the internal controller to the external controller.
[0026] Optionally, extracting first data other than the CRC data from the output signal includes:
[0027] Based on the application layer, a message packing CAN Pack module is used to obtain the logic value of other data in the output signal except the node Byte corresponding to the CRC data, and record it as the first data.
[0028] Optionally, calling a write file Write function to transfer the Data data to an external controller includes:
[0029] Based on the application layer, call the Write function to pass the Data data to the bottom layer;
[0030] Based on the bottom layer, the Data data is stored in a buffer area Buffer for acquisition by an external controller.
[0031] In a second aspect, the present application provides an interactive device for a CAN network interface of a vehicle controller, comprising:
[0032] An acquisition module, used for acquiring an input signal sent by an external controller;
[0033] A sending module, used for sending the data storage address corresponding to the input signal to the application layer of the controller area network CAN based on the bottom layer of the CAN;
[0034] An extraction module, configured to extract array data corresponding to the input signal according to the data storage address based on the application layer;
[0035] An analysis module, used for analyzing the array data to obtain a physical value corresponding to the input signal;
[0036] A mapping module is used to convert the data type of the physical value and directly map it to the internal controller, so as to realize the signal interaction from the external controller to the internal controller.
[0037] In a third aspect, the present application provides an interactive device for a CAN network interface of an automobile controller, characterized in that it includes:
[0038] Memory for storing computer programs;
[0039] A processor is used to implement the steps of the interaction method of the CAN network interface of the automobile controller as described in any of the above items when executing the computer program.
[0040] In a fourth aspect, the present application provides a readable storage medium, characterized in that a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the interaction method of the CAN network interface of the automobile controller as described in any of the above items are implemented.
[0041] It can be seen from the above technical solutions that compared with the prior art, the present application has the following advantages:
[0042] This application first obtains the input signal sent by the external controller, and based on the bottom layer of the controller area network CAN, sends the data storage address corresponding to the input signal to the application layer of the CAN. Then, based on the application layer, the array data corresponding to the input signal is extracted according to the data storage address. Finally, the array data is parsed to obtain the physical value corresponding to the input signal, and the physical value is converted into a data type and directly mapped to the internal controller to realize the signal interaction from the external controller to the internal controller. In this way, by transferring and extracting the input signal, the application layer and the bottom layer are avoided from directly calling the interface function of a single signal to realize signal interaction, which reduces the later maintenance cost and error rate and improves the software development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flowchart of an interaction method of a CAN network interface of a vehicle controller provided in this application;
[0044] Figure 2 A schematic diagram of a commonly used CAN network interaction scenario in the automatic transmission controller software development process provided in this application;
[0045] Figure 3 A schematic diagram of a process of processing CAN input signals at the application layer provided in this application;
[0046] Figure 4 A schematic diagram of a process of processing CAN output signals at the application layer provided in this application;
[0047] Figure 5 A schematic diagram of the structure of an interactive device for a CAN network interface of an automobile controller provided in the present application. DETAILED DESCRIPTION
[0048] As mentioned above, taking the CAN network interaction scenario commonly used in the TCU software development process as an example, the existing CAN network interface interaction method is prone to lead to the problem of low software development efficiency. Specifically, CAN is equivalent to the central nervous system of the car, a serial data communication protocol in the car. It can not only connect multiple control units in the car together to achieve information synchronization, communication and data transmission, but also interact with test instruments. In the existing CAN network interface interaction method, the interaction method between the application layer and the bottom layer is to directly call the interface function of a single message. Since the interface function is directly generated according to DBC, each project needs to maintain hundreds of interface functions. Once the DBC signal definition is changed, deleted or layout, that is, deformation and other changes, the bottom interface function and application layer model need to be changed frequently, resulting in subsequent maintenance costs and high error rates, which directly affects the software development efficiency and leads to the problem of low software development efficiency.
[0049] To solve the above problems, the present application provides an interactive method for the CAN network interface of an automobile controller, including: first, obtaining the input signal sent by the external controller, and based on the bottom layer of the controller area network CAN, sending the data storage address corresponding to the input signal to the application layer of the CAN. Then, based on the application layer, extracting the array data corresponding to the input signal according to the data storage address. Finally, parsing the array data to obtain the physical value corresponding to the input signal, converting the data type of the physical value and directly mapping it to the internal controller, so as to realize the signal interaction from the external controller to the internal controller.
[0050] In this way, by transferring and extracting the input signal, the application layer and the bottom layer can avoid directly calling the interface function of a single signal to realize signal interaction, which reduces the subsequent maintenance cost and error rate and improves the software development efficiency.
[0051] It should be noted that the interactive method of the CAN network interface of a vehicle controller and related products provided in this application can be applied to the field of automotive local area network technology. The above is only an example and does not limit the application field of the interactive method of the CAN network interface of a vehicle controller and related products provided in this application.
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0053] Figure 1A flowchart of an interaction method of a CAN network interface of a vehicle controller provided in this application. Figure 1 As shown, the present application provides a method for interacting with a CAN network interface of a vehicle controller, which may include:
[0054] S101: Acquire an input signal sent by an external controller.
[0055] In practical applications, CAN has become the main communication protocol for modern automotive electronic control systems based on its advantages such as high speed, reliability, low cost, strong flexibility and easy maintenance. It is used in body safety modules such as engines, gearboxes, and ABS (Anti-locked Braking System). Figure 2 A schematic diagram of a commonly used CAN network interaction scenario in the automatic transmission controller software development process provided by this application. Figure 2 As shown in the figure, the interaction of CAN network includes CAN input and CAN output. There are application layer (ASW) and bottom layer (BSW) inside TCU. Through the application layer and bottom layer, not only can multiple control units in TCU, such as torque control, gear control, speed control, ramp control and auxiliary control, be connected together, but also the interaction between TCU and external test instruments such as ECM (Engine Control Module), SCU (Shift Control Unit) and SCS (Electronic Control System) can be realized. The interaction of CAN network interface has two aspects: CAN input and CAN output. Based on the TCU software development scenario, first take CAN input as an example. When the external controller needs to send a signal to the TCU, the interaction device of the CAN network interface of the car controller first obtains the input signal sent by the external controller. The external controller can be ECM, SCU and SCS, etc., and the input signal is generally a message signal.
[0056] S102: Based on the bottom layer of the controller area network CAN, the data storage address corresponding to the input signal is sent to the application layer of the CAN.
[0057] In actual applications, combined with the above examples, the application layer and the bottom layer in the TCU interact to transmit the message signal sent by the external controller to the TCU. Specifically, the bottom layer can interact with the external controller. Therefore, when the CAN is input, the interaction device of the CAN network interface of the vehicle controller first obtains the input signal sent by the external controller at the bottom layer of the CAN, and then stores the data corresponding to the input signal, and sends the data storage address to the application layer of the CAN.
[0058] In addition, since the methods of sending the data storage address to the application layer of CAN are different, this application can describe a possible sending method.
[0059] In one case, regarding how to send the data storage address to the application layer of CAN, correspondingly, S102: based on the bottom layer of the controller area network CAN, sending the data storage address corresponding to the input signal to the application layer of the CAN may specifically include:
[0060] Based on the bottom layer of the controller area network CAN, determining the data to be stored corresponding to the input signal;
[0061] The data to be stored is stored in a buffer area Buffer, and the first address corresponding to the data to be stored in the Buffer is sent to the application layer of the CAN.
[0062] In actual applications, the application layer and the bottom layer directly call the interface function of a single signal to achieve interaction. Although the application layer modeling is simple, the subsequent maintenance cost and error rate are very high, resulting in low software development efficiency. The present application provides a Buffer (cache area), and the interactive device of the CAN network interface of the automobile controller changes the interface function provided by the bottom layer from transmitting a single signal logic value to the buffer first address for storing data in each frame, so the application layer needs to call the interface function and extract the data in the Buffer according to the DLC (data length coding bit) length in the DBC. Specifically, the interactive device of the CAN network interface of the automobile controller needs to confirm the data to be stored corresponding to the input signal after receiving the input signal sent by the external controller, and store the data to be stored in the Buffer. When storing, the first address corresponding to the data to be stored in the Buffer is sent to the application layer.
[0063] S103: Based on the application layer, extract array data corresponding to the input signal according to the data storage address.
[0064] In actual applications, the application layer no longer directly obtains a single signal logic value from the bottom layer, but calls the interface to read the data corresponding to the input signal according to the data storage address. It should be noted that the extracted data is a one-dimensional array and needs to be processed before it can be transmitted.
[0065] In addition, since the methods of extracting array data are different, the present application can describe a possible extraction method.
[0066] In one case, regarding how to extract array data, correspondingly, S103: based on the application layer, extracting the array data corresponding to the input signal according to the data storage address may specifically include:
[0067] In the application layer, based on the first address, a file reading function is called to extract array data corresponding to the input signal in the Buffer.
[0068] In actual applications, the interactive device of the CAN network interface of the automobile controller extracts array data based on the first address in the application layer. Among them, the interface function called in the application layer is a file reading function, namely, the Read function, and the extraction location is the storage location of the input signal, namely, the Buffer.
[0069] S104: Analyze the array data to obtain a physical value corresponding to the input signal.
[0070] In actual applications, array data cannot be directly mapped to the various functional modules within the application layer, so data processing is required. Specifically, the interactive device of the CAN network interface of the automobile controller needs to parse the array data at the application layer, parse out the physical value corresponding to the input signal, and then pass it to the internal controller, thereby realizing signal transmission from the external controller to the internal controller.
[0071] In addition, since the parsing methods for array data are not the same, the present application can describe a possible parsing method.
[0072] In one case, regarding how to parse the array data, correspondingly, S104: parsing the array data to obtain the physical value corresponding to the input signal specifically includes:
[0073] Based on the application layer, the array data is converted into structure data using a message packing CAN Pack module;
[0074] Based on the application layer, the structure data is parsed using a message parsing CAN Unpack module to obtain a physical value corresponding to the input signal.
[0075] In practical applications, the interaction device of the CAN network interface of the automobile controller analyzes the array data at the application layer to obtain the physical value corresponding to the input signal. Figure 3 A schematic diagram of the process of processing CAN input signals at the application layer provided in this application. Figure 3As shown, the interactive device of the CAN network interface of the automobile controller stores the first address of the Buffer of each CAN frame data provided by the bottom layer of the spot area of the application layer, and then calls the Read function to read the data to obtain the array data. The next step is to parse the array data, but because the input of the message parsing CAN Unpack module must be a structure, it is necessary to use the message packing CAN pack module to convert the data into a structure containing frame information. Specifically, the interactive device of the CAN network interface of the automobile controller first uses the message packing CAN Pack module at the application layer to convert the array data into structure data, and then uses the message parsing CAN Unpack module to parse the structure data to obtain the physical value corresponding to the input signal. After that, the physical value of the input signal is converted into a data type based on the signal conversion Slew function at the application layer, and mapped to the internal signal of the application layer for each functional module to call the interface signal.
[0076] S105: Convert the data type of the physical value and directly map it to the internal controller, so as to realize signal interaction from the external controller to the internal controller.
[0077] In actual applications, combined with the above examples, based on the TCU software development scenario, taking CAN input as an example, the interactive device of the CAN network interface of the automobile controller converts the physical value of the input signal into a data type based on the Slew function at the application layer, and then maps the data obtained after the data type conversion directly to the internal signal without the need for calibration. Finally, each functional module calls the interface signal to realize the signal transmission from the external controller to the internal controller.
[0078] In addition, since the signal transmission methods of CAN output are not the same, the present application can describe a possible transmission method.
[0079] In one case, regarding how to implement CAN output, the method further includes:
[0080] Based on the application layer, obtaining an output signal sent by an internal controller;
[0081] When the output signal includes cyclic redundancy check CRC data, extracting first data other than the CRC data from the output signal;
[0082] Verifying the first data to obtain verification data;
[0083] Based on the application layer, the output signal and the verification data are packaged to obtain structure data;
[0084] The array Data data in the structure data is extracted, and the file write function is called to pass the Data data to the external controller, so as to realize the signal interaction from the internal controller to the external controller.
[0085] In practical applications, the interaction of the CAN network interface includes two aspects: CAN input and CAN output. Figure 4 A schematic diagram of the process of processing CAN output signals at the application layer provided in this application. Figure 4 As shown, based on the TCU software development scenario, taking CAN output as an example, when the internal controller of the TCU has a need to send a signal to other controllers or gateways, that is, when each functional module in the application layer provides an internal CAN signal that needs to be output, the interactive device of the CAN network interface of the automobile controller first obtains the output signal sent by the internal controller in the application layer. The external controller can be torque control, gear control, speed control, ramp control, auxiliary control, etc., and the output signal is generally a message signal. Then the output signal is simply processed and calibrated, and the data type is converted based on the Slew function. When a CAN frame output in the output signal needs to pass the CRC (cyclic redundancy check) check value, the interactive device of the CAN network interface of the automobile controller needs to extract other data in the output signal except the CRC data in the application layer, which is recorded as the first data. After that, the first data is verified, and the obtained verification data is packaged into the corresponding frame together with all the output signals to obtain the structure data. Finally, the write file Write function is called in the application layer to pass the Data data in the structure data to the external controller to realize the signal transmission from the internal controller to the external controller.
[0086] In addition, since the methods for extracting the first data other than the CRC data in the output signal are not the same, the present application can describe a possible extraction method.
[0087] In one case, with respect to how to extract the first data, the extracting of the first data other than the CRC data in the output signal includes:
[0088] Based on the application layer, a message packing CAN Pack module is used to obtain the logic value of other data in the output signal except the node Byte corresponding to the CRC data, and record it as the first data.
[0089] In practical applications, combined with Figure 4As shown in the figure, when a certain output CAN frame needs to transmit the CRC check value, the interactive device of the CAN network interface of the automobile controller uses the CAN Pack module in the application layer to obtain the logical value of all data except the CRC Byte (node), and then uses CRC8 to check it, and then packs the check value and all output signals into the corresponding frame.
[0090] In addition, since the methods of transmitting Data to an external controller are not the same, the present application may describe a possible transmission method.
[0091] In one case, regarding how to transfer the Data data to the external controller, correspondingly, calling the write file Write function to transfer the Data data to the external controller includes:
[0092] Based on the application layer, call the Write function to pass the Data data to the bottom layer;
[0093] Based on the bottom layer, the Data data is stored in a buffer area Buffer for acquisition by an external controller.
[0094] In practical applications, combined with Figure 4 As shown in the figure, after the interactive device of the CAN network interface of the automobile controller extracts the Data data in the structure in the application layer, it calls the interface function, that is, the Write function, to write the Data data and pass it to the bottom layer. Then the bottom layer stores the Data data in the Buffer corresponding to the frame for the external controller to obtain, thereby realizing the signal transmission from the internal controller to the external controller.
[0095] In summary, the present application first obtains the input signal sent by the external controller, and based on the bottom layer of the controller area network CAN, sends the data storage address corresponding to the input signal to the application layer of the CAN. Then, based on the application layer, the array data corresponding to the input signal is extracted according to the data storage address. Finally, the array data is parsed to obtain the physical value corresponding to the input signal, and the physical value is converted into a data type and directly mapped to the internal controller to realize the signal interaction from the external controller to the internal controller. In this way, by transferring and extracting the input signal, the application layer and the bottom layer are avoided from directly calling the interface function of a single signal to realize signal interaction, which reduces the later maintenance cost and error rate and improves the software development efficiency.
[0096] Based on the above embodiment, the present application also provides an interactive device for the CAN network interface of a vehicle controller. The interactive device for the CAN network interface of the vehicle controller is described below in conjunction with the embodiments and drawings.
[0097] Figure 5 A schematic diagram of the structure of an interactive device for a CAN network interface of a vehicle controller provided in an embodiment of the present application. Figure 5 As shown, the interactive device 200 of the CAN network interface of the automobile controller provided in the embodiment of the present application includes:
[0098] An acquisition module 201 is used to acquire an input signal sent by an external controller;
[0099] A sending module 202 is used to send the data storage address corresponding to the input signal to the application layer of the controller area network CAN based on the bottom layer of the CAN;
[0100] An extraction module 203 is used to extract array data corresponding to the input signal according to the data storage address based on the application layer;
[0101] The parsing module 204 is used to parse the array data to obtain the physical value corresponding to the input signal;
[0102] The mapping module 205 is used to convert the data type of the physical value and directly map it to the internal controller to realize the signal interaction from the external controller to the internal controller.
[0103] As an implementation manner, regarding how to send the data storage address corresponding to the input signal to the application layer of the CAN, the sending module 202 can be specifically used for:
[0104] Based on the bottom layer of the controller area network CAN, determining the data to be stored corresponding to the input signal;
[0105] The data to be stored is stored in a buffer area Buffer, and the first address corresponding to the data to be stored in the Buffer is sent to the application layer of the CAN.
[0106] As an implementation manner, regarding how to extract array data corresponding to the input signal, the extraction module 203 may be specifically used to:
[0107] In the application layer, based on the first address, a file reading function is called to extract array data corresponding to the input signal in the Buffer.
[0108] As an implementation manner, with respect to how to obtain the physical value corresponding to the input signal, the above-mentioned analysis module 204 is specifically used for:
[0109] Based on the application layer, the array data is converted into structure data using a message packing CAN Pack module;
[0110] Based on the application layer, the structure data is parsed using a message parsing CAN Unpack module to obtain a physical value corresponding to the input signal.
[0111] As an implementation method, with respect to how to implement signal interaction from an internal controller to an external controller, the above-mentioned CAN network interface interaction device 200 of the automobile controller further includes: an acquisition submodule, an extraction submodule, a verification submodule, a packaging submodule, and a transmission submodule;
[0112] An acquisition submodule, used for acquiring an output signal sent by an internal controller based on the application layer;
[0113] an extraction submodule, configured to extract first data other than cyclic redundancy check CRC data from the output signal when the output signal includes CRC data;
[0114] A check submodule, used to check the first data to obtain check data;
[0115] A packing submodule, used for packing the output signal and the verification data based on the application layer to obtain structure data;
[0116] The transfer submodule is used to extract the array Data data in the structure data, and call the write file Write function to transfer the Data data to the external controller, so as to realize the signal interaction from the internal controller to the external controller.
[0117] As an implementation manner, regarding how to extract the first data, the above-mentioned extraction submodule can be specifically used for:
[0118] Based on the application layer, a message packing CAN Pack module is used to obtain the logic value of other data in the output signal except the node Byte corresponding to the CRC data, and record it as the first data.
[0119] As an implementation method, regarding how to transfer Data to an external controller, the above transfer submodule can be specifically used for:
[0120] Based on the application layer, call the Write function to pass the Data data to the bottom layer;
[0121] Based on the bottom layer, the Data data is stored in a buffer area Buffer for acquisition by an external controller.
[0122] In summary, the present application first obtains the input signal sent by the external controller, and based on the bottom layer of the controller area network CAN, sends the data storage address corresponding to the input signal to the application layer of the CAN. Then, based on the application layer, the array data corresponding to the input signal is extracted according to the data storage address. Finally, the array data is parsed to obtain the physical value corresponding to the input signal, and the physical value is converted into a data type and directly mapped to the internal controller to realize the signal interaction from the external controller to the internal controller. In this way, by transferring and extracting the input signal, the application layer and the bottom layer are avoided from directly calling the interface function of a single signal to realize signal interaction, which reduces the later maintenance cost and error rate and improves the software development efficiency.
[0123] In addition, the present application also provides an interactive device for the CAN network interface of a vehicle controller, comprising: a memory for storing a computer program; a processor for implementing the steps of the interactive method for the CAN network interface of the vehicle controller as described in any of the above items when executing the computer program.
[0124] In addition, the present application also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the interaction method of the CAN network interface of the automobile controller as described in any of the above items are implemented.
[0125] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An interactive method for a CAN network interface of an automobile controller, characterized in that: The method comprises: Get the input signal sent by the external controller; Based on the bottom layer of the controller area network CAN, the data storage address corresponding to the input signal is sent to the application layer of the CAN; Based on the application layer, extracting array data corresponding to the input signal according to the data storage address; Parsing the array data to obtain a physical value corresponding to the input signal; The physical value is converted into a data type and directly mapped to the internal controller, so as to realize signal interaction from the external controller to the internal controller.
2. The method according to claim 1, characterized in that The bottom layer based on the controller area network CAN sends the data storage address corresponding to the input signal to the application layer of the CAN, including: Based on the bottom layer of the controller area network CAN, determining the data to be stored corresponding to the input signal; The data to be stored is stored in a buffer area Buffer, and the first address corresponding to the data to be stored in the Buffer is sent to the application layer of the CAN.
3. The method according to claim 2, characterized in that The extracting the array data corresponding to the input signal according to the data storage address based on the application layer includes: In the application layer, based on the first address, a file reading function is called to extract array data corresponding to the input signal in the Buffer.
4. The method according to claim 1, characterized in that: The step of parsing the array data to obtain a physical value corresponding to the input signal includes: Based on the application layer, the array data is converted into structure data using a message packing CAN Pack module; Based on the application layer, the structure data is parsed using a message parsing CAN Unpack module to obtain a physical value corresponding to the input signal.
5. The method according to claim 1, characterized in that The method further comprises: Based on the application layer, obtaining an output signal sent by an internal controller; When the output signal includes cyclic redundancy check CRC data, extracting first data other than the CRC data from the output signal; Verifying the first data to obtain verification data; Based on the application layer, the output signal and the verification data are packaged to obtain structure data; The array Data data in the structure data is extracted, and the file write function is called to pass the Data data to the external controller, so as to realize the signal interaction from the internal controller to the external controller.
6. The method according to claim 5, characterized in that The extracting first data other than the CRC data from the output signal comprises: Based on the application layer, a message packing CAN Pack module is used to obtain the logic value of other data in the output signal except the node Byte corresponding to the CRC data, and record it as the first data.
7. The method according to claim 5, characterized in that The calling of the write file Write function to transfer the Data data to the external controller includes: Based on the application layer, call the Write function to pass the Data data to the bottom layer; Based on the bottom layer, the Data data is stored in a buffer area Buffer for acquisition by an external controller.
8. An interactive device for a CAN network interface of an automobile controller, characterized in that: include: An acquisition module, used for acquiring an input signal sent by an external controller; A sending module, used for sending the data storage address corresponding to the input signal to the application layer of the controller area network CAN based on the bottom layer of the CAN; An extraction module, configured to extract array data corresponding to the input signal according to the data storage address based on the application layer; An analysis module, used for analyzing the array data to obtain a physical value corresponding to the input signal; A mapping module is used to convert the data type of the physical value and directly map it to the internal controller, so as to realize the signal interaction from the external controller to the internal controller.
9. An interactive device for a CAN network interface of an automobile controller, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the interaction method of the CAN network interface of the automobile controller as claimed in any one of claims 1 to 7 when executing the computer program.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the interaction method of the CAN network interface of the automobile controller as claimed in any one of claims 1 to 7.