Internal communication method, device, electronic device and readable storage medium

By establishing a ring network connection between processors in TBOX and using a communication module to directly send data, the problems of serial communication delay and fault diagnosis and recovery are solved, and the communication stability of the system is improved.

CN117896205BActive Publication Date: 2025-01-03CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311718574.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2025-01-03
Estimated Expiration
2043-12-13

AI Technical Summary

Technical Problem

In traditional TBOX, the serial communication between the three processors has a high delay, and it is difficult to diagnose and recover once a failure occurs, which affects the communication stability of the entire system.

Method used

The internal communication method is adopted to establish a ring network connection between each processor, send data directly through the communication module, and forward it through other links when there is a fault, achieving rapid diagnosis and recovery.

Benefits of technology

It solves the problem of serial communication delay, avoids complete disconnection of the communication link, and improves the communication stability and fault recovery capabilities within TBOX.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117896205B_ABST
    Figure CN117896205B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of TBOX, and provides an internal communication method, device, electronic device and readable storage medium. The method is applied to the communication module in each of the three processors in TBOX, and the three processors are connected in pairs. The method includes: when receiving the first data sent by the local processor, determining the sending object of the first data from two external processors, and sending the first data to the sending object; when receiving the second data sent by any external processor, analyzing whether the second data is forwarded data, if so, determining another external processor as the sending object of the second data, and sending the second data to the sending object, if not, uploading the second data to the local processor. In the present application, the three processors of TBOX communicate in pairs, and the data of each processor can be directly sent to another processor, which solves the problem of serial delay and enhances the communication stability within TBOX.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of TBOX technology, and in particular to an internal communication method, device, electronic device and readable storage medium. Background Art

[0002] The traditional TBOX (Telematics Box) has two processors: MCU (Microcontroller Unit) and network access terminal, which respectively complete the functions of in-vehicle communication and out-of-vehicle Internet access. The inter-process communication between these two processors is realized by IPC (Inter-Process Communication) software module.

[0003] After TBOX added the V2X (Vehicle to Everything) function, TBOX added a new processor, called a coprocessor. At this time, the coprocessor is used to run the V2X protocol stack and application scenario algorithms, the network access terminal handles the V2X wireless signal transmission and reception and Internet access functions, and the MCU handles the CAN (Controller Area Network) network messages. Currently, the three processors of TBOX communicate serially. The network access terminal is connected to both the MCU and the coprocessor, and the inter-process communication between each two processors is still implemented by IPC. Obviously, the delay of serial communication is relatively high, resulting in delays in the application experience of V2X. Furthermore, once a problem occurs in a certain node in the serial communication, it will affect the communication between the processors in the entire TBOX, making it difficult to diagnose the problem and restore traffic.

[0004] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve. Summary of the invention

[0005] In view of this, the embodiments of the present application provide an internal communication method, device, electronic device and readable storage medium to solve the delay and failure risks of serial communication of the Samsung processor in the prior art.

[0006] In a first aspect of an embodiment of the present application, there is provided an internal communication method of a TBOX, which is applied to a communication module in each of three processors in the TBOX, and the three processors are connected in pairs. The method includes:

[0007] When receiving the first data sent by the local processor, determining a sending object of the first data from two external processors, and sending the first data to the sending object;

[0008] When receiving the second data sent by any external processor, analyzing whether the second data is forwarded data, if so, determining another external processor as a sending target of the second data, and sending the second data to the sending target, if not, uploading the second data to the local processor;

[0009] The local processor is the processor where the communication module is located, and the external processor is the processor other than the local processor in the TBOX.

[0010] According to a second aspect of the embodiments of the present application, there is provided an internal communication device of a TBOX, which is provided in each of three processors in the TBOX, and the three processors are connected in pairs, and the device includes:

[0011] The internal communication module is used for, upon receiving the first data sent by the local processor, determining the sending object of the first data from the two external processors, and sending the first data to the sending object;

[0012] The external communication module is used for, when receiving the second data sent by any external processor, analyzing whether the second data is forwarded data, and if so, determining another external processor as a sending object of the second data and sending the second data to the sending object, and if not, uploading the second data to the local processor;

[0013] The local processor is the processor where the communication module is located, and the external processor is the processor other than the local processor in the TBOX.

[0014] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0015] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0016] Compared with the prior art, the embodiments of the present application have at least the following beneficial effects: the embodiments of the present application establish a ring network in which the three processors of the TBOX are connected in pairs, and based on the method setting of the communication module, the data of each processor can be sent directly to another processor, and there is no need for serial communication to be forwarded by other processors, thereby solving the problem of serial delay. At the same time, if a communication link fails, it can also be forwarded through other communication links, which not only avoids the problem of complete disconnection of the communication link and inability to transmit data, but also enables rapid diagnosis of problems and recovery of operations, thereby enhancing the communication stability within the TBOX. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 It is a flowchart of an internal communication method of a TBOX according to an embodiment of the present application;

[0019] Figure 2 is a schematic diagram of an application scenario of TBOX in an embodiment of the present application;

[0020] Figure 3 It is a schematic diagram of the structure of data provided in an embodiment of the present application;

[0021] Figure 4 It is a flowchart of a local data sending process provided by an embodiment of the present application;

[0022] Figure 5 It is a flowchart of an external data uploading process provided by an embodiment of the present application;

[0023] Figure 6 It is a flowchart of an external data forwarding process provided by an embodiment of the present application;

[0024] Figure 7 It is a structural diagram of a specific implementation architecture of a communication module provided in an embodiment of the present application;

[0025] Figure 8 It is a structural schematic diagram of an internal communication device of a TBOX provided in an embodiment of the present application;

[0026] Fig. 9 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0028] An internal communication method, device, electronic device, and readable storage medium according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0029] Figure 1 It is a flowchart of an internal communication method of a TBOX provided in an embodiment of the present application. Figure 1 The internal communication method can be Figure 2 Any communication module is executed. Figure 1 As shown, the internal communication method includes:

[0030] S101: upon receiving first data sent by a local processor, determining a sending target of the first data from two external processors, and sending the first data to the sending target;

[0031] S102: when receiving second data sent by any external processor, analyzing whether the second data is forwarding data;

[0032] S103: If yes, determine another external processor as a sending target of the second data, and send the second data to the sending target;

[0033] S104: If not, uploading the second data to the local processor;

[0034] The local processor is the processor where the communication module is located, and the external processor is the processor other than the local processor in the TBOX.

[0035] Figure 2 It is a scenario diagram of the application scenario of the embodiment of the present application. The application scenario is the internal communication architecture of TBOX. TBOX includes three processors, namely MCU, network access terminal and coprocessor, wherein the coprocessor can be implemented by CPU (Central Processing Unit) or other processors, and is used to run the V2X protocol stack and application scenario algorithm. The network access terminal processes the V2X wireless signal transceiver and Internet access functions, and the MCU processes the CAN network message. In this embodiment, it is required that the three processors are connected in pairs. Further, each processor in this embodiment includes a communication module, and the communication module can usually select an IPC software module to execute the internal communication method in this embodiment. In fact, the two-to-two communication between the three processors is realized based on the connection relationship between the two-to-two connection links between the processors, the connection between the internal interface of the connection link and the communication module, and the connection between the communication module and the local processor.

[0036] It can be understood that the local processor and the external processor are the distinctions between the three processors based on the position of the communication module. For example, if the communication module is in the MCU, then obviously for the communication module, the MCU is the local processor, and the network access terminal and the coprocessor are external processors; for another example, if the communication module is in the network access terminal, then for the communication module, the network access terminal is the local processor, and the MCU and the coprocessor are both external processors; similarly, when the communication module is in the coprocessor, then for the communication module, the coprocessor is the local processor, and the MCU and the network access terminal are external processors.

[0037] Based on the connection relationship between the three processors in the current TBOX, the data sent by one processor to another processor can be sent directly to the target processor or forwarded to the target processor through the communication module of the third processor. Therefore, in this embodiment, each communication module is responsible for the data sending and receiving tasks of the processor where it is located. Each communication module has the following actions:

[0038] When the local processor wants to send the first data to the external processor, the local processor sends the first data to the internal communication module, and the communication module performs the following operations: determines a processor among the two external processors as a specific sending object according to the first data, and then sends the first data to the sending object.

[0039] When the external processor sends the second data to the local processor using the local processor as the sending object, the communication module of the local processor will receive the second data sent by the external processor. At this time, the communication module performs the following operations: analyzing whether the second data is forwarded data, confirming that it is not forwarded data, and uploading the second data to the local processor. After receiving the second data uploaded by the communication module, the local processor will perform subsequent processing on the second data.

[0040] When the external processor sends the second data to the local processor using the local processor as a transit object, the communication module of the local processor will receive the second data sent by the external processor. At this time, the communication module performs the following operations: analyzing whether the second data is forwarded data, confirming that it is forwarded data, and forwarding the second data to another external processor. It should be noted that there are three processors in TBOX. For the communication module, one is the local processor and the remaining two are external processors. When the second data received by the communication module is forwarded data, it can be directly determined that the external processor that sends the second data is the sending processor, and the other external processor is the receiving processor that receives the second data. In other words, the second data forwarded to another external processor here refers to the other external processor of the two external processors that is different from the external processor that sends the second data.

[0041] Further, whether the second data is forwarded data may be determined by a forwarding identification value in the second data. Specifically, the process of analyzing whether the second data is forwarded data includes:

[0042] Obtaining a forwarding identification value of a forwarding identification bit in the second data;

[0043] When the forwarding identifier value is the first preset forwarding value, determining that the second data is forwarding data, and resetting the forwarding identifier value to the second preset forwarding value;

[0044] When the forwarding identification value is not the first preset forwarding value, it is determined that the second data is not forwarding data.

[0045] Assuming that the forwarding identification bit in the second data is fid, identify and obtain the specific information of the fid field, that is, the forwarding identification value. If the forwarding identification value is the first preset forwarding value, it is determined to be forwarded data and the forwarding identification value is reset to indicate that the current communication module has processed and forwarded the second data. Specifically, the specific numerical values ​​of the forwarding identification value in different states can be set according to actual needs. For example, the forwarding identification value of the initial forwarding data is 1, that is, the first preset forwarding value, and the forwarding identification value of the initial non-forwarding data is 0, that is, not the first preset forwarding value. The forwarding identification value after reset is 3, which means that the current communication module has forwarded the second data.

[0046] Specifically, due to the limitation of the data bandwidth of the connection link, the operations of data reception and transmission in this embodiment cannot be performed immediately, and a data queue is required as a buffer for data transmission and reception. Therefore, the data to be sent is first cached in the sending data queue, and the task thread responsible for sending the data, which is the object sending task in this embodiment, continuously executes the action of taking out the data from the sending data queue and sending it; the data to be uploaded is first cached in the receiving data queue, and the task thread responsible for uploading the data, which is the data receiving task in this embodiment, continuously executes the action of taking out the data from the receiving data queue and sending it.

[0047] Therefore, the process of sending the first data to the sending object includes:

[0048] The first data is cached in a sending data queue, and the data in the sending data queue is sent to the corresponding sending objects by the object sending task;

[0049] The process of forwarding the second data to another external processor comprises:

[0050] Buffering the second data into a sending data queue;

[0051] The process of uploading the second data to the local processor includes:

[0052] The second data is cached in a receiving data queue, and the data in the receiving data queue is uploaded to the local processor by the data receiving task.

[0053] It can be understood that the first data and the forwarded data are both cached in the sending data queue, and the object sending task sends the data in the sending data queue to the corresponding external processor one by one; the second data, which is not forwarded data, is cached in the receiving data queue, and the data receiving queue uploads the data in the receiving data queue to the local processor one by one.

[0054] It is understandable that, considering that there are two external processors for each communication module, two object sending tasks can be directly set, specifically:

[0055] The two external processors correspond to the two object sending tasks one by one, and the data in the sending data queue are sent to the corresponding sending objects by the two object sending tasks respectively.

[0056] At this time, the two object sending tasks correspond one-to-one to the two external processors. Each object sending task takes out the data of its corresponding external processor from the sending data queue as the data of the sending object and sends it to the corresponding external processor, thereby improving the data sending efficiency of the sending data queue.

[0057] Furthermore, after determining the receiving object and the sending object, the data can be further prioritized, so as to adjust the processing order of the data based on the priority, thereby improving the processing efficiency of important data. Specifically, in the data sending process, before caching the first data to the sending data queue, it also includes:

[0058] Determine the priority of the first data according to the data type of the first data, and write the priority into the priority identification bit of the first data;

[0059] The process of an object sending task sending data in the sending data queue to the corresponding sending objects includes:

[0060] According to the priority sending order, the object sending task sends the data in the sending data queue to the corresponding sending objects.

[0061] Similarly, in the data uploading process, before caching the second data in the receiving data queue, the process further includes:

[0062] Obtaining the priority of the priority identification bit in the second data;

[0063] The process of the data receiving task uploading the data in the receiving data queue to the local processor includes:

[0064] According to the upload order of priority, the data receiving task uploads the data in the receiving data queue to the local processor.

[0065] Assuming that the priority identification bit in the data is pid, the pid field can be divided into 6 priorities, and the priority values ​​are 0 to 5 from high to low. When the priority is 0, it is the highest priority, and when the priority is 5, it is the lowest priority. Before sending the data, the method of this embodiment needs to first set the priority of the data, and then the data is cached in the sending data queue. When the object sending task executes the sending data action, it will send data according to the priority and send data with higher priority. Correspondingly, when uploading data, the second data is sent by the external processor to the local processor, so the second data itself has its own priority written inside, so there is no operation to set the priority, and directly identify the actual value of the pid field in the second data, that is, the priority of the priority identification bit, and then select the data with higher priority in the receiving data queue according to the priority and upload it to the local processor.

[0066] Based on the priority flag and forwarding flag of each data in the above text, the structure of a data in this embodiment can be as follows: Figure 3 As shown, it at least includes a pid field, a fid field and a data field, wherein the data field includes actual data content and other data-related information.

[0067] It can be understood that all the above descriptions are based on the data message protocol being the IPC protocol. However, the actual connection link between processors does not directly use the IPC protocol, but uses a more underlying hardware communication protocol, such as SPI (Serial Peripheral Interface), URAT (Universal Asynchronous Receiver / Transmitter) or USB (Universal Serial Bus). Therefore, in order to ensure that data is sent and received between processors smoothly and reliably without packet loss, the method of this embodiment needs to convert the data message protocol into the corresponding communication protocol in a timely manner, including converting to the IPC protocol after receiving the second data of the external processor, and converting the message protocol into the corresponding hardware communication protocol before sending data to the external processor. Specifically:

[0068] Before the object sending task sends the data in the sending data queue to the corresponding sending objects, it also includes:

[0069] Convert the message protocol of the data in the sending data queue to the connection protocol corresponding to the sending object;

[0070] After receiving the second data sent by any external processor and before analyzing whether the second data is forwarded data, the method further includes:

[0071] The message protocol of the second data is converted into the IPC protocol.

[0072] It can be understood that the message protocol of the data in the sending data queue is converted from the IPC protocol to the specific connection protocol, and the message protocol of the second data message is converted from the original specific connection protocol to the IPC protocol.

[0073] The connection protocol here is the hardware communication protocol between the current sending object and the local processor. The specific connection protocol needs to be determined according to the actual connection situation. Figure 2 As shown, in the common connection methods currently used, the connection protocol between the MCU and the network access terminal is generally the SPI protocol, and the connection protocol between the network access terminal and the coprocessor is generally the USB protocol. In this embodiment, a connection between the MCU and the coprocessor is newly added, and the connection protocol between the MCU and the coprocessor can be the SPI protocol. Of course, in addition to this connection scheme, the specific connection protocol can also be adjusted and replaced according to actual conditions and user needs, which is not limited here.

[0074] It can be understood that the method in this embodiment is executed by each communication module in the three processors, and the method execution logic of each communication module is completely consistent, and only corresponding judgments and actions need to be performed on specific data. Based on the above description, the implementation process of the method in this embodiment can be as follows:

[0075] Figure 4 is a flowchart of a local data sending process provided by an embodiment of the present application, such as Figure 4 As shown, the process of local data sending includes:

[0076] S401: receiving first data;

[0077] S402: determining one processor among two external processors as a specific sending target according to the first data;

[0078] S403: Determine the priority of the first data according to the data type of the first data, and write the priority into a priority identification bit of the first data;

[0079] S404: Cache the first data into a sending data queue;

[0080] S405: Send the data in the sending data queue to the corresponding sending objects through the object sending task according to the sending order of priority.

[0081] Figure 5 is a flow chart of an external data uploading process provided by an embodiment of the present application, such as Figure 5 As shown in the figure, the process of uploading external data includes:

[0082] S501: receiving second data sent by an external processor;

[0083] S502: Analyze whether the second data is forwarded data, and if not, confirm that it is non-forwarded data;

[0084] S503: Obtain the priority of the priority flag in the second data;

[0085] S504: Cache the second data into a receiving data queue;

[0086] S505: Upload the data in the received data queue to the local processor through the data receiving task according to the upload order of priority.

[0087] Figure 6 is a flow chart of an external data forwarding process provided by an embodiment of the present application, such as Figure 6 As shown in the figure, the process of external data forwarding includes:

[0088] S601: receiving second data sent by an external processor;

[0089] S602: Analyze whether the second data is forwarded data, and if so, confirm that it is forwarded data;

[0090] S603: Obtain the priority of the priority flag in the second data;

[0091] S604: Cache the second data into a sending data queue;

[0092] S605: Send the data in the sending data queue to the corresponding sending objects through the object sending task according to the sending order of priority.

[0093] It should be noted that the object sending task in this embodiment can identify the sending object of each data in the sending data queue, and the object sending task and the data receiving task can identify the priority of each data, so the action effect of data sending or uploading in this embodiment can be achieved. Furthermore, the object sending task and the data receiving task usually poll the corresponding data queue in real time, so that the data cached in the data queue can be processed in time, improving the communication efficiency of the data.

[0094] Based on the above analysis, the specific implementation architecture of the communication module of the method of this embodiment can be as follows: Figure 7 As shown, the functions of each unit are as follows:

[0095] The driver adaptation layer is used to convert the message protocol of the received second data into the IPC protocol, and convert the message protocol of the data in the sending data queue into the connection protocol corresponding to the sending object;

[0096] Receiving channel 1 and receiving channel 2 are essentially object receiving tasks, which are used to receive the second data uploaded by the driver adaptation layer from two external processors respectively;

[0097] The data fast forwarding identification layer is used to analyze whether the second data is forwarding data, and upload the second data to the data priority identification layer;

[0098] The data priority recognition layer is used to obtain the priority of the priority identification bit in the second data, and send the second data to the receiving data queue or the sending data queue according to whether the second data is forwarding data; the data priority recognition layer is also used to determine the priority of the first data and write it into the priority identification bit, and then send the first data to the sending data queue;

[0099] A receiving data queue, used for receiving and caching second data which is not forwarded data;

[0100] Data reception is essentially a data reception task, which is used to poll the receiving data queue and upload the data in the receiving data queue to the local processor in order of priority;

[0101] Data sending, which is essentially a data sending task, is used to receive the first data sent by the local processor and send it to the data priority identification layer;

[0102] A sending data queue, used for receiving and buffering first data and forwarding data;

[0103] Send channel 1 and send channel 2 are essentially two object sending tasks, both of which are used to poll the sending data queue and send the corresponding data in the sending data queue to the corresponding external processor through the driver adaptation layer in sequence according to the priority. The corresponding relationship here is: the external processor corresponding to the sending task is consistent with the sending object of the data.

[0104] It is understandable that according to Figure 7 The internal communication method in this embodiment can be realized by establishing a communication module in the implementation architecture. Of course, in addition to this implementation architecture, other implementation architectures can also be set, as long as the communication module can complete the internal communication method in this embodiment, which is not limited here.

[0105] It can be understood that the method of this embodiment solves the current V2X serial delay problem. When the MCU receives the CAN network data message, it will send it to the network access terminal and the coprocessor respectively through the IPC software module. The V2X scenario application in the coprocessor will obtain the vehicle's CAN network data message (including vehicle speed, braking and other information) in real time for V2X scenario calculation; the V2X interaction application in the network access terminal will also obtain the vehicle's CAN network data message (including vehicle speed, braking and other information) in real time for V2X scenario calculation; the V2X interaction application in the network access terminal will also obtain the vehicle's CAN network data message (including vehicle speed, braking and other information) in real time for V2X vehicle-to-vehicle (V2V), vehicle-to-road (V2I), and vehicle-to-pedestrian (V2P) information interaction calculation, and then the calculated V2X information will be sent to the coprocessor through the IPC software module, thereby realizing parallel calculation of the network access terminal and the coprocessor, eliminating the delay problem caused by serial communication.

[0106] Furthermore, the method of this embodiment also solves the problem that V2X communication failures cannot be diagnosed and recovered, such as Figure 2 As shown, the three processors, MCU, coprocessor, and network access terminal, are connected in pairs to form a ring network design. When the communication between MCU and network access terminal fails, the network access terminal can communicate with MCU through IPC communication with coprocessor, and IPC communication between coprocessor and MCU, so as to quickly diagnose the problem and perform recovery operation. Similarly, if any communication link in the ring network fails, it can be restored by the same method, so that the communication stability inside TBOX is improved.

[0107] The method of the embodiment of the present application establishes a ring network in which the three processors of the TBOX are connected in pairs. Based on the method setting of the communication module, the data of each processor can be sent directly to another processor, and there is no need for serial communication to be forwarded by other processors, thereby solving the problem of serial delay. At the same time, if a communication link fails, it can also be forwarded through other communication links. This not only avoids the problem of complete disconnection of the communication link and inability to transmit data, but also enables rapid diagnosis of problems and recovery of operations, thereby enhancing the communication stability within the TBOX.

[0108] All the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here. It should be understood that the size of the sequence number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0109] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0110] Figure 8Schematic diagram of an internal communication device of a TBOX provided in an embodiment of the present application. The internal communication device is provided in each of the three processors in the TBOX, and the three processors are connected in pairs, such as Figure 8 As shown, the device comprises:

[0111] The internal communication module 801 is used for, upon receiving first data sent by the local processor, determining a sending object of the first data from two external processors, and sending the first data to the sending object;

[0112] The external communication module 802 is used for, when receiving the second data sent by any external processor, analyzing whether the second data is forwarded data, and if so, determining another external processor as a sending target of the second data and sending the second data to the sending target, and if not, uploading the second data to the local processor;

[0113] The local processor is the processor where the communication module is located, and the external processor is the processor other than the local processor in the TBOX.

[0114] The device of the embodiment of the present application establishes a ring network in which the three processors of the TBOX are connected in pairs. Based on the setting method of the communication module, the data of each processor can be sent directly to another processor, and there is no need for serial communication to be forwarded by other processors, thereby solving the problem of serial delay. At the same time, if a communication link fails, it can also be forwarded through other communication links. It not only avoids the problem of complete disconnection of the communication link and inability to transmit data, but also can realize rapid diagnosis of problems and recovery of operations, thereby enhancing the communication stability within the TBOX.

[0115] In an exemplary embodiment, the process of sending the first data to the sending object includes:

[0116] The first data is cached in a sending data queue, and the data in the sending data queue is sent to the corresponding sending objects by the object sending task;

[0117] The process of forwarding the second data to another external processor comprises:

[0118] Buffering the second data into a sending data queue;

[0119] The process of uploading the second data to the local processor includes:

[0120] The second data is cached in a receiving data queue, and the data in the receiving data queue is uploaded to the local processor by the data receiving task.

[0121] In an exemplary embodiment, before the object sending task sends the data in the sending data queue to the corresponding sending objects, it also includes:

[0122] Convert the message protocol of the data in the sending data queue to the connection protocol corresponding to the sending object;

[0123] After receiving the second data sent by any external processor and before analyzing whether the second data is forwarded data, the method further includes:

[0124] The message protocol of the second data is converted into the IPC protocol.

[0125] In an exemplary embodiment, before the internal communication module 801 caches the first data to the sending data queue, it is also used to:

[0126] Determine the priority of the first data according to the data type of the first data, and write the priority into the priority identification bit of the first data;

[0127] The process of an object sending task sending data in the sending data queue to the corresponding sending objects includes:

[0128] According to the priority sending order, the object sending task sends the data in the sending data queue to the corresponding sending objects.

[0129] In an exemplary embodiment, before the external communication module caches the second data in the receiving data queue, it is further configured to:

[0130] Obtaining the priority of the priority identification bit in the second data;

[0131] The process of the data receiving task uploading the data in the receiving data queue to the local processor includes:

[0132] According to the upload order of priority, the data receiving task uploads the data in the receiving data queue to the local processor.

[0133] In an exemplary embodiment, two external processors correspond to two object sending tasks one by one, and the data in the sending data queue is sent to the corresponding sending objects by the two object sending tasks respectively.

[0134] In an exemplary embodiment, the process of analyzing whether the second data is forwarded data includes:

[0135] Obtaining a forwarding identification value of a forwarding identification bit in the second data;

[0136] When the forwarding identifier value is the first preset forwarding value, determining that the second data is forwarding data, and resetting the forwarding identifier value to the second preset forwarding value;

[0137] When the forwarding identification value is not the first preset forwarding value, it is determined that the second data is not forwarding data.

[0138] It can be understood that the device of this embodiment solves the current V2X serial delay problem. When the MCU receives the CAN network data message, it will send it to the network access terminal and the coprocessor respectively through the IPC software module. The V2X scenario application in the coprocessor will obtain the vehicle's CAN network data message (including vehicle speed, braking and other information) in real time for V2X scenario calculation; the V2X interaction application in the network access terminal will also obtain the vehicle's CAN network data message (including vehicle speed, braking and other information) in real time, which is used for V2X information interaction calculation between vehicles and vehicles (V2V), vehicles and roads (V2I), and vehicles and pedestrians (V2P) in V2X, and then the calculated V2X information is sent to the coprocessor through the IPC software module. In this way, parallel calculation of the network access terminal and the coprocessor is realized, eliminating the delay problem caused by serial communication.

[0139] Furthermore, the device of this embodiment also solves the problem that V2X communication failure cannot be diagnosed and recovered, such as Figure 2 As shown, the three processors, MCU, coprocessor, and network access terminal, are connected in pairs to form a ring network design. When the communication between MCU and network access terminal fails, the network access terminal can communicate with MCU through IPC communication with coprocessor, and IPC communication between coprocessor and MCU, so as to quickly diagnose the problem and perform recovery operation. Similarly, if any communication link in the ring network fails, it can be restored by the same method, so that the communication stability inside TBOX is improved.

[0140] Fig. 9 Schematic diagram of an electronic device 9 provided in an embodiment of the present application. Fig. 9 As shown, the electronic device 9 of this embodiment includes: a processor 901, a memory 902, and a computer program 903 stored in the memory 902 and executable on the processor 901. When the processor 901 executes the computer program 903, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 901 executes the computer program 903, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0141] The electronic device 9 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 9 may include, but is not limited to, a processor 901 and a memory 902. Those skilled in the art will appreciate that Fig. 9 The electronic device 9 is merely an example and does not limit the electronic device 9 , and may include more or less components than those shown in the figure, or different components.

[0142] The processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0143] The memory 902 may be an internal storage unit of the electronic device 9, for example, a hard disk or memory of the electronic device 9. The memory 902 may also be an external storage device of the electronic device 9, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 9. The memory 902 may also include both an internal storage unit of the electronic device 9 and an external storage device. The memory 902 is used to store computer programs and other programs and data required by the electronic device.

[0144] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0145] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium, such as a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. The readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0146] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A TBOX internal communication method, characterized in that: A communication module is applied to each of the three processors in the TBOX, and the three processors are connected in pairs. The method includes: When receiving first data sent by the local processor, determining a sending object of the first data from two external processors, and sending the first data to the sending object; When receiving the second data sent by any of the external processors, analyzing whether the second data is forwarded data, if so, determining another of the external processors as the sending target of the second data, and sending the second data to the sending target, if not, uploading the second data to the local processor; The local processor is the processor where the communication module is located, and the external processor is the processor other than the local processor in the TBOX; The process of sending the first data to the sending object includes: Cache the first data into a sending data queue, and the data in the sending data queue is sent to the corresponding sending objects by the object sending task; The process of forwarding the second data to the sending object includes: Cache the second data into the sending data queue; The process of uploading the second data to the local processor includes: caching the second data in a receiving data queue, wherein the data in the receiving data queue is uploaded to the local processor by a data receiving task; The two external processors correspond to the two object sending tasks one by one, and the data in the sending data queue is sent to the corresponding sending objects by the two object sending tasks respectively; Each of the object sending tasks is used to poll the sending data queue in real time, identify the sending object corresponding to each data in the sending data queue, take out the data of the external processor corresponding to itself as the sending object from the sending data queue and send it to the corresponding external processor.

2. The method according to claim 1, characterized in that Before the object sending task sends the data in the sending data queue to the corresponding sending objects, the object sending task further includes: Converting the message protocol of the data in the sending data queue into the connection protocol corresponding to the sending object; After receiving the second data sent by any of the external processors and before analyzing whether the second data is forwarded data, the method further includes: The message protocol of the second data is converted into an IPC protocol.

3. The method according to claim 1, characterized in that Before caching the first data to the sending data queue, the method further includes: Determine a priority of the first data according to the data type of the first data, and write the priority into a priority identification bit of the first data; The process of sending the data in the sending data queue to the corresponding sending objects by the object sending task includes: According to the priority sending order, the object sending task sends the data in the sending data queue to the corresponding sending objects.

4. The method according to claim 1, characterized in that: Before caching the second data in the receiving data queue, the method further includes: Obtaining the priority of the priority flag in the second data; The process of the data receiving task uploading the data in the received data queue to the local processor includes: According to the upload order of the priority, the data receiving task uploads the data in the receiving data queue to the local processor.

5. The method according to any one of claims 1 to 4, characterized in that: The process of analyzing whether the second data is forwarded data includes: Obtaining a forwarding identification value of a forwarding identification bit in the second data; When the forwarding identifier value is a first preset forwarding value, determining that the second data is forwarding data, and resetting the forwarding identifier value to a second preset forwarding value; When the forwarding identification value is not the first preset forwarding value, it is determined that the second data is not the forwarding data.

6. An internal communication device of TBOX, characterized in that: The device is provided in each of the three processors in the TBOX, and the three processors are connected in pairs. The device comprises: The internal communication module is used for, upon receiving the first data sent by the local processor, determining the sending object of the first data from the two external processors, and sending the first data to the sending object; an external communication module, configured to, upon receiving the second data sent by any of the external processors, analyze whether the second data is forwarded data; if so, determine another of the external processors as the sending target of the second data and send the second data to the sending target; if not, upload the second data to the local processor; The local processor is the processor where the communication module is located, and the external processor is the processor other than the local processor in the TBOX; The process of the internal communication module sending the first data to the sending object includes: Cache the first data into a sending data queue, and the data in the sending data queue is sent to the corresponding sending objects by the object sending task; The process of the external communication module forwarding the second data to the sending object includes: Cache the second data into the sending data queue; The process of the external communication module uploading the second data to the local processor includes: caching the second data in a receiving data queue, wherein the data in the receiving data queue is uploaded to the local processor by a data receiving task; The two external processors correspond to the two object sending tasks one by one, and the data in the sending data queue is sent to the corresponding sending objects by the two object sending tasks respectively; Each of the object sending tasks is used to poll the sending data queue in real time, identify the sending object corresponding to each data in the sending data queue, take out the data of the external processor corresponding to itself as the sending object from the sending data queue and send it to the corresponding external processor.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.