Message address configuration method and device and sensor
By sending address configuration messages through the ECU, the sensors automatically configure CAN message addresses, solving the problem of low configuration efficiency in existing technologies and achieving efficient address allocation for engine sensors.
Patent Information
- Application Number
- CN202410748181.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-24
AI Technical Summary
In existing technologies, the configuration efficiency of CAN message addresses for engine sensors is low, requiring manual configuration and failing to achieve automated and efficient configuration.
The ECU sends an address configuration message, and the sensor automatically configures the message address based on the initial address configuration rules and the target address configuration rules. The automatic address configuration between sensors is achieved using the CAN line of the controller area network without manual intervention.
It enables automatic configuration of sensor message addresses, improves configuration efficiency, reduces manual intervention, and is suitable for efficient address allocation of similar sensors in multi-cylinder engines.
Smart Images

Figure CN118694745A
Abstract
Description
Background Art
[0002] Usually, the engine is equipped with various sensors to detect relevant parameters of the engine in real time, and the engine control unit (ECU) in the engine is responsible for receiving feedback data from the sensors through a single controller area network (CAN) and accurately controlling the engine through the feedback data.
[0003] In the related art, engines, especially large engines, require a large number of sensors, and more than one of each sensor is equipped. For example, a large-bore marine diesel engine is usually equipped with a single-cylinder exhaust temperature sensor and an oil mist concentration detection sensor. A 20-cylinder engine needs to be installed with 20 sets of sensors, that is, 20 exhaust temperature sensors and 20 oil mist concentration detection sensors. In order to be able to distinguish each sensor under the same type, it is necessary to assign a different CAN message address to it. Currently, the allocation of CAN message addresses is usually completed by relevant personnel manually configuring each sensor before or after it leaves the factory, and the configuration efficiency is low. Summary of the invention
[0004] The embodiments of the present application provide a message address configuration method, device and sensor to improve the efficiency of message address configuration.
[0005] A method for configuring a message address provided in an embodiment of the present application includes:
[0006] Determining that a message address needs to be configured based on a received address configuration message, wherein the address configuration message is sent by the ECU or an adjacent sensor;
[0007] Based on the initial address configuration rule, determine a target address configuration rule corresponding to a first CAN line among the CAN lines connected to the sensor; the first CAN line is a CAN line used to receive the address configuration message;
[0008] A first message address is configured for the sensor based on the target address configuration rule, and the address configuration message is sent through a second CAN line in the CAN lines.
[0009] Another message address configuration method provided in an embodiment of the present application includes:
[0010] After power-on, confirm the address configuration message;
[0011] The address configuration message is sent to adjacent sensors based on the CAN line, so that each sensor determines the need to configure the message address based on the address configuration message, and configures its own message address based on the target address configuration rule; the target address configuration rule is determined based on the initial address configuration rule and the CAN line used to receive the address configuration message.
[0012] An embodiment of the present application provides a message address configuration device, including:
[0013] A first determining unit, configured to determine that a message address needs to be configured based on a received address configuration message, wherein the address configuration message is sent by the ECU or an adjacent sensor;
[0014] A second determining unit is used to determine, based on the initial address configuration rule, a target address configuration rule corresponding to a first CAN line among the CAN lines connected to the sensor; the first CAN line is a CAN line used for receiving the address configuration message;
[0015] A configuration unit is used to configure a first message address for the sensor based on the target address configuration rule, and send the address configuration message through a second CAN line in the CAN lines.
[0016] Optionally, the communication network is a ring communication network, and the configuration unit is specifically used to:
[0017] If the address configuration message is sent by an adjacent sensor, then configuring a first message address for the sensor based on the target address configuration rule and a second message address sent by the adjacent sensor; or
[0018] If the address configuration message is sent by the ECU, determine the configuration information to be obtained based on the target address configuration rule;
[0019] Based on the target address configuration rule and the obtained configuration information, configure a first message address for the sensor, wherein the configuration information includes a default message address and a total number of the sensors obtained through the address configuration message; the default message address is preset or obtained through the address configuration message;
[0020] The configuration unit is specifically used for:
[0021] The address configuration message and the first message address are sent via a second CAN line in the CAN lines.
[0022] Optionally, the initial address configuration rule is pre-stored in the sensor, or is acquired by the sensor in the address configuration message.
[0023] Optionally, the configuration unit is further used for:
[0024] If the address configuration message is not received within the first preset time period and a data message is received from other sensors, a first message address is configured for the sensor based on the data messages sent by each other sensor received within the second preset time period and the target address configuration rule, wherein each of the data messages is generated by the other sensors based on the detected engine data and other message addresses.
[0025] Optionally, the configuration unit is specifically used to:
[0026] If the initial address configuration rule is pre-stored in the sensor, then from the data messages, each data message received based on the same CAN line is selected; based on the initial address configuration rule, a target address configuration rule corresponding to the same CAN line is determined; based on other message addresses contained in the selected data messages and the target address configuration rule, a first message address is configured for the sensor;
[0027] If the initial address configuration rule is stored in the address configuration message, then from each data message, the data messages received based on the same CAN line are selected; the target address configuration rule is determined based on other message addresses contained in the selected data messages; based on the other message addresses contained in the selected data messages and the target address configuration rule, the first message address is configured for the sensor.
[0028] Another message address configuration device provided in an embodiment of the present application includes:
[0029] A first determining unit, used to determine the address configuration message after power-on;
[0030] A sending unit is used to send the address configuration message to adjacent sensors based on the CAN line, so that each sensor determines the need to configure the message address based on the address configuration message, and configures its own message address based on the target address configuration rule; the target address configuration rule is determined based on the initial address configuration rule and the CAN line used to receive the address configuration message.
[0031] Optionally, the communication network is a ring communication network, and the device further includes:
[0032] A second determining unit, configured to determine that the message address configuration is finished upon receiving the address configuration message sent by another adjacent sensor or after reaching a third preset time period if the address configuration message is sent to an adjacent sensor;
[0033] If the address configuration message is sent to two adjacent sensors respectively, then when it is determined that the data messages received from the two adjacent sensors include the data messages of each sensor in the ring communication network, or after the third preset time period is reached, it is determined that the message address configuration is completed; each data message is generated by each sensor based on the detected engine data and other message addresses, and is sent after the message address configuration is completed.
[0034] A sensor provided in an embodiment of the present application is used to execute the steps of the corresponding message address configuration method mentioned above.
[0035] An embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the sensor or ECU executes the steps of the above-mentioned corresponding message address configuration method.
[0036] The beneficial effects of this application are as follows:
[0037] The embodiments of the present application provide a message address configuration method, device and sensor. In the present application, the sensor and the ECU are connected and communicated via a controller area network (CAN) line. The ECU sends an address configuration message to automatically configure the message address of each sensor. Specifically, each sensor can directly receive the address configuration message sent by the ECU, or receive the address configuration message forwarded by an adjacent sensor. After determining that the message address needs to be configured, based on the initial address configuration rule, the target address configuration rule corresponding to the CAN line used for the received address configuration message is determined, and its own message address is configured based on the target address configuration rule. After the configuration is completed, the address configuration message is forwarded to the next sensor, thereby completing the address configuration process of all sensors of the same type. No manual intervention is required, which greatly improves the address configuration efficiency.
[0038] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0040] Figure 1 A schematic diagram of an application scenario of a message address configuration method provided in an embodiment of the present application;
[0041] Figure 2 An overall flow chart of a message address configuration method provided in an embodiment of the present application;
[0042] Figure 3A A schematic diagram of the topological structure of a first ring communication network provided in an embodiment of the present application;
[0043] Figure 3B A schematic diagram of the topological structure of the first single-link communication network provided in an embodiment of the present application;
[0044] Figure 3C A schematic diagram of the topological structure of the first multi-chain communication network provided in an embodiment of the present application;
[0045] Figure 4A A schematic diagram of the first type of sending address configuration message provided in an embodiment of the present application;
[0046] Figure 4B A schematic diagram of a second type of sending address configuration message provided in an embodiment of the present application;
[0047] Figure 4C A schematic diagram of a third type of sending address configuration message provided in an embodiment of the present application;
[0048] Figure 5A A schematic diagram of distinguishing a CAN line provided in an embodiment of the present application;
[0049] Figure 5B A ring networking architecture diagram of a sensor and an ECU provided in an embodiment of the present application;
[0050] Figure 6 An overall flow chart of another message address configuration method provided in an embodiment of the present application;
[0051] Figure 7 A flowchart of interaction between an ECU and a sensor provided in an embodiment of the present application;
[0052] Figure 8 A flow chart for configuring a message address when replacing a sensor provided in an embodiment of the present application;
[0053] Fig. 9 A schematic diagram of the structure of a message address configuration device provided in an embodiment of the present application;
[0054] Fig.10 A schematic diagram of the structure of another message address configuration device provided in an embodiment of the present application;
[0055] Fig.11 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0057] The following is an introduction to some concepts involved in the embodiments of the present application.
[0058] Engine Control Unit (ECU): An electronic control module that manages and monitors various engine functions, such as ignition timing, fuel injection, valve control, etc.
[0059] Data message: A message containing engine data, which is used to transmit various data detected by sensors, such as temperature, pressure, crankshaft position, etc., to the ECU so that the ECU can adjust the operation of the engine according to the engine data. The data message also contains the message address of the sensor that generated the data message.
[0060] Message address: A unique identifier assigned to each sensor in order to distinguish the same type of sensors at different locations on the same engine. In this application, it mainly includes the first message address, the second message address, and other message addresses. Among them, the first message address is the message address of a sensor itself, the second message address is the message address of the sensor adjacent to the sensor, and the other message addresses are the message addresses of other sensors except the sensor.
[0061] Address configuration rules: rules that sensors need to follow when configuring message addresses. In this application, address configuration rules mainly include initial address configuration rules and target address configuration rules, where the initial address configuration rules contain two sub-rules. The sensor can select the corresponding sub-rule based on the CAN line used to receive the address configuration message, and use the sub-rule as the target address configuration rule. The parameters in the target address configuration rule will change with the sender of the address configuration message received by the sensor. The sensor can determine the specific content of the parameter based on the data it receives. For example, if the address configuration message and the second message address are received, it can be determined that the parameter is related to the second message address. If only the address configuration message is received, it can be determined that the parameter is related to the configuration information.
[0062] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0063] like Figure 1 As shown, it is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario diagram includes a six-cylinder engine, an engine control unit 120 and six sensors 110 in the engine, and the six sensors are respectively located in the six cylinders of the engine.
[0064] In the embodiment of the present application, the above-mentioned six sensors 110 can be exhaust temperature sensors, oil mist concentration detection sensors, etc., and the present application does not make specific limitations. The six sensors 110 are all the same type of sensors installed in different positions (different cylinders) of the engine, that is, the six sensors 110 are all exhaust temperature sensors, or the six sensors 110 are all oil mist concentration detection sensors; the engine control unit 120 is also the ECU.
[0065] In actual scenarios, each cylinder of the engine contains not only one sensor, but multiple sensors of different types exist in each cylinder at the same time, such as the exhaust temperature sensor and oil mist concentration detection sensor mentioned above, but the message address configuration method proposed in this application is only applicable to sensors of the same type in multiple cylinders, that is, when the message address configuration method proposed in this application is executed between a group of sensors, this group of sensors are all sensors of the same type. Therefore, only one sensor is shown in each cylinder in the figure, and the six sensors are of the same type.
[0066] The six sensors 110 and the engine control unit 120 may be connected via CAN lines to form a communication network for communication between the sensors 110 and the engine control unit 120 . The topology of the communication network may be a ring communication network, a chain network, or the like.
[0067] It should be noted that the message address configuration method in each embodiment of the present application is jointly executed by the sensor 110 and the engine control unit 120. For example, the engine control unit 120 can send an address configuration message through a single or dual CAN line, and the sensor 110 that receives the address configuration message determines the target address configuration rule corresponding to the CAN line used to receive the address configuration message based on the initial address configuration rule; finally, the sensor 110 configures the message address for itself based on the target address configuration rule, and forwards the address configuration message to the next entity in the ring communication network.
[0068] It should be noted that Figure 1 The figure is only an example. In fact, the number of engine cylinders and the number of sensors are not limited, and are not specifically limited in the embodiments of the present application.
[0069] In addition, the embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation and other scenarios.
[0070] The following describes the message address configuration method provided by the exemplary embodiment of the present application in combination with the application scenario described above and with reference to the accompanying drawings. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this regard.
[0071] See also Figure 2 As shown, it is an implementation flow chart of a message address configuration method provided in an embodiment of the present application. The specific implementation process of the method is as follows S201-S203:
[0072] S201: The sensor determines that the message address needs to be configured based on the received address configuration message.
[0073] S202: The sensor determines, based on the initial address configuration rule, a target address configuration rule corresponding to a first CAN line among the CAN lines connected to the sensor.
[0074] In the above, the sensor is responsible for detecting the relevant data of the engine and reporting it to the ECU in the form of a message. Since some engines may have multiple sensors of the same type at the same time, in order to distinguish the messages sent by sensors of the same type installed in different positions of the engine, it is necessary to configure the message address (also known as the node address) for the sensor. For example, sensors w and v are the same sensor, but they are installed in different positions in the engine. The message address of sensor w is set to 0x18FCA155, and the message address sent by sensor v is set to 0x18FCA255.
[0075] It should be noted that the above message address settings are only examples, and this application does not make specific limitations. When this application gives examples of message addresses in the following, for the convenience of description, the specific form of the message addresses will be simplified.
[0076] In the related art, the configuration of the above-mentioned message address is often performed manually before or after the sensor leaves the factory, and the configuration efficiency is low.
[0077] Therefore, the present application proposes a message address configuration method that can be automatically executed. In the present application, sensors of the same type in an engine are all located in a communication network. The communication network includes multiple entities, such as an ECU and multiple sensors of the same type. The entities in the communication network are connected through a controller area network CAN line, and the sensors are installed at different positions of the engine.
[0078] The topology of the communication network can be ring, chain, etc. Figure 3A As shown, it is a schematic diagram of the topological structure of a ring communication network provided in an embodiment of the present application, such as Figure 3B As shown, it is a schematic diagram of the topological structure of a single-link communication network provided in an embodiment of the present application, such as Figure 3C , which is a schematic diagram of the topological structure of a multi-chain communication network provided in an embodiment of the present application.
[0079] It should be noted that Figures 3A-3C The number of sensors is only an example and is not specifically limited in this application.
[0080] Taking a specific scenario as an example, assuming that there is a large-diameter 20-cylinder marine diesel engine (ie, engine), each cylinder includes a single-cylinder exhaust temperature sensor, then the above 20 exhaust temperature sensors can form a ring communication network or a chain communication network with the ECU based on the CAN line.
[0081] For the convenience of description, except for special instructions, the present application will be mainly described by taking a ring communication network as an example.
[0082] The address configuration message is generated and sent by the ECU. An optional implementation method is that after the engine is powered on, the ECU determines the address configuration message and sends the address configuration message to adjacent sensors based on the CAN line, so that each sensor determines the need to configure the message address based on the address configuration message, and configures its own message address based on the target address configuration rule.
[0083] In the above, the configuration of the message address will be executed every time the engine is powered on, but the ECU only needs to generate and send the address configuration message when the engine is powered on for the first time. After that, when the engine is powered on, it only needs to directly call the address configuration message generated at the first power-on and send it.
[0084] Afterwards, the ECU sends address configuration messages to adjacent sensors, that is, sensors directly connected to the ECU, based on the CAN line. Optionally, in a ring communication network, the ECU can send an address configuration message to only one of the adjacent sensors, or it can send an address configuration message to two adjacent sensors simultaneously or successively; in a chain communication network, the ECU needs to send address configuration messages to all adjacent sensors.
[0085] Take a ring communication network as an example, Figure 4A , Figure 4B as well as Figure 4C As shown, it is a schematic diagram of three types of sending address configuration messages provided in an embodiment of the present application, Figure 4A , Figure 4B as well as Figure 4C The ring communication network in each includes three sensors and one ECU, among which: Figure 4A If the ECU only sends the address configuration message to the adjacent sensor a, the message address configuration process will be executed clockwise based on the CAN line; Figure 4B In the case where the ECU only sends the address configuration message to the adjacent sensor b, the message address configuration process will be executed counterclockwise based on the CAN line; Figure 4C In the case where the ECU sends address configuration messages to adjacent sensor a and adjacent sensor b, assuming that the address configuration messages are sent simultaneously, the message address configuration process will be started simultaneously based on the left and right CAN lines.
[0086] If it is a chain-shaped communication network, the message address configuration process is executed sequentially along each chain.
[0087] After receiving the address configuration message, the sensor will determine the target address configuration rule based on the initial address configuration rule.
[0088] In the above, the address configuration message received by each sensor in the communication network is sent by the ECU or forwarded by a sensor adjacent to the sensor; the initial address configuration rule can be pre-stored in the sensor, or configured in the address configuration message and obtained by the sensor in the address configuration message.
[0089] The determination of the initial address configuration rule and the target address configuration rule is related to the way the ECU sends the address configuration message. The following still takes the ring communication network composed of three sensors and one ECU as an example to explain the different situations.
[0090] Case 1: Assume that the ECU simultaneously sends address configuration messages to two sensors a and b adjacent to the ECU. Then, sensor a and sensor b receive the address configuration message first, and after receiving the address configuration message, they perform the configuration operation of the message address.
[0091] At this time, the initial address configuration rule includes two sub-rules. Sensor a and sensor b will determine which sub-rule to use as the target address configuration rule based on the CAN line used to receive the address configuration message, that is, the first CAN line.
[0092] Assume that the sub-rule corresponding to CAN line α is x+n, and the sub-rule corresponding to CAN line β is yn; Figure 5A As shown, it is a schematic diagram of distinguishing a CAN line provided in an embodiment of the present application. For a sensor, CAN line α is a CAN line connected to the i end of the sensor, and CAN line β is a CAN line connected to the j end of the sensor.
[0093] like Figure 5B As shown, it is a ring networking architecture diagram of a sensor and an ECU provided in an embodiment of the present application. Due to the limited size of the picture, CAN line α is omitted as α, and CAN line β is omitted as β in the figure. The same CAN line belongs to CAN line α for the sensor connected to one end, and belongs to CAN line β for the sensor connected to the other end. Each sensor and ECU are connected end to end through the CAN line to form a ring communication network architecture.
[0094] n in the two sub-rules of the initial address configuration rule is a constant and can be set based on actual needs. For example, n can be 1, 2, 3...; x and y are parameters, and their actual contents will change according to different situations. The details will be explained in S303 and will not be repeated here.
[0095] Furthermore, for a sensor, the first CAN line corresponding to itself is the CAN line used for receiving the address configuration message; in the above example, for sensor a, the CAN line α connected to the i-end of sensor a is the first CAN line; for sensor b, the CAN line β connected to the j-end of sensor b is the first CAN line. If sensor a receives the address configuration message based on CAN line α, it will select sub-rule x+n as the target address configuration rule in the initial address configuration rule, and if sensor b receives the address configuration message based on CAN line β, it will select sub-rule yn as the target address configuration rule in the initial address configuration rule.
[0096] In addition, if the address configuration rules are configured in the address configuration message, the ECU can also directly send address configuration messages containing different address configuration rules to sensor a and sensor b. For example, x+n is directly configured in the address configuration message and sent to sensor a, and yn is configured in the address configuration message and sent to sensor b. This application does not make specific limitations.
[0097] After configuring their own message addresses, sensor a and sensor b will forward the address configuration message to the next sensor. In the above scenario, the next sensor of sensor a and sensor b is sensor c. Sensor c will only configure its message address based on the same operation when it receives the address configuration message for the first time. It can directly ignore the address configuration message received later.
[0098] For example, after sensor a has completed the configuration of the message address first, it sends the address configuration message to sensor c. Sensor c receives the address configuration message forwarded by sensor a based on the CAN line α corresponding to itself. In the initial address configuration rule, sub-rule x+n is selected as the target address configuration rule to configure its own message address, and the address configuration message sent by sensor b is directly ignored. If sensor b has completed the configuration of the message address first, and then sends the address configuration message to sensor c, sensor c receives the address configuration message forwarded by sensor b based on the CAN line β corresponding to itself, sub-rule yn is selected as the target address configuration rule in the initial address configuration rule to configure its own message address, and the address configuration message sent by sensor a is directly ignored.
[0099] Case 2: Assuming that the ECU only sends an address configuration message to a sensor adjacent to the ECU, and further assuming that the ECU sends an address configuration message to sensor a unidirectionally, sensor a first receives the address configuration message, and after receiving the address configuration message, performs the configuration operation of the message address.
[0100] In this case, the initial address configuration rule can also include two sub-rules. Sensor a will determine which sub-rule to use as the target address configuration rule based on the CAN line used to receive the address configuration message, that is, the first CAN line. Specifically, sensor a receives the address configuration message based on CAN line α, then it selects x+n as the target address configuration rule, and then configures the message address for itself. After the configuration is completed, the address configuration message is sent to sensor c; sensor c also performs the above operation, and sends the address configuration message to sensor b after the message address is configured. Sensor b sends the address configuration message to the ECU after the message address is configured. In this process, all sensors will select sub-rule x+n as the target address configuration rule.
[0101] In addition, if the address configuration rule is configured in the address configuration message, the ECU may also directly configure x+n in the address configuration message and send it to the sensor a.
[0102] If the ECU sends the address configuration message to sensor b in a single channel, sensor b first receives the address configuration message, and after receiving the address configuration message, performs the configuration operation of the message address.
[0103] In this case, the initial address configuration rule can include two sub-rules. When sensor b receives the address configuration message based on CAN line β, it selects yn as the target address configuration rule, and then configures the message address for itself. After the configuration is completed, the address configuration message is sent to sensor c. Sensor c also performs the above operation, and sends the address configuration message to sensor a after the message address is configured. Sensor a sends the address configuration message to the ECU after the message address is configured. In this process, all sensors will select sub-rule yn as the target address configuration rule.
[0104] In addition, if the address configuration rule is configured in the address configuration message, the ECU can also directly configure yn in the address configuration message and send it to the sensor b.
[0105] If it is a single-chain communication network, since there is only one communication link, the CAN line used by each sensor to receive the address configuration message, that is, the first CAN line is consistent. Therefore, in this case, the initial address configuration rule can only contain one sub-rule, and each sensor directly uses the sub-rule as the target address configuration rule; if it is a dual-chain communication network, similar to the ring communication network, the initial address configuration rule contains two sub-rules, and each sensor determines the target address configuration rule according to the first CAN line; if it is a multi-chain communication network and the number of chains is greater than 2, the corresponding number of address configuration rules can be configured according to the specific number of links and allocated to sensors on different links.
[0106] The above-mentioned various specific initial address configuration rules, sub-rules, target address configuration rules, parameters, constants, specific operations (addition, subtraction, multiplication and division) in the rules, and the correspondence between CAN lines and sub-rules are only examples. Other rules that can implement address configuration are applicable to this application, and this application does not make specific limitations.
[0107] Next, we will introduce the specific process of configuring the message address of the sensor based on the target address configuration rule.
[0108] S203: The sensor configures a first message address for the sensor based on the target address configuration rule, and sends the address configuration message through a second CAN line in the CAN line.
[0109] In the above, after configuring its own first message address, the sensor will not only forward the address configuration message, but also send its own configured message address, that is, the first message address, to the next entity in the communication network. The second CAN line is the other CAN line of the two CAN lines connected to the sensor except the first CAN line.
[0110] An optional implementation manner is that if the address configuration message is sent by an adjacent sensor, the sensor configures a first message address for the sensor based on the target address configuration rule and the second message address sent by the adjacent sensor.
[0111] For a sensor, the first message address is the message address of the sensor itself, and the second message address is the message address of a sensor adjacent to the sensor.
[0112] The assumption of a ring communication network consisting of three sensors and one ECU is still used. In this ring communication network, no matter it is the case one described in S202 where the ECU sends an address configuration message, or the case two described in S202 where the ECU sends an address configuration message, since sensor c is not directly connected to the ECU, the address configuration message it receives must be forwarded by an adjacent sensor, and it will definitely receive the second message address sent by the adjacent sensor. Therefore, it needs to configure its own first message address according to the target address configuration rule and the second message address sent by the adjacent sensor.
[0113] Assume that the address configuration message is sent by sensor a, and the target address configuration rule is x+n.
[0114] In the target address configuration rule, parameter x will change with the sender of the address configuration message received by the sensor. For the case where an adjacent sensor sends an address configuration message, parameter x can be the second message address of the adjacent sensor, or a multiple of the second message address of the adjacent sensor, etc.
[0115] Taking parameter x as the second message address of the adjacent sensor as an example, correspondingly, for sensor c, it can receive the message address of sensor a sent by sensor a, and the address configuration message forwarded by sensor a, then it determines that x is the message address of sensor a. Sensor c can obtain its own message address based on the message address of sensor a plus the constant n, and then send the address configuration message and its own message address to sensor b through the second CAN line.
[0116] If sensor b has been configured with a message address (corresponding to case 1 of S202), the message can be ignored directly; if it is the first time to receive an address configuration message (corresponding to case 2 of S202, the ECU sends an address configuration message to sensor a unidirectionally), the same operation is performed, and its own message address is obtained based on the message address of sensor c plus the constant n. After that, the address configuration message and its own message address are sent to the ECU through the second CAN line.
[0117] Similarly, parameter y will also change with the sender of the address configuration message received by the sensor. If the address configuration message received by sensor c is sent by sensor b, and the target address configuration rule is yn, in this case, sensor c will also receive the message address of sensor b. It can be determined that parameter y is related to the message address of sensor b, for example, y is the message address of sensor b, or a multiple of the message address of sensor b, etc.
[0118] In addition, sub-rules x+n and yn correspond to each other to ensure that the message addresses of the same sensor calculated using different sub-rules are consistent. For example, for sensor c, if x is the message address of sensor a, then y is the message address of sensor b.
[0119] If the address configuration message received by a certain sensor is sent directly by the ECU, the sensor needs to determine the configuration information that needs to be obtained based on the target address configuration rule; and configure the first message address for the sensor based on the target address configuration rule and the obtained configuration information.
[0120] In the above, the configuration information includes the default message address and the total number of sensors obtained through the address configuration message; the default message address is preset in the sensor, and can also be configured in the address configuration message and obtained by the sensor in the address configuration message.
[0121] That is, if the address configuration message received by the sensor is sent directly by the ECU, the sensor will not receive the second message address. After receiving the address configuration message and not receiving the second message address within a certain period of time, it can determine that the parameters in the target address configuration rule are related to the configuration information.
[0122] Assume that the ECU simultaneously sends address configuration messages to two sensors a and b adjacent to the ECU. The target address configuration rule corresponding to sensor a is x+n, and the target address configuration rule corresponding to sensor b is yn.
[0123] As mentioned in the previous article, parameter x will change with the sender of the address configuration message received by the sensor. For the case where an adjacent sensor sends an address configuration message, parameter x is related to the second message address of the adjacent sensor, and for the case where the ECU sends an address configuration message, parameter x is related to the default message address. For example, parameter x can be the default message address.
[0124] Similarly, parameter y will also change with the sender of the address configuration message received by the sensor. For the case where an adjacent sensor sends an address configuration message, parameter y is related to the second message address of the adjacent sensor, while for the case where the ECU sends an address configuration message, parameter y is related to the total number of sensors. In addition, parameter y at this time is also related to the default message address.
[0125] In the above scenario, it is also necessary to ensure that x+n corresponds to yn to ensure that the message address obtained in the end is consistent even if the ECU sends the address configuration message in different ways or other situations cause the same sensor to select different target address configuration rules each time when configuring its own message address.
[0126] As shown in Table 1, this is a target address configuration rule proposed in this application. If the ECU is the sender of the address configuration message, after the sensor receives the address configuration message and does not receive the second message address within a certain period of time, it can determine that x or y is related to the configuration information, and determine the specific calculation rule according to the corresponding target address configuration rule; if the adjacent sensor is the sender of the address configuration message, after the sensor receives the address configuration message and receives the second message address, it can determine that x or y is related to the second message address, and determine the specific calculation rule according to the corresponding target address configuration rule.
[0127] Table 1 Target address configuration rules
[0128]
[0129] Assume that there are 4 sensors connected end to end with the ECU to form a ring communication network, the default message address is 0, and n is 1. In any case, the message addresses configured by the 4 sensors for themselves are ultimately 1, 2, 3, and 4.
[0130] The following uses various chain-shaped communication networks as examples for explanation.
[0131] If it is a single-link communication network, assuming that the sub-rule in the initial address configuration rule is x+n, for the case where the adjacent sensor sends an address configuration message, the parameter x is related to the second message address of the adjacent sensor, and for the case where the ECU sends an address configuration message, the parameter x is related to the default message address; the initial address configuration rule can also be yn. For the case where the adjacent sensor sends an address configuration message, the parameter y is related to the second message address of the adjacent sensor, and for the case where the ECU sends an address configuration message, the parameter y is related to the total number of sensors.
[0132] If it is a dual-chain communication network, the sub-rules in the initial address configuration rules can be similar to those of the ring communication network, which are x+n and yn, but can also be x1+n and x2+n, etc. Specifically, assuming that each link in the dual-chain communication network contains 3 sensors, the default message address is 121, and n is 1, then the parameters x1 and x2 will also change with the sender of the address configuration message received by the sensor. For the case where the adjacent sensor sends the address configuration message, the parameters x1 and x2 are related to the second message address of the adjacent sensor. For the case where the ECU sends the address configuration message, x1 can be the default message address, that is, 121, and x2 can be the default message address + 3, that is, 124.
[0133] If it is a multi-chain communication network and the number of chains is greater than 2, the address configuration rules that can be obtained by the sensors in each link or the sensors pre-configured in each link are different. For example, the address configuration rules corresponding to the sensors in each link can be x1+n, x2+n, x3+n, x4+n..., respectively. The parameters will change with the sender of the address configuration message received by the sensor. For the case where the adjacent sensor sends the address configuration message, the parameters x1, x2, x3, x4... are related to the second message address of the adjacent sensor, and for the case where the ECU sends the address configuration message, the parameters x1, x2, x3, x4 are related to the default message address but the parameters are not equal to each other.
[0134] In addition, the ECU also needs to be able to determine when the message address configuration is completed, and after the message address configuration is completed, detect the message address configuration of each sensor, so as to promptly discover sensors with abnormal message address configuration and issue an alarm.
[0135] Taking a ring communication network as an example, an optional implementation method is that if the ECU sends an address configuration message to an adjacent sensor, it determines that the message address configuration is completed when it receives the address configuration message sent by another adjacent sensor, or after reaching a third preset time period; if the ECU sends address configuration messages to two adjacent sensors respectively, it determines that the message address configuration is completed when it determines that the data messages received from the two adjacent sensors include the data messages generated by each sensor in the ring communication network, or after reaching the third preset time period.
[0136] If it is a chain communication network, the message address configuration is determined to be completed after it is determined that the data messages received from the adjacent sensors include the data messages generated by each sensor in the chain communication network, or after a third preset time period is reached.
[0137] That is, the data messages sent by all sensors will eventually be sent to the ECU through the sensors adjacent to the ECU, that is, the sensors directly connected to the ECU; when the data messages received by the ECU through the adjacent sensors include the data messages generated by all sensors, the ECU determines that the message address configuration is completed, or after reaching the third preset time period, it determines that the message address configuration is completed.
[0138] In the above, each data message is generated based on the detected engine data and the message address of the sensor that generates the data message.
[0139] Each sensor is generated based on the detected engine data and other message addresses, and sent after the message address configuration is completed. The other message addresses refer to the message addresses corresponding to other sensors.
[0140] Taking the ring communication network as an example, after the sensor completes its own message address configuration, it can detect the engine data normally, and report the engine data to the ECU in the form of data messages through the CAN line according to the preset message cycle. If there are other sensors between the sensor and the ECU, the message transmission needs to be forwarded to the ECU through other sensors layer by layer. Therefore, when the ECU sends address configuration messages to two sensors adjacent to the ECU at the same time, it can determine that the message address configuration is completed after receiving the data messages sent by all sensors; in addition, if the ECU still does not receive the data messages sent by all sensors after exceeding the third preset time period, it will also determine that the message address configuration is completed, and detect the message address configuration of the sensor to determine that the message address has been configured and configured correctly. If there is a sensor that has not been configured successfully (such as the message address is not configured, or the message address is configured incorrectly, etc.), an alarm will be sent.
[0141] It should be noted that, unlike the configuration of the message address, the uploading of data messages in the ring communication network is dual-line uploading, that is, the sensor will send the data message bidirectionally through the CAN lines at both ends of itself.
[0142] If the ECU sends an address configuration message to an adjacent sensor unidirectionally, the ECU determines that the message address configuration is completed after it receives the address configuration message sent by another adjacent sensor. If the ECU still does not receive the address configuration message sent by another adjacent sensor after exceeding the third preset time period, the ECU will also determine that the message address configuration is completed.
[0143] In summary, in this application, the ECU only needs to send the address configuration message once, and each sensor can configure the message address by itself based on its own position and configuration rules, and continue to forward the address configuration message, so that the subsequent sensor starts the configuration of the message address. This method can reduce the sensor part number management and installation process; in addition, if it is a ring communication network, since the ring communication network structure can communicate in both directions, even if there is a line disconnection somewhere in the structure, data transmission can continue through the CAN line at the other end. When there are a large number of sensors, the overall reliability of the engine communication network can be guaranteed.
[0144] Furthermore, the present application can also realize the direct replacement of sensors while the engine is running without powering off; after the new sensor is installed and powered on, it is in the state of message address to be configured, but because other sensors have been configured with message addresses before, the ECU will not send address configuration messages again. Therefore, in this case, the newly installed sensor can no longer determine the configuration process of the start message address based on the address configuration message.
[0145] However, in this case, the newly installed sensor can receive data messages sent by other sensors to the ECU via the CAN line.
[0146] Therefore, an optional implementation is that if no address configuration message is received in the first preset time period, and a data message sent by other sensors is received, the sensor configures a first message address for the sensor based on the data messages sent by other sensors received in the second preset time period and the target address configuration rule.
[0147] In the above, the data message also includes the message addresses of other sensors that generate the data message; the second preset time period can be set based on actual needs, such as starting the timing from the power-on of the newly installed sensor, or starting the timing from the end of the first preset time period, etc. The setting of the second preset time period needs to ensure that the newly installed sensor receives data messages sent by all other sensors as much as possible.
[0148] Furthermore, if the initial address configuration rule is pre-stored in the sensor, the newly installed sensor selects the data messages received based on the same CAN line from the data messages; based on the initial address configuration rule, the target address configuration rule corresponding to the same CAN line is determined; based on other message addresses contained in the selected data messages and the target address configuration rule, the first message address is configured for the sensor.
[0149] If the newly installed sensor is not a sensor directly connected to the ECU, it can receive data messages sent by other sensors through two CAN lines connected at both ends. If it is a sensor directly connected to the ECU, it can only receive data messages sent by other sensors through one CAN line. In either case, the newly installed sensor only needs to select other message addresses contained in the data message received through one CAN line. The other message addresses are the message addresses corresponding to each of the other sensors.
[0150] Taking the ring communication network as an example, the newly installed sensor can sort the message addresses obtained from the data message. Assuming that it is not a sensor directly connected to the ECU, and the other message addresses contained in the data message received through the CAN line connected to the i end are 4, 2, and 6, and the other message addresses contained in the data message received through the CAN line connected to the j end are 14, 10, and 12. If the target address configuration rule x+n (n=2) corresponding to the CAN line connected to the i end is selected, it can sort 4, 2, and 6, and confirm x as the largest value of the message address, that is, 6, then its own message address is 8.
[0151] If the target address configuration rule yn (n=2) corresponding to the CAN line connected to the j end is selected, it can sort 14, 10, and 12, and confirm x as the smallest value of the message address, that is, 10, then its own message address is 8.
[0152] If the initial address configuration rule is stored in the address configuration message, the sensor needs to select the data messages received based on the same CAN line from the data messages; determine the target address configuration rule based on other message addresses contained in the selected data messages; configure the first message address for the sensor based on the other message addresses contained in the selected data messages and the target address configuration rule.
[0153] That is, the newly installed sensor cannot directly know the initial address configuration rules and the target address configuration rules. It needs to sort the other message addresses contained in the data messages received on the same CAN line, and determine the address configuration rules according to the rules. For example, the rule of 2, 4, and 6 means that the message address of the next sensor is the message address of the previous sensor plus 2. After that, the newly installed sensor configures its own message address based on the address configuration rules and the other message addresses contained in each data message.
[0154] In addition, if the newly installed sensor does not receive an address configuration message within a certain period of time and does not detect data messages sent by other sensors, the sensor is judged to be in the initial power-on state and waits for message address configuration without performing message address configuration or sending messages.
[0155] On the other hand, Figure 6 As shown, it is an overall flow chart of another message address configuration method provided by an embodiment of the present application, with the engine control unit ECU as the execution subject, and specifically performing the following steps:
[0156] Step 601: After power-on, the engine control unit determines the address configuration message.
[0157] If it is the first time to power on, the ECU generates an address configuration message and sends it to one or two adjacent sensors; if it is not the first time to power on, the ECU directly calls the previously generated address configuration message and sends it to one or two adjacent sensors.
[0158] Step 602: The engine control unit sends an address configuration message to adjacent sensors based on the CAN line, so that each sensor determines the need for message address configuration based on the address configuration message, and configures its own message address based on the target address configuration rule.
[0159] Among them, the target address configuration rule is determined based on the initial address configuration rule and the CAN line used by the received address configuration message. After the ECU sends the address configuration message, the address configuration message will be forwarded downward between sensors. The sensor that receives the address configuration message can determine the target address configuration rule in the initial address configuration rule according to the CAN line used by the received address configuration message, and then configure its own message address based on the target address configuration rule, and then send its own message address and address configuration message to the next sensor, so as to realize the automatic configuration of the message address of all sensors.
[0160] like Figure 7 As shown, it is a flow chart of interaction between an ECU and a sensor provided in an embodiment of the present application. Taking a ring communication network as an example, the specific process is as follows:
[0161] Step 701: The ECU sends an address configuration message via a single channel or a dual channel.
[0162] If it is the first time to power on, the ECU generates an address configuration message and sends it to one or two sensors adjacent to the ECU. If it is not the first time to power on, the address configuration message is directly called and sent.
[0163] Step 702: The sensor determines, in the initial address configuration rule, a target address configuration rule corresponding to the CAN line used to receive the address configuration message.
[0164] It should be noted that, in the above, the sensor directly connected to the ECU is the first to receive the address configuration message. After the address configuration of its own message is completed, the sensor will continue to forward the address configuration message. Only then can the subsequent sensors receive the address configuration message and configure it. However, due to the limited length of the flowchart, Figure 7 The sensor in is any sensor in the communication network.
[0165] Step 703: The sensor determines the received content. If only the address configuration message is received, step 704 is executed. If the address configuration message and the second message address are received, step 706 is executed.
[0166] Step 704: The sensor determines that the parameters in the target address configuration rule are related to the configuration information.
[0167] Step 705: configure its own message address according to the target address configuration rule and configuration information, and send its own message address and address configuration message based on another CAN line.
[0168] The sensor sends its own message address and address configuration message to the next entity in the ring communication network based on another CAN line. The entity may be a sensor or an ECU.
[0169] Step 706: The sensor determines that the parameters in the target address configuration rule are related to the second message address.
[0170] Step 707: The sensor configures its own message address according to the target address configuration rule and the second message address, and sends its own message address and the address configuration message based on another CAN line.
[0171] The sensor sends its own message address and address configuration message to the next entity in the ring communication network based on another CAN line. The entity may be a sensor or an ECU.
[0172] Step 708: The sensor sends data messages with its own message address through two CAN channels at the same time.
[0173] After the message address is configured, the sensor can send data messages with its own message address through two CAN lines at the same time according to the preset message cycle, and forward data messages from other sensors to achieve communication with the ECU. The data message contains the engine data detected by the sensor.
[0174] Furthermore, if the sensor receives an address configuration message and does not receive a second message address within a certain period of time, it means that the address configuration message received by the sensor is sent directly by the ECU. The sensor determines that the parameters in the target address configuration rule are related to the configuration information, and configures its own message address according to the target address configuration rule and the configuration information, and then sends its own message address and address configuration message based on another CAN line.
[0175] If the sensor receives the address configuration message and the second message address, it means that the address configuration message received by the sensor is sent by an adjacent sensor. The sensor then determines that the parameters in the target address configuration rule are related to the second message address, and configures its own message address according to the target address configuration rule and the second message address. Then, the sensor continues to send its own message address and address configuration message downward based on another CAN line.
[0176] The sensor with the message address configured can send data messages with its own message address through two CAN lines at the same time according to the preset message cycle, and forward the data messages of other sensors to achieve communication with the ECU.
[0177] When the ECU receives data messages from all sensors, or after a third preset time period is reached, it can be determined that the message address configuration is completed.
[0178] like Figure 8 As shown in the figure, it is a flow chart of configuring the message address when replacing a sensor provided by an embodiment of the present application. Taking a ring communication network as an example, the sensor performs the following steps:
[0179] Step 801: After power-on, the sensor enters the message address configuration mode.
[0180] This situation corresponds to the situation of replacing a sensor. For example, when a sensor in the original ring communication network is damaged, the sensor needs to be replaced. The replacement process does not require downtime. After the new sensor is connected to the network and powered on, it enters the message address configuration mode.
[0181] Step 802: The sensor determines the received message. If it has not received the address configuration message within a certain period of time, but has received the data message from other sensors, step 803 is executed. If it has not received the address configuration message within a certain period of time, nor has it received the data message from other sensors, step 805 is executed.
[0182] Step 803: The sensor configures its own message address based on the received data messages sent by other sensors and the target address configuration rule.
[0183] Since other sensors in the ring communication network have already completed the configuration of the message address, the ECU will no longer send the address configuration message in this case. The newly connected sensor has not received the address configuration message within the preset time, but can receive the data message normally sent by other sensors after engine detection. At this time, it can obtain the data messages sent by all other sensors as much as possible within a certain period of time. The data message contains the other message addresses corresponding to each of the other sensors. According to the other message addresses corresponding to all other sensors obtained, and the target address configuration rules, the newly connected sensor can configure the first message address for itself.
[0184] The specific configuration process has been described in detail in the previous article and will not be repeated here.
[0185] Step 804: After the configuration is completed, the sensor sends data messages with its own message address through two CAN lines at the same time according to the preset message cycle, and forwards data messages of other sensors to achieve communication with the ECU.
[0186] Step 805: The sensor determines that it is in the power-on initial state, and waits for the message address configuration, but does not perform the message address configuration and send the message.
[0187] If it does not receive the address configuration message within a certain period of time, but receives data messages from other sensors, it configures its own message address based on the data messages sent by other sensors and the target address configuration rules. After the configuration is completed, it sends data messages with its own message address through two CAN lines at the same time according to the preset message cycle, and forwards data messages from other sensors to achieve communication with the ECU.
[0188] If the sensor does not receive an address configuration message within a certain period of time, nor does it receive data messages from other sensors, the sensor is judged to be in the power-on initial state and waits for message address configuration without performing message address configuration or sending messages.
[0189] In the present application, the ring networking structure enables multiple sensors to communicate with the ECU through two CAN lines instead of communicating with the ECU individually, thereby improving the overall reliability of the engine communication network.
[0190] Furthermore, the sensor automatically configures its own message address by identifying the message content received based on the two CAN lines; and the present application also supports the dynamic network access function of the sensor, that is, when replacing a damaged sensor, there is no need to cut off the power and stop the machine, and it can be replaced directly, and the new sensor after replacement can also configure its own message address without manual configuration.
[0191] Based on the same inventive concept, the embodiment of the present application also provides a message address configuration device. Fig. 9 As shown, it is a structural diagram of a message address configuration device, which may include:
[0192] A first determining unit 901 is used to determine that a message address needs to be configured based on a received address configuration message, where the address configuration message is sent by an ECU or an adjacent sensor;
[0193] The second determining unit 902 is used to determine, based on the initial address configuration rule, a target address configuration rule corresponding to a first CAN line among the CAN lines connected to the sensor; the first CAN line is a CAN line used for receiving the address configuration message;
[0194] The configuration unit 903 is used to configure a first message address for the sensor based on the target address configuration rule, and send the address configuration message through the second CAN line in the CAN line.
[0195] Optionally, the communication network is a ring communication network, and the configuration unit 903 is specifically used to:
[0196] If the address configuration message is sent by an adjacent sensor, then configuring a first message address for the sensor based on the target address configuration rule and the second message address sent by the adjacent sensor; or
[0197] If the address configuration message is sent by the ECU, the configuration information to be obtained is determined based on the target address configuration rule;
[0198] Based on the target address configuration rule and the obtained configuration information, configure a first message address for the sensor, wherein the configuration information includes a default message address and a total number of sensors obtained through an address configuration message; the default message address is preset or obtained through an address configuration message;
[0199] The configuration unit 903 is specifically used for:
[0200] The address configuration message and the first message address are sent through a second CAN line in the CAN line.
[0201] Optionally, the initial address configuration rule is pre-stored in the sensor, or is obtained by the sensor in an address configuration message.
[0202] Optionally, the configuration unit 903 is further configured to:
[0203] If no address configuration message is received within the first preset time period, and a data message is received from other sensors, a first message address is configured for the sensor based on the data messages sent by each other sensor received within the second preset time period and the target address configuration rule, wherein each data message is generated by other sensors based on the detected engine data and other message addresses.
[0204] Optionally, the configuration unit 903 is specifically configured to:
[0205] If the initial address configuration rule is pre-stored in the sensor, then from each data message, each data message received based on the same CAN line is selected; based on the initial address configuration rule, a target address configuration rule corresponding to the same CAN line is determined; based on other message addresses contained in each selected data message and the target address configuration rule, a first message address is configured for the sensor;
[0206] If the initial address configuration rule is stored in the address configuration message, then from each data message, select each data message received based on the same CAN line; determine the target address configuration rule based on other message addresses contained in each selected data message; configure the first message address for the sensor based on other message addresses contained in each selected data message and the target address configuration rule.
[0207] The present application embodiment also provides another message address configuration device. Fig.10 As shown, it is a structural diagram of a message address configuration device, which may include:
[0208] A first determining unit 1001 is used to determine an address configuration message after power-on;
[0209] The sending unit 1002 is used to send an address configuration message to adjacent sensors based on the CAN line, so that each sensor determines the need to configure the message address based on the address configuration message, and configures its own message address based on the target address configuration rule; the target address configuration rule is determined based on the initial address configuration rule and the CAN line used to receive the address configuration message.
[0210] Optionally, the communication network is a ring communication network, and the device further includes:
[0211] The second determining unit 1003 is used to determine that the message address configuration is completed after receiving the address configuration message sent by another adjacent sensor or after reaching a third preset time period if the address configuration message is sent to an adjacent sensor;
[0212] If the address configuration message is sent to two adjacent sensors respectively, then the message address configuration is determined to be completed when it is determined that the data messages received from the two adjacent sensors include the data messages of each sensor in the ring communication network, or after reaching the third preset time period; each data message is generated by each sensor based on the detected engine data and other message addresses, and is sent after the message address configuration is completed.
[0213] After introducing the message address configuration method and device according to the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.
[0214] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0215] After introducing the message address configuration method and device according to the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.
[0216] Refer to the following Fig.11 To describe the electronic device 1100 implemented according to this embodiment of the present application. Fig.11 The electronic device 1100 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0217] like Fig.11 As shown, the electronic device 1100 is in the form of a general electronic device. The electronic device may be an engine control unit, such as Figure 1 The engine control unit 120 is shown. The components of the electronic device 1100 may include but are not limited to: the at least one processor 1101, the at least one memory 1102, and a bus 1103 connecting different system components (including the memory 1102 and the processor 1101).
[0218] Bus 1103 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
[0219] The memory 1102 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 11021 and / or a cache memory 11022 , and may further include a read-only memory (ROM) 11023 .
[0220] Memory 1102 may also include a program / utility 11025 having a set (at least one) of program modules 11024, such program modules 11024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0221] The electronic device 1100 may also communicate with one or more external devices 1104 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 1105.
[0222] In addition, the electronic device 1100 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 1106. Fig.11 As shown, the network adapter 1106 communicates with other modules for the electronic device 1100 via the bus 1103. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0223] In an exemplary embodiment, a storage medium is also provided, in which a computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the method for configuring the message address of the embodiment of the present application, and when the computer executable instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the above-mentioned method for configuring the message address. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0224] In an exemplary embodiment, the electronic device of the present application may include at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor may execute the steps of the corresponding message address configuration method provided in the embodiment of the present application.
[0225] In an exemplary embodiment, a computer program product is also provided. When the computer program product is executed by an electronic device, the electronic device can implement any exemplary method provided in the present application.
[0226] Furthermore, the computer program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a compact disk read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0227] The program product for message address configuration in the embodiment of the present application may adopt a CD-ROM and include program code, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, an apparatus or a device.
[0228] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0229] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0230] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network such as a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0231] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0232] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0233] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0234] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0235] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0236] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0237] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A message address configuration method, characterized in that: Applied to a sensor, the sensor is located in a communication network, the communication network includes an engine control unit ECU and multiple sensors of the same type, the entities in the communication network are connected via a controller area network CAN line, and the sensors are installed at different positions of the engine, the method includes: Determining that a message address needs to be configured based on a received address configuration message, wherein the address configuration message is sent by the ECU or an adjacent sensor; Based on the initial address configuration rule, determine a target address configuration rule corresponding to a first CAN line among the CAN lines connected to the sensor; the first CAN line is a CAN line used to receive the address configuration message; A first message address is configured for the sensor based on the target address configuration rule, and the address configuration message is sent through a second CAN line in the CAN lines.
2. The method according to claim 1, characterized in that The communication network is a ring communication network, and configuring a first message address for the sensor based on the target address configuration rule includes: If the address configuration message is sent by an adjacent sensor, then configuring a first message address for the sensor based on the target address configuration rule and a second message address sent by the adjacent sensor; or If the address configuration message is sent by the ECU, determine the configuration information to be obtained based on the target address configuration rule; Based on the target address configuration rule and the obtained configuration information, configure a first message address for the sensor, wherein the configuration information includes a default message address and a total number of the sensors obtained through the address configuration message; the default message address is preset or obtained through the address configuration message; The sending of the address configuration message through a second CAN line in the CAN lines includes: The address configuration message and the first message address are sent via a second CAN line in the CAN lines.
3. The method according to claim 1 or 2, characterized in that The initial address configuration rule is pre-stored in the sensor, or is acquired by the sensor in the address configuration message.
4. The method according to claim 3, characterized in that The method further comprises: If the address configuration message is not received within the first preset time period and a data message is received from other sensors, a first message address is configured for the sensor based on the data messages sent by each other sensor received within the second preset time period and the target address configuration rule, wherein each of the data messages is generated by the other sensors based on the detected engine data and other message addresses.
5. The method according to claim 4, characterized in that The configuring a first message address for the sensor based on the data messages sent by each other sensor received within the second preset time period and the target address configuration rule includes: If the initial address configuration rule is pre-stored in the sensor, then from the data messages, each data message received based on the same CAN line is selected; based on the initial address configuration rule, a target address configuration rule corresponding to the same CAN line is determined; based on other message addresses contained in the selected data messages and the target address configuration rule, a first message address is configured for the sensor; If the initial address configuration rule is stored in the address configuration message, then from each data message, the data messages received based on the same CAN line are selected; the target address configuration rule is determined based on other message addresses contained in the selected data messages; based on the other message addresses contained in the selected data messages and the target address configuration rule, the first message address is configured for the sensor.
6. A message address configuration method, characterized in that: Applied to an engine control unit ECU, the ECU is located in a communication network, the communication network also includes a plurality of sensors of the same type, entities in the communication network are connected via a controller area network CAN line, and the sensors are installed at different positions of the engine, the method includes: After power-on, confirm the address configuration message; The address configuration message is sent to adjacent sensors based on the CAN line, so that each sensor determines the need to configure the message address based on the address configuration message, and configures its own message address based on the target address configuration rule; the target address configuration rule is determined based on the initial address configuration rule and the CAN line used to receive the address configuration message.
7. The method according to claim 6, characterized in that The communication network is a ring communication network, and the method further comprises: If the address configuration message is sent to an adjacent sensor, then upon receiving the address configuration message sent by another adjacent sensor, or after reaching a third preset time period, determining that the message address configuration is completed; If the address configuration message is sent to two adjacent sensors respectively, then when it is determined that the data messages received from the two adjacent sensors include the data messages of each sensor in the ring communication network, or after the third preset time period is reached, it is determined that the message address configuration is completed; each data message is generated by each sensor based on the detected engine data and other message addresses, and is sent after the message address configuration is completed.
8. A message address configuration device, characterized in that: include: A first determining unit, configured to determine that a message address needs to be configured based on a received address configuration message, wherein the address configuration message is sent by the ECU or an adjacent sensor; A second determining unit is used to determine, based on the initial address configuration rule, a target address configuration rule corresponding to a first CAN line among the CAN lines connected to the sensor; the first CAN line is a CAN line used for receiving the address configuration message; A configuration unit is used to configure a first message address for the sensor based on the target address configuration rule, and send the address configuration message through a second CAN line in the CAN lines.
9. A message address configuration device, characterized in that: include: A first determining unit, used to determine the address configuration message after power-on; A sending unit is used to send the address configuration message to adjacent sensors based on the CAN line, so that each sensor determines the need to configure the message address based on the address configuration message, and configures its own message address based on the target address configuration rule; the target address configuration rule is determined based on the initial address configuration rule and the CAN line used to receive the address configuration message.
10. A sensor, characterized in that: The sensor is used to execute the message address configuration method according to any one of claims 1 to 5.
