Communication method, device and equipment
By splitting the CANFD message into multiple CAN messages and sending it to the CAN network segment, the problem of mismatch between the data field length and transmission rate when the CAN bus and the CANFD bus coexist is solved, and the CAN network segment and the CANFD network segment are realized. Normal communication avoids bus communication abnormalities and ensures the stability and efficiency of data transmission.
Patent Information
- Application Number
- CN202410977976.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-08
AI Technical Summary
In a network where CAN bus and CANFD bus coexist, due to the mismatch between the data field length and transmission rate, the nodes cannot resolve packets normally, and a large number of error packets appear, interfering with bus communication and causing communication exceptions.
By splitting the received CANFD messages into multiple CAN messages and sending them to the CAN network segment, the CAN network segment can normally resolve the received messages, and realize communication between the CAN network segment and the CANFD network segment. Avoid bus communication exceptions.
It realizes normal communication between the CAN network segment and the CANFD network segment, avoids bus communication abnormalities, and ensures the stability and efficiency of data transmission.
Smart Images

Figure CN118921333A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of automobile technology, and in particular, relates to a communication method, device and equipment. Background Art
[0002] With the vigorous development of automotive electronics and industrial automation, the number of devices and the amount of data on the Controller Area Network (CAN) bus have greatly increased, which has brought great challenges to the CAN bus. In order to meet higher bandwidth and data throughput, the CAN with Flexible Data-Rate (CAN FD) bus came into being.
[0003] However, due to the problems of product stability and transformation cost, the CANFD bus has not been quickly and comprehensively popularized, which makes the CAN bus and the CANFD bus coexist in the network. When the CAN bus and the CANFD bus coexist, on the one hand, since the data field length of the CANFD bus is longer than that of the CAN bus, the nodes of the CAN network segment (i.e., CAN nodes) cannot parse the CANFD message normally, and the CAN node will always report errors, and a large number of error messages will appear, interfering with the normal operation of the bus, resulting in the CANFD message being unable to be sent normally and the bus communication being abnormal; on the other hand, since the transmission rate of the CANFD bus is faster than that of the CAN bus, the transmission rate of the CAN bus does not match the transmission rate of the CANFD bus, and the CANFD message cannot be parsed normally by the CAN node, and the CAN node will always report errors, and a large number of error messages will appear, interfering with the normal operation of the bus, resulting in the CANFD message being unable to be sent normally and the bus communication being abnormal. Summary of the invention
[0004] The embodiments of the present application provide a communication method, apparatus and device, which can prevent bus communication abnormalities.
[0005] In a first aspect, an embodiment of the present application provides a communication method, including:
[0006] Receive source messages sent by the source network segment;
[0007] When the source network segment is a CAN FD network segment, the target network segment is a CAN network segment, and the source message includes a first CAN FD message, split the first CAN FD message into M CAN messages, where M is a positive integer greater than or equal to 2;
[0008] Send M CAN messages to the CAN segment.
[0009] In a second aspect, an embodiment of the present application provides a communication device, including:
[0010] A receiving module, used for receiving a source message sent by a source network segment;
[0011] A depacketizing module, for splitting the first CAN FD message into M CAN messages when the source network segment is a CAN FD network segment, the target network segment is a CAN network segment, and the source message includes the first CAN FD message, wherein M is a positive integer greater than or equal to 2;
[0012] The first sending module is used to send M CAN messages to the CAN network segment.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the communication method provided in the embodiment of the present application are implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the communication method provided in the embodiment of the present application are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of the communication method provided in the embodiment of the present application are implemented.
[0016] In an embodiment of the present application, the CAN FD message sent by the received CAN FD network segment is split into CAN messages, and the CAN message obtained by splitting the CAN FD message is sent to the CAN network segment, so that the CAN node of the CAN network segment can normally parse the received CAN message, thereby realizing communication between the CAN network segment and the CAN FD network segment, and avoiding bus communication abnormalities. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 It is a flow chart of the communication method provided in the embodiment of the present application;
[0019] Figure 2 It is a schematic diagram of transmission from a CAN FD network segment to a CAN network segment provided in an embodiment of the present application;
[0020] Figure 3 It is a schematic diagram of transmission from a CAN network segment to a CAN FD network segment provided in an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of the structure of a communication device provided in an embodiment of the present application;
[0022] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0024] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0025] The communication method, device and equipment provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0026] The communication method and device provided in the embodiments of the present application can be applied to an electronic device, which can be implemented as a gateway (Gateway), and communication between a CAN network segment and a CANFD network segment can be achieved through the gateway.
[0027] Figure 1 is a flow chart of the communication method provided in the embodiment of the present application. Figure 1 As shown, the communication methods may include:
[0028] Step 101: receiving a source message sent by a source network segment;
[0029] In some possible implementations of the embodiments of the present application, the source network segment in the embodiments of the present application may be a CAN network segment, or may be a CAN FD network segment. When the source network segment is a CAN network segment, the source message may be multiple CAN messages; when the source network segment is a CAN FD network segment, the source message may be a CAN FD message. The length of a CAN message is usually 1 to 8 bytes, and the length of a CAN FD message is usually 8 to 64 bytes.
[0030] Step 102: when the source network segment is a CAN FD network segment, the target network segment is a CAN network segment, and the source message includes a first CAN FD message, split the first CAN FD message into M CAN messages, where M is a positive integer greater than or equal to 2;
[0031] In some possible implementations of the embodiments of the present application, the first CAN FD message in the embodiments of the present application is a CAN FD message in which a signal exists and the signal does not exist across frames, that is, a signal only exists in one frame of the CAN FD message.
[0032] In some possible implementations of the embodiments of the present application, in step 102, M CAN messages can be established based on the length of the first CAN FD message and the maximum length of the CAN message; the signal of the first CAN FD message is respectively filled into the M CAN messages and the CAN messages corresponding to the frames where the signals are located.
[0033] In some possible implementations of the embodiments of the present application, the value of the number M of CAN messages may be determined according to the following formula (1):
[0034]
[0035] Wherein, in formula (1), M is the number of CAN messages, X is the length of the first CAN FD message, Y is the maximum length of the CAN message, and Y is 8. Indicates rounding up.
[0036] Exemplarily, assuming that the length of the first CAN FD message is 60 bytes, M is equal to 8.
[0037] As another example, assuming that the length of the first CAN FD message is 64 bytes, M is equal to 8.
[0038] For example, assume that there are 9 signals in the first CANFD message canfdMsg, and the 9 signals are signals sig01 to sig09, wherein signals sig01 to sig03 are in the first frame of canfdMsg, signals sig04 to sig06 are in the second frame of canfdMsg, and signals sig07 to sig09 are in the third frame of canfdMsg. Then, signals sig01 to sig03 are filled into the first CAN message canMsg1, signals sig04 to sig06 are filled into the second CAN message canMsg2, and signals sig07 to sig09 are filled into the third CAN message canMsg3.
[0039] It can be understood that, in this embodiment, the i-th frame in the first CAN FD message corresponds to the i-th CAN message among the M CAN messages.
[0040] In some possible implementations of the embodiments of the present application, filling the signal of the first CAN FD message into M CAN messages corresponding to the frames where the signals are located may include: dividing the signal in the first CAN FD message into M frames according to the maximum length; filling the signal in the i-th frame in the M frames into the i-th CAN message in the M CAN messages, where i is a positive integer less than or equal to M.
[0041] Exemplarily, assuming that the length of the first CAN FD message is 60 bytes, 8 CAN messages are created, and the first CAN FD message is divided into one frame according to every 8 bytes, then the first CAN FD message is divided into 8 frames, the signal in the first frame is filled into the first CAN message, the signal in the second frame is filled into the second CAN message, the signal in the third frame is filled into the third CAN message, the signal in the fourth frame is filled into the fourth CAN message, the signal in the fifth frame is filled into the fifth CAN message, the signal in the sixth frame is filled into the sixth CAN message, the signal in the seventh frame is filled into the seventh CAN message, and the signal in the eighth frame is filled into the eighth CAN message.
[0042] Step 103: Send M CAN messages to the CAN network segment.
[0043] For example, it is assumed that there are 9 signals in the first CANFD message canfdMsg, and the 9 signals are signals sig01 to sig09, wherein signals sig01 to sig03 are in the first frame of canfdMsg, signals sig04 to sig06 are in the second frame of canfdMsg, and signals sig07 to sig09 are in the third frame of canfdMsg. The length of canfdMsg is 64 bytes, then M is equal to 8, and 8 CAN messages are established; signals sig01 to sig03 are filled into the first CAN message canMsg1 among the 8 CAN messages, signals sig04 to sig06 are filled into the second CAN message canMsg2 among the 8 CAN messages, and signals sig07 to sig09 are filled into the third CAN message canMsg3 among the 8 CAN messages. Eight CAN messages are sent to the CAN network segment, wherein signals exist in the first CAN message canMsg1, the second CAN message canMsg2, and the third CAN message canMsg3 of the eight CAN messages.
[0044] In an embodiment of the present application, the CAN FD message sent by the received CAN FD network segment is split into CAN messages, and the CAN message obtained by splitting the CAN FD message is sent to the CAN network segment, so that the CAN node of the CAN network segment can normally parse the received CAN message, thereby realizing communication between the CAN network segment and the CAN FD network segment, and avoiding bus communication abnormalities.
[0045] In some possible implementations of the present application, in order to save transmission resources, CAN messages without signals may not be transmitted. Based on this, step 103 may include: deleting CAN messages without signals from M CAN messages; and sending the remaining CAN messages to the CAN network segment.
[0046] For example, it is assumed that there are 9 signals in the first CANFD message canfdMsg, and the 9 signals are signals sig01 to sig09, wherein signals sig01 to sig03 are in the first frame of canfdMsg, signals sig04 to sig06 are in the second frame of canfdMsg, and signals sig07 to sig09 are in the third frame of canfdMsg. The length of canfdMsg is 64 bytes, then M is equal to 8, and 8 CAN messages are established; signals sig01 to sig03 are filled into the first CAN message canMsg1 among the 8 CAN messages, signals sig04 to sig06 are filled into the second CAN message canMsg2 among the 8 CAN messages, and signals sig07 to sig09 are filled into the third CAN message canMsg3 among the 8 CAN messages. At this time, if there is no signal in the fourth to eighth CAN messages among the 8 CAN messages, the fourth to eighth CAN messages among the 8 CAN messages are deleted, and the remaining CAN messages are sent to the CAN network segment, that is, the CAN messages including the signal are transmitted.
[0047] In the embodiment of the present application, by deleting the CAN messages without signals among the M CAN messages and sending the remaining CAN messages to the CAN network segment, transmission resources can be saved.
[0048] In some possible implementations of the embodiments of the present application, in order to ensure that the signals of the corresponding frames after the CAN FD message is split still maintain the arrangement order in the original frame in the split CAN message, the starting position of the signal in the CAN message can be determined according to the starting position of the signal in the i-th frame in the first CAN FD message; according to the starting position of the signal in the CAN message, the signal is filled into the i-th CAN message. Specifically, the starting position of the signal in the CAN message can be determined according to the following formula (2):
[0049] Z=X-64*(Y-1) (2)
[0050] Wherein, in formula (2), Z is the start bit of the signal in the CAN message, X is the start bit of the signal in the first CAN FD message, and Y is the frame number of the signal in the first CAN FD message.
[0051] Exemplarily, it is assumed that there are 9 signals in the first CANFD message canfdMsg, and the 9 signals are signals sig01 to sig09, wherein signals sig01 to sig03 are in the first frame of canfdMsg, signals sig04 to sig06 are in the second frame of canfdMsg, and signals sig07 to sig09 are in the third frame of canfdMsg. The starting bit of signal sig01 in canfdMsg is 0, and the length is 6; the starting bit of signal sig02 in canfdMsg is 8, and the length is 8; the starting bit of signal sig03 in canfdMsg message is 16, and the length is 10; the starting bit of signal sig04 in canfdMsg is 64, and the length is 6; the starting bit of signal sig05 in canfdMsg is 72, and the length is 8; the starting bit of signal sig06 in canfdMsg is 80, and the length is 10; the starting bit of signal sig07 in canfdMsg is 128, and the length is 6; the starting bit of signal sig08 in canfdMsg is 136, and the length is 8; the starting bit of signal sig09 in canfdMsg is 144, and the length is 10.
[0052] The length of canfdMsg is 64 bytes, then M is equal to 8, and 8 CAN messages are established. According to the above formula (2), the starting bits of signals sig01 to sig03 in the first CAN message canMsg1 among the 8 CAN messages are calculated to be 0, 8, and 16 respectively; the starting bits of signals sig04 to sig06 in the second CAN message canMsg2 among the 8 CAN messages are calculated to be 0, 8, and 16 respectively; the starting bits of signals sig07 to sig09 in the third CAN message canMsg3 among the 8 CAN messages are calculated to be 0, 8, and 16 respectively.
[0053] According to the starting bits of signals sig01 to sig03 in canMsg1, signals sig01 to sig03 are filled into canMsg1; according to the starting bits of signals sig04 to sig06 in canMsg2, signals sig04 to sig06 are filled into canMsg2; according to the starting bits of signals sig07 to sig09 in canMsg3, signals sig07 to sig09 are filled into canMsg3.
[0054] At this time, if there is no signal in the fourth to eighth CAN messages among the 8 CAN messages, the fourth to eighth CAN messages among the 8 CAN messages are deleted, and the remaining CAN messages are sent to the CAN network segment, that is, the CAN messages including the signal are transmitted.
[0055] In the embodiment of the present application, it can be ensured that the signals of the corresponding frames after the CAN FD message is split still maintain the arrangement order in the original frame in the split CAN message.
[0056] For example, Figure 2 As shown, Figure 2 This is a schematic diagram of the transmission from a CAN FD network segment to a CAN network segment provided in an embodiment of the present application.
[0057] exist Figure 2 In the process, the gateway splits the CANFD message canfdMsg of the CANFD network segment into multiple CAN messages, and fills the signals sig01 to sig03 in the first frame of canfdMsg into the first CAN message canMsg1 in the multiple CAN messages, fills the signals sig04 to sig06 in the second frame of canfdMsg into the second CAN message canMsg2 in the multiple CAN messages, fills the signals sig07 to sig09 in the third frame of canfdMsg into the third CAN message canMsg3 in the multiple CAN messages, deletes the CAN messages without filled signals in the multiple CAN messages, and sends canMsg1, canMsg2 and canMsg3 to the CAN network segment.
[0058] In some possible implementations of the embodiments of the present application, the communication method provided by the embodiments of the present application may also include: when the source network segment is a CAN network segment, the target network segment is a CANFD network segment, and the source message includes N CAN messages, combining the N CAN messages into a second CANFD message, where N is a positive integer greater than or equal to 2; and sending the second CANFD message to the CANFD network segment.
[0059] Exemplarily, assuming that there are 8 CAN messages, the 8 CAN messages are combined into one CAN FD message, and the combined CAN FD message is sent to the CAN FD network segment.
[0060] In some possible implementations of the embodiments of the present application, when N CAN messages are combined into a second CAN FD message, a third CAN FD message with a length of 8*N can be established according to the number of CAN messages N; the signals of the N CAN messages are respectively set in the corresponding frames of the third CAN FD message to obtain a second CAN FD message.
[0061] For example, assuming that there are 8 CAN messages, a CAN FD message with a length of 64 is established, and the signals of the 8 CAN messages are respectively set in the corresponding frames of the CAN FD message. For example, the signal of the i-th CAN message is set in the i-th frame of the CAN FD message, where i is a positive integer.
[0062] In some possible implementations of the embodiments of the present application, when the signals of N CAN messages are respectively set in the corresponding frames of the third CAN FD message, the signals of the N CAN messages can be respectively set in the corresponding frames of the third CAN FD message according to the correspondence between the CAN messages and the frame sequence numbers of the CAN FD messages.
[0063] In some possible implementations of the embodiments of the present application, the correspondence between the frame sequence numbers of the CAN message and the CAN FD message can be set according to actual needs. For example, the second CAN message corresponds to the first frame of the CAN FD message, the first CAN message corresponds to the second frame of the CAN FD message, and the third CAN message corresponds to the third frame of the CAN FD message. Then the signal of the second CAN message is set in the first frame of the CAN FD message, the signal of the first CAN message is set in the second frame of the CAN FD message, and the signal of the third CAN message is set in the third frame of the CAN FD message.
[0064] In the embodiment of the present application, through the correspondence between the frame sequence numbers of the CAN message and the CAN FD message, the signals of the CAN messages with different functions can be reasonably arranged into the frame of the CAN FD message.
[0065] In some possible implementations of the embodiments of the present application, when the signals of N CAN messages are respectively set in the corresponding frames of the third CAN FD message, the starting position of the signal in the CAN FD message can be determined according to the starting position of the signal in the CAN message and the frame number of the CAN FD message corresponding to the CAN message. Specifically, the starting position of the signal in the CAN FD message can be determined according to the following formula (3):
[0066] Z=X+64*(Y-1) (3)
[0067] Wherein, in formula (3), Z is the start bit of the signal in the CAN FD message, X is the start bit of the signal in the CAN message, and Y is the frame number of the CAN message corresponding to the CAN FD message.
[0068] Exemplarily, assume that there are three CAN messages, which are canMsg1, canMsg2 and canMsg3, wherein canMsg1 includes signals sig11, sig12 and sig13; canMsg2 includes signals sig21, sig22 and sig23, and canMsg3 includes signals sig31, sig32 and sig33. The starting bit of sig11 in canMsg1 is 0 and the length is 6; the starting bit of sig12 in canMsg1 is 8 and the length is 8; the starting bit of sig13 in canMsg1 is 16 and the length is 10; the starting bit of sig21 in canMsg2 is 0 and the length is 6; the starting bit of sig22 in canMsg2 is 8 and the length is 8; the starting bit of sig13 in canMsg1 is 16 and the length is 10; the starting bit of sig31 in canMsg3 is 0 and the length is 6; the starting bit of sig32 in canMsg3 is 8 and the length is 8; the starting bit of sig33 in canMsg3 is 16 and the length is 10.
[0069] canMsg1 corresponds to the second frame of the generated CANFD message canfdMsg, canMsg2 corresponds to the first frame of canfdMsg, and canMsg3 corresponds to the third frame of canfdMsg.
[0070] According to the above formula (3), the starting bits of signals sig11, sig12, sig13, sig21, sig22, sig23, sig31, sig32 and sig33 in canfdMsg are calculated to be 64, 74, 80, 0, 8, 16, 128, 136 and 144 respectively.
[0071] According to the start bits of signals sig11, sig12, sig13, sig21, sig22, sig23, sig31, sig32 and sig33 in canfdMsg respectively, fill signals sig11, sig12, sig13, sig21, sig22, sig23, sig31, sig32 and sig33 into canfdMsg.
[0072] For example, Figure 3 As shown, Figure 3 This is a schematic diagram of transmission from a CAN network segment to a CAN FD network segment provided in an embodiment of the present application.
[0073] exist Figure 3In the example, the gateway combines the three CAN messages canMsg1, canMsg2 and canMsg3 of the CAN segment into one CANFD message, sets the signals sig21, sig22 and sig23 included in canMsg2 in the first frame of the CANFD message, sets the signals sig11, sig12 and sig13 included in canMsg1 in the second frame of the CANFD message, and sets the signals sig31, sig32 and sig33 included in canMsg3 in the third frame of the CANFD message.
[0074] Corresponding to the above method embodiment, the present application embodiment also provides a communication device, such as Figure 4 shown. Figure 4 4 is a schematic diagram of the structure of a communication device provided in an embodiment of the present application. The communication device 400 may include:
[0075] The receiving module 401 is used to receive a source message sent by a source network segment;
[0076] The unpacking module 402 is used for splitting the first CAN FD message into M CAN messages when the source network segment is a CAN FD network segment, the target network segment is a CAN network segment, and the source message includes the first CAN FD message, where M is a positive integer greater than or equal to 2;
[0077] The first sending module 403 is configured to send M CAN messages to the CAN network segment.
[0078] In an embodiment of the present application, the CAN FD message sent by the received CAN FD network segment is split into CAN messages, and the CAN message obtained by splitting the CAN FD message is sent to the CAN network segment, so that the CAN node of the CAN network segment can normally parse the received CAN message, thereby realizing communication between the CAN network segment and the CAN FD network segment, and avoiding bus communication abnormalities.
[0079] In some possible implementations of the embodiment of the present application, the unpacking module 402 includes:
[0080] A first establishing submodule is used to establish M CAN messages according to the length of the first CAN FD message and the maximum length of the CAN message;
[0081] The filling submodule is used to fill the signal of the first CAN FD message into the M CAN messages and the CAN messages corresponding to the frame where the signal is located.
[0082] In some possible implementations of the embodiments of the present application, the filling submodule includes:
[0083] A division unit, configured to divide the signal in the first CANFD message into M frames according to the maximum length;
[0084] A filling unit is used to fill the signal in the i-th frame in the M frames into the i-th CAN message in the M CAN messages, wherein i is a positive integer less than or equal to M.
[0085] In some possible implementations of the embodiments of the present application, the filling unit is specifically used for:
[0086] Determine the starting position of the signal in the CAN message according to the starting position of the signal in the i-th frame in the first CAN FD message;
[0087] According to the start bit of the signal in the CAN message, fill the signal into the i-th CAN message.
[0088] In some possible implementations of the embodiment of the present application, the first sending module 403 is specifically used to:
[0089] Delete the CAN messages without any signal in M CAN messages;
[0090] Send the remaining CAN messages to the CAN segment.
[0091] In some possible implementations of the embodiments of the present application, the communication device 400 provided in the embodiments of the present application may further include:
[0092] A combining module, for combining the N CAN messages into a second CAN FD message when the source network segment is a CAN network segment, the target network segment is a CAN FD network segment, and the source message includes N CAN messages, wherein N is a positive integer greater than or equal to 2;
[0093] The second sending module is used to send the second CAN FD message to the CAN FD network segment.
[0094] In some possible implementations of the embodiments of the present application, the combined module includes:
[0095] The second establishment submodule is used to establish a third CANFD message with a length of 8*N according to the number N of CAN messages;
[0096] The submodule is set to respectively set the signals of the N CAN messages in the corresponding frames of the third CAN FD message to obtain the second CAN FD message.
[0097] In some possible implementations of the embodiments of the present application, the submodule is specifically configured to:
[0098] According to the corresponding relationship between the frame sequence numbers of the CAN message and the CAN FD message, the signals of the N CAN messages are respectively set in the corresponding frames of the third CAN FD message.
[0099] Figure 5It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0100] The electronic device may include a processor 501 and a memory 502 storing computer program instructions.
[0101] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0102] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the electronic device. In some specific embodiments, the memory 502 is a non-volatile solid-state memory.
[0103] In some specific embodiments, the memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the communication method provided according to the embodiments of the present application.
[0104] The processor 501 implements the communication method provided in the embodiment of the present application by reading and executing the computer program instructions stored in the memory 502 .
[0105] In one example, the electronic device may further include a communication interface 503 and a bus 510. Figure 5 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.
[0106] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0107] The bus 510 includes hardware, software or both, coupling the components of the electronic device to each other. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro channel architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus or other suitable buses or a combination of two or more of these. Where appropriate, the bus 510 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0108] The electronic device can execute the steps of the communication method provided in the embodiment of the present application, thereby achieving the corresponding technical effects of the communication method provided in the embodiment of the present application.
[0109] In addition, in combination with the communication method in the above embodiment, the embodiment of the present application also provides a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the steps of the communication method provided in the embodiment of the present application are implemented. Examples of computer-readable storage media include non-transitory computer-readable media, such as ROM, RAM, magnetic disk or optical disk, etc.
[0110] An embodiment of the present application provides a computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of the communication method provided in the embodiment of the present application are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0111] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0112] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable read-only memory (Erasable Read Only Memory, EROM), floppy disks, compact discs (Compact Disc Read-Only Memory, CD-ROM), optical disks, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0113] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0114] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0115] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A communication method, characterized in that: The method comprises: Receive source messages sent by the source network segment; When the source network segment is a CAN FD network segment, the target network segment is a CAN network segment, and the source message includes a first CAN FD message, split the first CAN FD message into M CAN messages, where M is a positive integer greater than or equal to 2; The M CAN messages are sent to the CAN network segment.
2. The method according to claim 1, characterized in that The step of splitting the first CAN FD message into M CAN messages includes: Establishing M CAN messages according to the length of the first CAN FD message and the maximum length of the CAN message; The signal of the first CAN FD message is respectively filled into the CAN messages corresponding to the M CAN messages and the frames where the signal is located.
3. The method according to claim 2, characterized in that The step of filling the signal of the first CAN FD message into the M CAN messages and the CAN messages corresponding to the frame where the signal is located includes: Dividing the signal in the first CAN FD message into M frames according to the maximum length; Fill the signal in the i-th frame in the M frames into the i-th CAN message in the M CAN messages, where i is a positive integer less than or equal to M.
4. The method according to claim 3, characterized in that The step of filling the signal in the i-th frame in the M frames into the i-th CAN message in the M CAN messages comprises: Determine the starting position of the signal in the CAN message according to the starting position of the signal in the i-th frame in the first CAN FD message; According to the start bit of the signal in the CAN message, the signal is filled into the i-th CAN message.
5. The method according to claim 2, characterized in that: The sending the M CAN messages to the CAN network segment includes: Deleting CAN messages without signals among the M CAN messages; Send the remaining CAN messages to the CAN network segment.
6. The method according to claim 1, characterized in that The method further comprises: When the source network segment is a CAN network segment, the target network segment is a CAN FD network segment, and the source message includes N CAN messages, the N CAN messages are combined into a second CAN FD message, wherein N is a positive integer greater than or equal to 2; Send the second CAN FD message to the CAN FD network segment.
7. The method according to claim 6, characterized in that The combining the N CAN messages into a second CAN FD message includes: According to the number N of CAN messages, a third CAN FD message with a length of 8*N is established; The signals of the N CAN messages are respectively set in the corresponding frames of the third CAN FD message to obtain the second CAN FD message.
8. The method according to claim 7, characterized in that The step of respectively setting the signals of the N CAN messages in the corresponding frames of the third CAN FD message includes: According to the corresponding relationship between the frame sequence numbers of the CAN message and the CAN FD message, the signals of the N CAN messages are respectively set in the corresponding frames of the third CAN FD message.
9. A communication device, characterized in that: The device comprises: A receiving module, used for receiving a source message sent by a source network segment; An unpacking module, configured to, when the source network segment is a CAN FD network segment, the target network segment is a CAN network segment, and the source message includes a first CAN FD message, split the first CAN FD message into M CAN messages, wherein M is a positive integer greater than or equal to 2; The first sending module is used to send the M CAN messages to the CAN network segment, wherein M is a positive integer greater than or equal to 2.
10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the steps of the communication method according to any one of claims 1 to 8.
