Communication matching method, communication component and storage medium

By writing the union of communication matrixes of multiple models in the automotive communication components and identifying the models according to the reception conditions, the problem of poor software reusability is solved, automatic communication matching is achieved, and cost and risk are reduced.

CN119561961APending Publication Date: 2025-03-04CHONGQING JINKANG POWER NEW ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411691728.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the prior art, software for automotive communication components cannot be reused because there are differences in network architecture and communication protocols of different models, resulting in the need to write different software according to the model during the production stage, which increases costs and risks.

Method used

A communication matching method is provided, by writing the union of communication matrixes of multiple models in the communication component, monitoring the reception of messages to be received, identifying the current vehicle model, and switching the communication interface based on the vehicle model, realizing communication matching.

Benefits of technology

Automatic communication matching is achieved, reducing software development and management costs, reducing the risk of write errors, and improving production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561961A_ABST
    Figure CN119561961A_ABST
Patent Text Reader

Abstract

The invention relates to a communication matching method, a communication component and a storage medium, and the communication matching method comprises the steps: carrying out the software flashing through employing a union set of communication matrixes of a plurality of vehicle types, and then operating the software; monitoring the receiving condition of the message to be received, and identifying the current vehicle type according to the receiving condition; the communication interfaces are switched based on the current vehicle model, so that communication matching is realized among the controllers. By implementing the communication matching method provided by the invention, automatic communication matching can be realized, and the problems of high cost and poor software reusability in the prior art are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automobile technology, and in particular to a communication matching method, a communication component and a storage medium. Background Art

[0002] In automobile R&D, in order to shorten the R&D cycle and reduce R&D costs, communication components (such as controllers) are designed to be reused on multiple models without any changes.

[0003] Currently, hardware can be reused for different car models, but software cannot be reused because the network architectures of different car models are different and the communication protocols are different. Therefore, for the same communication component hardware, different software usually needs to be developed according to the specific car model, which increases software development and management costs. In addition, different software needs to be flashed according to the car model during the production stage. This not only increases the risk of flashing errors, but is also very time-consuming and labor-intensive, greatly increasing costs. Summary of the invention

[0004] Based on this, the present application provides a communication matching method, a communication component and a storage medium, which can realize automatic communication matching and improve the problems of high cost and poor software reusability in the prior art.

[0005] In the first aspect, the present application provides a communication matching method, which includes: running the software after flashing the software using the union of communication matrices of multiple vehicle models; monitoring the reception status of messages to be received, and identifying the current vehicle model based on the reception status; switching the communication interface based on the current vehicle model to achieve communication matching between the communication components.

[0006] In combination with the first aspect, in a first possible implementation manner of the first aspect, the aforementioned step of monitoring the reception status of the messages to be received and identifying the current vehicle model based on the reception status includes: monitoring whether each message in the messages to be received is received and / or whether the reception has timed out, and recording the monitoring results in the receiving status corresponding to each message in the messages to be received; identifying the current model based on the monitoring results and the communication matrix of the communication components under each model; identifying the current model based on the current model of the communication components and the network architecture of each vehicle model.

[0007] In combination with the first possible implementation of the first aspect, in the second possible implementation of the first aspect, before identifying the current model according to the monitoring results and the communication matrix of the communication component under each model, the communication matching method also includes: after recording the receiving status of all messages in the messages to be received, executing the step of identifying the current model according to the monitoring results and the communication matrix of the communication component under each model; wherein the step of identifying the current model according to the monitoring results and the communication matrix of the communication component under each model includes: according to the communication matrix of the communication component under each model, identifying the model of the communication component to which each message in the messages to be received belongs, and reading the receiving status of each message; if the messages with a receiving status of received state all come from the same model of communication component, then determining that the same model is the current model of the communication component; or, if the messages with a receiving status of received state all come from the same model of communication component, and the messages with a receiving status of timed out state all come from other models of communication components, then determining that the same model is the current model of the communication component.

[0008] In combination with the first possible implementation method of the first aspect, in the third possible implementation method of the first aspect, the steps of monitoring whether each message in the messages to be received is received and / or whether the reception has timed out, and recording the monitoring results in the reception status corresponding to each message in the messages to be received include: if a message to be received is received, calling the message reception callback function, and setting the reception status of the received message to a received status; if the message to be received is not received within each preset time length, calling the message timeout callback function, and setting the reception status of the not received message to a timed out status or an indeterminate status.

[0009] In combination with the first possible implementation method of the first aspect, in the fourth possible implementation method of the first aspect, the above-mentioned steps of monitoring whether each message in the message to be received is received and / or whether the reception has timed out, and recording the monitoring results in the reception status corresponding to each message in the message to be received, include: if a message to be received is received, calling the message reception callback function, and setting the reception status value of the received message to be received to zero, to indicate that the corresponding message is in a received state; if the message to be received is not received within each preset time length, using the message timeout callback function, if the reception status value of the message to be received is less than the preset value, then the reception status value is incremented by one, if it is equal to the preset value, then no modification is made, wherein a reception status value greater than zero and less than the preset value indicates that the message is in an indeterminate state, and a reception status value equal to the preset value indicates that the message is in a timed out state.

[0010] In combination with the first aspect, in the fifth possible implementation of the first aspect, before running the software, it also includes: receiving a configuration instruction for configuring a message reception callback function and / or a message timeout callback function; and in response to the configuration instruction, configuring a callback function for each message in the message to be received.

[0011] In combination with the first aspect, in a sixth possible implementation manner of the first aspect, the aforementioned step of switching the communication interface based on the current vehicle model to achieve communication matching between the communication components includes: calling the message enable interface to enable the messages supported by the current vehicle model, so that the messages supported by the current vehicle model can be received and sent; and / or, calling the message disable interface to disable the messages not supported by the current vehicle model, so that the messages not supported by the current vehicle model cannot be received and sent.

[0012] On the second aspect, the present application also provides a communication component, which includes: a starting unit, used to run the software after the software is flashed using the union of communication matrices of multiple vehicle models; an identification unit, used to monitor the reception status of the messages to be received, and identify the current vehicle model based on the reception status; a matching unit, used to switch the communication interface based on the current vehicle model, so that communication matching is achieved between the communication components.

[0013] In combination with the second aspect, in a first possible implementation manner of the second aspect, the aforementioned identification unit is specifically used to: monitor whether each message in the messages to be received is received and / or whether the reception has timed out, and record the monitoring results in the receiving status corresponding to each message in the messages to be received; identify the current model based on the monitoring results and the communication matrix of the communication components under each model; identify the current model based on the current model of the communication components and the network architecture of each model.

[0014] In combination with the first feasible embodiment of the second aspect, in the second feasible embodiment of the second aspect, the aforementioned identification unit is specifically used for: after recording the receiving status of all messages in the messages to be received, identifying the model of the communication component to which each message in the messages to be received belongs according to the communication matrix of the communication component under each model, and reading the receiving status of each message; if the messages with the receiving status as the received status all come from the communication component of the same model, then determining that the same model is the current model of the communication component; or, if the messages with the receiving status as the received status all come from the communication component of the same model, and the messages with the receiving status as the timed-out status all come from communication components of other models, then determining that the same model is the current model of the communication component.

[0015] In combination with the first feasible implementation method of the second aspect, in the third feasible implementation method of the second aspect, the aforementioned identification unit is specifically used to: if a message to be received is received, call the message reception callback function, and set the reception status of the received message to a received state; if the message to be received is not received within each preset time length, call the message timeout callback function, and set the reception status of the not received message to a timed out state or an indeterminate state.

[0016] In combination with the first possible implementation mode of the second aspect, in the fourth possible implementation mode of the second aspect, the aforementioned identification unit is specifically used for: if a message to be received is received, calling the message reception callback function, and setting the reception status value of the received message to be received to zero, to indicate that the corresponding message is in a received state; if the message to be received is not received within each preset time length, using the message timeout callback function, if the reception status value of the message to be received is less than the preset value, then the reception status value is incremented by one, if it is equal to the preset value, then no modification is made, wherein a reception status value greater than zero and less than the preset value indicates that the message is in an uncertain state, and a reception status value equal to the preset value indicates that the message is in a timed-out state.

[0017] In combination with the second aspect, in a fifth possible implementation of the second aspect, the communication device also includes a configuration unit, which is used to: receive a configuration instruction for configuring a message reception callback function and / or a message timeout callback function; and configure a callback function for each message in the message to be received in response to the configuration instruction.

[0018] In combination with the second aspect, in a sixth possible implementation manner of the second aspect, the aforementioned matching unit is specifically used to: call a message enable interface to enable messages supported by the current vehicle model, so that messages supported by the current vehicle model can be received and sent; and / or, call a message disable interface to disable messages not supported by the current vehicle model, so that messages not supported by the current vehicle model cannot be received and sent.

[0019] In a third aspect, the present application also provides a communication component, which includes a processor and a memory, and the processor and the memory are connected via a bus; the processor is used to execute multiple instructions; the memory is used to store multiple instructions, and the instructions are suitable for being loaded by the processor and executed as the communication matching method of the first aspect or any one of the embodiments of the first aspect.

[0020] In a fourth aspect, the present application further provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor and executed by a communication matching method such as the first aspect or any one embodiment of the first aspect.

[0021] In summary, the present application provides a communication matching method, a communication component and a storage medium. In order to improve the problems of high cost and poor software reusability in the prior art, the present application writes the union of communication matrices of multiple vehicle models to each communication component, so that after the software is run, the communication component can identify the message sent by any model of communication component based on the union, and automatically identify the current vehicle model according to the message reception situation, and then automatically switch the communication interface based on the vehicle model, thereby realizing automatic communication matching between the communication components. Therefore, for any vehicle model, there is no need to write different communication matrices according to the vehicle model, nor is there any need to customize the message format or add a signal to the message to indicate the current vehicle model. A universal communication component and communication matrix can be used, thereby realizing software reuse and reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is a power domain network architecture diagram of a P1 vehicle model in an embodiment of the present application;

[0023] Figure 2 This is a power domain network architecture diagram of a P2 vehicle model in an embodiment of the present application;

[0024] Figure 3 A flow chart of a communication matching method in one embodiment of the present application;

[0025] Figure 4 A flow chart of a communication matching method in one embodiment of the present application;

[0026] Figure 5 A schematic diagram of a process of calling a message receiving callback function in an embodiment of the present application;

[0027] Figure 6 A flowchart of calling a message timeout callback function in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0029] At present, for the same communication component hardware, different software needs to be developed according to the specific vehicle model, and different software needs to be flashed according to the vehicle model during the production stage to match the communication protocol of the current vehicle model. However, this method is very time-consuming and labor-intensive, greatly increases costs, and increases the risk of flashing errors.

[0030] In this regard, the present application provides a communication matching method. During the research and development stage and the production stage, there is no need to consider the differences in vehicle models. Instead, the software of each communication component is flashed using the union of the communication matrices of multiple vehicle models. After the software is running, the current vehicle model is identified based on the reception status of the message to be received, and then the communication interface is switched based on the current vehicle model, so that the communication components can only communicate according to the communication matrix allowed by the vehicle under the current vehicle model, thereby achieving communication matching between the communication components.

[0031] The present application can identify the current vehicle model based on the reception situation of the message because different vehicle models select different types of communication components based on their respective network architectures. As a result, even if different vehicle models use the same communication component hardware, the communication matrices may be different due to the different models of communication components, which in turn leads to differences in the messages sent and received. Therefore, the present application can identify the current vehicle model based on the reception situation.

[0032] For example, if Figure 1 The P1 model's power domain network architecture and Figure 2 As shown in the power domain network architecture of the P2 model, although the P1 model and the P2 model have the same communication component hardware, including the vehicle control unit (VCU), battery management system (BMS), motor control unit (MCU) and on-board charging controller (OBC), the models of the communication components are not completely consistent. Among them, the MCU (model M101) of the P1 model is different from the MCU (model M201) of the P2 model. The models of the VCU (model V101), BMS (model B101), and OBC (model 0101) of the P1 model and the P2 model are the same. Because the models of the MCU of the P1 model and the P2 model are different, there are differences in the communication matrices of the P1 model and the P2 model, which leads to differences in the messages sent and received between the communication components. Therefore, the present application can identify the current model of the vehicle according to the message reception situation.

[0033] More specifically, continue with Figure 1 and Figure 2 Take the network architecture shown in the figure as an example. If the VCU receives a message with a message ID of 1234, and the message comes from an MCU of model M101, then refer to Figure 1 The network architecture indicates that the VCU is currently equipped with a P1 model. If the VCU receives a message with a message identifier of 5678, and the message comes from an MCU of model M201, then refer to Figure 2 The network architecture shows that the VCU is currently equipped with a P2 model.

[0034] It should be noted that the communication component proposed in this application can be a controller, a processor or an electronic control unit (ECU). In addition, any communication component can exchange data with other communication components, controllers, processors, ECUs, etc., and execute the method proposed in this application.

[0035] In order to better understand the communication matching method proposed in this application, this application also provides an embodiment of the communication matching method, such as Figure 3 As shown, next, this application uses the communication component as the execution subject to explain the method in detail:

[0036] 100: After flashing the software using the union of the communication matrices of multiple vehicle models, run the software;

[0037] 200: monitoring the reception status of the message to be received, and identifying the current vehicle model according to the reception status;

[0038] 300: Switch the communication interface based on the current vehicle model to achieve communication matching between various communication components.

[0039] For step 100, multiple vehicle models represent at least two vehicle models that need software reuse, and multiple vehicle models include all or part of the vehicle models of the manufacturer or on the market. The communication matrix describes in detail the message information that needs to be received and sent between each node (communication component) in the network to ensure the effective interaction and sharing of information between each node in the network. The communication matrices of different types of communication devices are different. In order to achieve software reuse, this application flashes the communication device with the union of the communication matrices of multiple vehicle models, so as to ensure that the communication device can receive and identify the messages sent by multiple types of communication components based on the union before achieving communication matching. Run the software, and each communication component starts to send and receive messages.

[0040] For step 200, the message to be received refers to the message whose message reception situation needs to be monitored by the communication component. The message to be received can be part of the messages or all the messages corresponding to the communication component in the union of the aforementioned communication matrix. The reception situation of the message includes at least one of whether it has been received and whether it has timed out. The current vehicle model can be determined based on the message reception situation, because there are differences in the communication matrices of different vehicle models, and this difference is reflected in the message reception situation. The device types of the communication components of different vehicle models are different, and the communication matrices followed by the communication components of different device types are different, so that the messages sent and received are different. For example, when the current vehicle model is the target vehicle model, the communication component will only receive the message corresponding to the target vehicle model, and will not receive the message corresponding to other vehicle models. Therefore, the current vehicle model can be identified according to the reception situation of the message to be received. When the message of the target vehicle model is received, it can be determined that the current vehicle model is the target vehicle model.

[0041] The present application determines the vehicle model based on the message reception situation, rather than directly recording the vehicle model in the message. Although the method of directly recording the vehicle model allows the receiving end to quickly determine the current vehicle model, this method requires modification of the message, and requires the equipment manufacturer to customize the communication matrix, modify the message format and / or add a signal to the message to indicate the vehicle model. It is impossible to directly apply general communication components, so there are problems of high cost and poor software reusability. The present application identifies the current vehicle model based on the message reception situation, does not need to modify the message format and / or message signal, does not need customized communication components, and can use general communication components, thereby reducing costs and improving the problem of poor software reusability in the prior art.

[0042] For step 230, after determining the current vehicle model, the communication component obtains the communication matrix corresponding to the current vehicle model, and switches the communication interface to the interface allowed by the current vehicle model according to the communication matrix, so that each communication component can only communicate through the interface allowed by the current vehicle model, thereby sending and receiving messages allowed under the current vehicle model. In this regard, the present application provides a specific implementation method, which realizes communication interface switching by calling a message enable interface (for example, an Autosar message enable interface) and / or calling a message disable interface (for example, an Autosar message disable interface), thereby realizing communication matching. Specifically, the aforementioned step of switching the communication interface based on the current vehicle model to realize communication matching between each communication component includes: calling the message enable interface to enable the messages supported by the current vehicle model, so that the messages supported by the current vehicle model can be received and sent; and / or, calling the message disable interface to disable the messages not supported by the current vehicle model, so that the messages not supported by the current vehicle model cannot be received and sent.

[0043] Among them, the messages supported by the current model refer to the messages defined in the communication matrix corresponding to the current model, and the messages not supported by the current model refer to the messages not defined in the communication matrix corresponding to the current model. Calling the message enable interface means activating or enabling an interface through commands, etc., to ensure that it can correctly receive, process or forward messages. Calling the message disable interface means disabling or blocking an interface through commands, etc. in network communication or software systems, so that it cannot receive, process or forward messages.

[0044] When receiving a message, the message parsing callback function corresponding to the message supported by the current vehicle model is used to parse the received message. For example, for the same received message, when the P1 vehicle model is identified, the message will not be parsed in the M201 message parsing callback function, but will be parsed in the M101 message parsing callback function, thus achieving the reception of the correct message.

[0045] When sending a message, the message filling callback function corresponding to the message supported by the current vehicle model is used to fill the signal to be sent. For example, for the same sending signal, when the P1 vehicle model is identified, the message sent to M201 will be prohibited and the message cannot be sent, while the message sent to M101 will be enabled, the M101 message filling callback function will be called, and the signal will be sent along with the message.

[0046] When choosing whether to call the message enable interface and the message disable interface, in one case, the message enable interface and the message disable interface can be called at the same time to ensure the accuracy of communication matching. In the other case, when there are many models of software reuse, it can be selected to call only the message enable interface to improve the efficiency of communication matching.

[0047] For step 200, in one possible implementation, the communication component can read the identifier of the message, and obtain the vehicle model that uniquely corresponds to the identifier of the message in the mapping relationship table between the message and the vehicle model. Before obtaining the mapping relationship table, the communication component can determine the model of each communication component under each vehicle model based on the network architecture of each vehicle model in advance, and then determine the message corresponding to each model based on the communication matrix of each communication component under each model, and then associate the vehicle model with the corresponding message to generate a mapping relationship table.

[0048] Regarding step 200, in another possible implementation, as Figure 4 As shown, the aforementioned monitoring of the reception of the message to be received and identifying the current vehicle model according to the reception status include:

[0049] 210: monitoring whether each message in the to-be-received message is received and / or whether the reception is timed out, and recording the monitoring result in the receiving status corresponding to each message in the to-be-received message;

[0050] 220: Identify the current model according to the monitoring result and the communication matrix of the communication component under each model;

[0051] 230: According to the network architecture of each vehicle model, identify the current vehicle model according to the current model of the communication component.

[0052] Among them, because the communication matrices corresponding to the communication components under different models are different, and the communication matrix records the messages sent and received between each node, the present application directly identifies the current model of the communication component based on the communication matrix, and each vehicle model uses different models of communication components under different network architectures, so the present application can identify the current vehicle model based on the network architecture and current model of the vehicle model. In addition, by implementing this embodiment, there is no need to flash the additional information of the mapping relationship table between the message and the vehicle model, and the current vehicle model can be directly identified, reducing the modification of the code and the flashing of the software, so that while improving automation, the risk of flashing errors can be further reduced, reducing costs.

[0053] Furthermore, in order to improve the effect of the present application in communication matching, such as improving performance such as accuracy and real-time performance, the present application also provides some possible implementation methods:

[0054] In one possible implementation, before executing step 220, the present application first records the monitoring results in the receiving status of each message, and identifies the current model only after recording the receiving status of all messages in the to-be-received messages. During identification, it is necessary not only to determine that all messages from a certain model of communication components in the to-be-received messages are received, but also to determine that all messages from other models of communication components in the to-be-received messages are received overtime. Such double insurance is used to improve the accuracy of detecting communication matching. Specifically, before identifying the current model according to the monitoring results and the communication matrix of the communication components under each model, the communication matching method further includes:

[0055] After recording the receiving status of all messages in the messages to be received, the model of the communication component to which each message in the messages to be received belongs is identified according to the communication matrix of the communication component under each model, and the receiving status of each message is read; if the messages with a receiving status of received are all from the communication component of the same model, the same model is determined to be the current model of the communication component; or, if the messages with a receiving status of received are all from the communication component of the same model, and the messages with a receiving status of timed out are all from communication components of other models, the same model is determined to be the current model of the communication component.

[0056] The messages to be received include all messages or iconic messages of each model of the communication component in the corresponding communication matrix. The iconic message is derived from a single model of the communication component, that is, each iconic message is associated with a model of the communication component. Figure 1 and Figure 2 For example, assume that the MCU model M101 and the MCU model M201 have some messages in common and some messages in different. For example, the message with message ID 1234 comes only from the MCU model M101, and the message with message ID 5678 comes only from the MCU model M201. Therefore, the message with message ID 1234 is the identification message of the MCU model M101, and the message with message ID 1234 is the identification message of the MCU model M201.

[0057] As in the two methods mentioned above, the present application improves the different effects that can be achieved by communication matching by selecting different messages to be received, so as to achieve better accuracy and real-time performance respectively: for example, when the messages to be received include all messages of various models of communication components in the corresponding communication matrix, when identifying the current model, it is necessary to identify according to the receiving status of all the aforementioned messages to determine the current model of the communication component, thereby ensuring the accuracy of communication matching; for another example, when the messages to be received include iconic messages of various models of communication components in the corresponding communication matrix, when identifying the current model, only the receiving status of the aforementioned iconic messages is required to determine the current model of the communication component, thereby ensuring the real-time performance of communication matching and saving computing resources and computing time.

[0058] In another practicable manner, in order to further improve the real-time performance of communication matching, the present application defines the aforementioned to-be-received message as a landmark message, that is, the to-be-received message includes landmark messages of various models of communication components in the corresponding communication matrix, and when the present application monitors that a landmark message has been received, it directly identifies the model of the communication component to which the landmark message belongs according to the communication matrix, without having to determine whether all to-be-received messages have been received or all landmark messages have been received and / or whether the reception has timed out before determining the current model of the communication component. Therefore, the present implementation can ensure the real-time performance of communication matching. Specifically, the aforementioned step of identifying the current model according to the monitoring results and the communication matrix of the communication component under each model includes: receiving a message from the communication component, if the message is a landmark message, stopping further monitoring, and identifying the model of the communication component to which the landmark message belongs according to the communication matrix of the communication component under each model, and using the model of the communication component to which the landmark message belongs as the current model of the communication component.

[0059] Among them, the iconic message is obtained based on the difference in communication matrices of the communication components under various models. Specifically, before executing step 200, the present application takes a difference set of the communication matrices of the communication components under various models, and uses the messages in the difference set as the iconic messages corresponding to each model. The process of determining the iconic message can be executed before running the software, and the association relationship file between the iconic message and the model of the communication component is written to each communication component in advance, or when the message of the communication component is received, the process is used to determine in real time whether the message is a iconic message, thereby reducing software flashing and reducing costs.

[0060] Regarding step 210, since the software architecture of the on-board communication components is usually an Autosar architecture and is automatically generated using tools such as ETAS or Vector, for quality considerations, it is generally not allowed to modify the code generated by the tool. Therefore, the present application also provides a specific implementable method, which can meet the software architecture of the on-board communication components and reduce the modification of the code. Specifically, the aforementioned step of monitoring whether each message in the to-be-received message is received and / or whether the reception has timed out, and recording the monitoring results in the receiving status corresponding to each message in the to-be-received message, includes: if a to-be-received message is received, calling the message receiving callback function, and setting the receiving status of the received message to the received status; if the to-be-received message is not received within each preset time length, calling the message timeout callback function, and setting the receiving status of the unreceived message to the timed out state or the indeterminate state.

[0061] Among them, the Autosar tool supports the configuration of message reception callback function and message timeout callback function. During configuration, a message reception callback function and a message timeout callback function are configured for each message to be received, so that when the software is running, whenever a message to be received is received, the reception callback function corresponding to the ID of the message to be received will be triggered to call, and the reception status of the received message will be set to the received status. The received status indicates that the message has been received, and the message timeout callback function is called for the unreceived message to be received at a preset time interval, and the reception status of the unreceived message is set to the timed-out status or the indeterminate status. The timed-out status indicates that the message has timed out, and the indeterminate status indicates that the message has not been received and has not timed out yet.

[0062] In order to improve the recording and reading efficiency, the present application also provides an enumerated receiving state, and each different receiving state value is used to represent the receiving state, as shown in the following table 1:

[0063] Receive status value Receiving status 0x00 Received status 0x01-0x0f Uncertain state 0x10 Timed out state

[0064] Table 1

[0065] In combination with the receiving status values ​​under each receiving status shown in Table 1, the aforementioned steps of monitoring whether each message in the to-be-received message is received and / or whether the reception has timed out, and recording the monitoring results in the receiving status corresponding to each message in the to-be-received message, include: if a to-be-received message is received, calling the message receiving callback function, and setting the receiving status value of the received message to be received to zero, to indicate that the corresponding message is in a received state; if the to-be-received message is not received within each preset time length, using the message timeout callback function, if the receiving status value of the to-be-received message is less than the preset value, then increasing the receiving status value by one, and if it is equal to the preset value, not modifying it, wherein a receiving status value greater than zero and less than the preset value indicates that the message is in an uncertain state, and a receiving status value equal to the preset value indicates that the message is in a timed out state.

[0066] Among them, the initial state value of the receiving state value of the message to be received is an arbitrary value less than 0x10. In order to ensure that the communication match has sufficient time to accurately monitor the message reception status of the message to be received, the initial value can be 0x00. Since the preset duration is a shorter duration, after the software starts running, the message timeout callback function can be called for the unreceived message to be received within a shorter duration, so as to quickly distinguish the initial state from the received state. In addition, in order to strictly distinguish the initial state from the received state while ensuring that the communication match has sufficient time to accurately monitor the message reception status of the message to be received, the initial state value can also be set to a value slightly greater than 0x00, such as 0x01. The receiving state value of the timed-out state can indicate that the message has not been received within n preset durations, and the receiving state value of the indeterminate state indicates that the message has not been received within less than n preset durations, where n is an integer greater than 1. Based on Table 1, n is equal to 0x10.

[0067] In addition, when receiving a message to be received, for example Figure 5 As shown, the message receiving callback function is called to set the receiving state value of the received message to be received to zero, to indicate that the corresponding message is in the received state; if the message to be received is not received within each preset time length, for example Figure 6 As shown, the message timeout callback function is used to determine whether the receiving status value of the message to be received is less than the threshold value. If the receiving status value of the message to be received is less than the preset value, the receiving status value is incremented by one. If the receiving status value of the message to be received is not less than the preset value, no modification is made.

[0068] In one implementable manner, the present application can also configure a callback function according to user requirements, and the communication component responds to the user's configuration instructions and automatically configures a callback function for each message in the message to be received. Specifically, before running the software, it also includes: receiving a configuration instruction for configuring a message reception callback function and / or a message timeout callback function; and responding to the configuration instruction, configuring a callback function for each message in the message to be received.

[0069] The present application also provides a communication component. The embodiment of the present application can divide the functional modules of the device according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. Specifically, the communication component includes: a startup unit for running the software after the software is flashed using the union of the communication matrices of multiple vehicle models; an identification unit for monitoring the reception of the message to be received and identifying the current vehicle model according to the reception situation; a matching unit for switching the communication interface based on the current vehicle model so that communication matching is achieved between the communication components.

[0070] In one possible implementation, the aforementioned identification unit is specifically used to: monitor whether each message in the messages to be received is received and / or whether the reception has timed out, and record the monitoring results in the receiving status corresponding to each message in the messages to be received; identify the current model based on the monitoring results and the communication matrix of the communication components under each model; identify the current model based on the current model of the communication components and the network architecture of each model.

[0071] In one possible implementation, the aforementioned identification unit is specifically used for: after recording the receiving status of all messages in the messages to be received, identifying the model of the communication component to which each message in the messages to be received belongs according to the communication matrix of the communication component under each model, and reading the receiving status of each message; if the messages with a receiving status of received all come from a communication component of the same model, then determining that the same model is the current model of the communication component; or, if the messages with a receiving status of received all come from a communication component of the same model, and the messages with a receiving status of timed out all come from communication components of other models, then determining that the same model is the current model of the communication component.

[0072] In one possible implementation, the aforementioned identification unit is specifically used to: if a message to be received is received, call the message reception callback function, and set the reception status of the received message to a received status; if the message to be received is not received within each preset time period, call the message timeout callback function, and set the reception status of the unreceived message to a timed-out status or an indeterminate status.

[0073] In one possible implementation, the aforementioned identification unit is specifically used for: if a message to be received is received, calling a message reception callback function, and setting the reception status value of the received message to be received to zero, to indicate that the corresponding message is in a received state; if the message to be received is not received within each preset time length, using a message timeout callback function, if the reception status value of the message to be received is less than a preset value, then increasing the reception status value by one, if it is equal to the preset value, then not modifying it, wherein a reception status value greater than zero and less than the preset value indicates that the message is in an uncertain state, and a reception status value equal to the preset value indicates that the message is in a timed-out state.

[0074] In one possible implementation, the communication device further includes a configuration unit, configured to: receive a configuration instruction for configuring a message reception callback function and / or a message timeout callback function; and configure a callback function for each message in the to-be-received message in response to the configuration instruction.

[0075] In one possible implementation, the aforementioned matching unit is specifically used to: call a message enable interface to enable messages supported by the current vehicle model, so that messages supported by the current vehicle model can be received and sent; and / or, call a message disable interface to disable messages not supported by the current vehicle model, so that messages not supported by the current vehicle model cannot be received and sent.

[0076] The present application also provides a communication component, which may include: a processor and a memory. The processor and the memory are connected via a bus. The processor is used to execute multiple instructions; the memory is used to store multiple instructions, which are suitable for being loaded by the processor and executed as the communication matching method in the above embodiment. Among them, the processor can be an electronic adjustment unit (Electronic Control Unit, ECU), a central processing unit (central processing unit, CPU), a general processor, a coprocessor, a digital signal processor (digital signal processor, DSP), an application-specific integrated circuit (application-specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The processor can also be a combination that realizes computing functions, such as a combination of one or more microprocessors, a combination of 5SP and a microprocessor, and so on. In this embodiment, the processor can use a single-chip microcomputer, and various control functions can be realized by programming the single-chip microcomputer. The processor has the advantages of powerful computing power and fast processing. Specifically, the processor is used to execute the function of the startup unit, which is used to run the software after the software is flashed using the union of the communication matrices of multiple vehicle models; it is also used to execute the function of the identification unit, which is used to monitor the reception status of the messages to be received and identify the current vehicle model based on the reception status; it is also used to execute the function of the matching unit, which is used to switch the communication interface based on the current vehicle model to achieve communication matching between the communication components.

[0077] In one possible implementation, the aforementioned processor is specifically used to: monitor whether each message in the messages to be received is received and / or whether the reception has timed out, and record the monitoring results in the receiving status corresponding to each message in the messages to be received; identify the current model according to the monitoring results and the communication matrix of the communication components under each model; identify the current model according to the current model of the communication components and the network architecture of each model.

[0078] In one possible implementation, the aforementioned processor is specifically used to: after recording the receiving status of all messages in the messages to be received, identify the model of the communication component to which each message in the messages to be received belongs according to the communication matrix of the communication component under each model, and read the receiving status of each message; if the messages with a receiving status of received all come from a communication component of the same model, then determine that the same model is the current model of the communication component; or, if the messages with a receiving status of received all come from a communication component of the same model, and the messages with a receiving status of timed out all come from communication components of other models, then determine that the same model is the current model of the communication component.

[0079] In one possible implementation, the aforementioned processor is specifically used to: if a message to be received is received, call the message reception callback function, and set the reception status of the received message to a received status; if no message to be received is received within each preset time period, call the message timeout callback function, and set the reception status of the unreceived message to a timed-out status or an indeterminate status.

[0080] In one possible implementation, the aforementioned processor is specifically used to: if a message to be received is received, call the message reception callback function, and set the reception status value of the received message to be received to zero, to indicate that the corresponding message is in a received state; if the message to be received is not received within each preset time length, use the message timeout callback function, if the reception status value of the message to be received is less than the preset value, then increase the reception status value by one, if it is equal to the preset value, do not modify it, wherein a reception status value greater than zero and less than the preset value indicates that the message is in an uncertain state, and a reception status value equal to the preset value indicates that the message is in a timed-out state.

[0081] In one possible implementation, the aforementioned processor is also used to execute the function of the configuration unit, which is used to: receive configuration instructions for configuring a message reception callback function and / or a message timeout callback function; and configure a callback function for each message in the message to be received in response to the configuration instructions.

[0082] In one possible implementation, the aforementioned processor is specifically used to: call a message enable interface to enable messages supported by the current vehicle model, so that messages supported by the current vehicle model can be received and sent; and / or, call a message disable interface to disable messages not supported by the current vehicle model, so that messages not supported by the current vehicle model cannot be received and sent.

[0083] In one embodiment, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method in any of the foregoing embodiments. The processor is used to execute the plurality of instructions; the memory is used to store the plurality of instructions, which are loaded by the processor and execute the communication matching method in the foregoing embodiments.

[0084] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0085] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A communication matching method, characterized in that: The method comprises: After flashing the software using the union of the communication matrices of multiple vehicle models, run the software; Monitoring the reception status of the message to be received, and identifying the current vehicle model according to the reception status; The communication interface is switched based on the current vehicle model so that communication matching is achieved between the communication components.

2. The method according to claim 1, characterized in that The step of monitoring the reception status of the message to be received and identifying the current vehicle model according to the reception status includes: Monitoring whether each message in the to-be-received message is received and / or whether the reception has timed out, and recording the monitoring result in the receiving status corresponding to each message in the to-be-received message; Identify the current model based on the monitoring results and the communication matrix of the communication components under each model; The current vehicle model is identified based on the current model of the communication component and the network architecture of each vehicle model.

3. The method according to claim 2, characterized in that Before identifying the current model according to the monitoring results and the communication matrix of the communication component under each model, the method further includes: After recording and obtaining the receiving status of all messages in the to-be-received messages, executing the step of identifying the current model according to the monitoring result and the communication matrix of the communication component under each model; Among them, the step of identifying the current model according to the monitoring results and the communication matrix of the communication component under each model includes: according to the communication matrix of the communication component under each model, identifying the model of the communication component to which each message in the to-be-received message belongs, and reading the receiving status of each message; if the messages with a receiving status of received state all come from the same model of communication component, then determining that the same model is the current model of the communication component; or, if the messages with a receiving status of received state all come from the same model of communication component, and the messages with a receiving status of timed out state all come from other models of communication components, then determining that the same model is the current model of the communication component.

4. The method according to claim 2, characterized in that: The step of monitoring whether each message in the to-be-received message is received and / or whether the reception is timed out, and recording the monitoring result in the receiving status corresponding to each message in the to-be-received message includes: If a message to be received is received, the message receiving callback function is called to set the receiving state of the received message to the received state; If the message to be received is not received within each preset time period, the message timeout callback function is called to set the receiving state of the unreceived message to the timed-out state or the indeterminate state.

5. The method according to claim 2, characterized in that: The step of monitoring whether each message in the to-be-received message is received and / or whether the reception is timed out, and recording the monitoring result in the receiving status corresponding to each message in the to-be-received message includes: If a message to be received is received, the message receiving callback function is called to set the receiving status value of the received message to be received to zero to indicate that the corresponding message is in the received state; If the message to be received is not received within each preset time period, the message timeout callback function is used. If the receiving status value of the message to be received is less than the preset value, the receiving status value is incremented by one. If it is equal to the preset value, no modification is made. Among them, a receiving status value greater than zero and less than the preset value indicates that the message is in an uncertain state, and a receiving status value equal to the preset value indicates that the message is in a timed-out state.

6. The method according to claim 1, characterized in that Before running the software, also include: Receiving a configuration instruction for configuring a message receiving callback function and / or a message timeout callback function; In response to the configuration instruction, a callback function is configured for each message in the to-be-received message.

7. The method according to claim 1, characterized in that The step of switching the communication interface based on the current vehicle model so as to achieve communication matching between the communication components includes: Call the message enabling interface to enable the messages supported by the current vehicle model, so that the messages supported by the current vehicle model can be received and sent; And / or, calling a message prohibition interface to prohibit messages that are not supported by the current vehicle model, so that the messages that are not supported by the current vehicle model cannot be received and sent.

8. A communication component, characterized in that: The communication component comprises: A startup unit, used to run the software after flashing the software using the union of the communication matrices of the plurality of vehicle models; An identification unit, used to monitor the reception status of the message to be received, and identify the current vehicle model according to the reception status; The matching unit is used to switch the communication interface based on the current vehicle model so that communication matching is achieved between the communication components.

9. A communication component, characterized in that: The communication component includes a processor and a memory, and the processor and the memory are connected via a bus; the processor is used to execute multiple instructions; the memory is used to store the multiple instructions, and the instructions are suitable for being loaded by the processor and executing the communication matching method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the communication matching method according to any one of claims 1 to 7.