Message transmission method, chip, networking, storage medium and program product
By receiving source messages on the target node in the network and converting them, the problem of high pressure on gateway processing and delayed packet transmission in the prior art is solved, and efficient message transmission and gateway functions are realized.
Patent Information
- Application Number
- CN202510362158.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-27
AI Technical Summary
In the prior art, messages in the network need to be uniformly gathered to the gateway for processing, resulting in high pressure on the gateway to process, long message transmission paths, and large delays.
By receiving source messages on the target node in the network, determining the first data, and determining preset configuration information based on the first data, converting source messages to target messages, directly transmitting target messages to target peripherals, realizing gateway functions.
It reduces the demand for additional processing units, reduces networking costs, shortens message transmission paths, reduces delays, and avoids excessive processing pressure from target nodes.
Smart Images

Figure CN120223769A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of electronic communication technologies, and in particular, to a message transmission method, a chip, a network, a storage medium, and a program product. Background Art
[0002] In related technologies, gateways can be deployed in a network. In some solutions, all buses in the network are connected to the gateway, so that messages sent by peripherals (i.e., peripheral devices) in the network can be transmitted to the gateway through the bus, and functions such as message conversion, routing, and filtering can be implemented through the gateway. However, in the solutions of related technologies, since various messages need to be uniformly aggregated to the gateway for processing and then transmitted to another peripheral device, the processing pressure on the gateway is relatively large, and it is easy to make the message transmission path longer, resulting in a relatively large message transmission delay. Therefore, there is an urgent need for a new technical solution to at least partially improve these problems. Summary of the Invention
[0003] In view of this, embodiments of the present disclosure provide a message transmission method, a chip, a network, a storage medium, and a program product to at least partially solve the above problems.
[0004] According to a first aspect of embodiments of the present disclosure, a message transmission method is provided, which is applied to a target node among multiple nodes of a network. The method includes: receiving a source message, and determining first data based on the source message; determining preset configuration information based on the first data, where the preset configuration information is used for converting the source message into a target message; converting the source message into a target message for a target peripheral device in the network according to the preset configuration information; and transmitting the target message to the target peripheral device.
[0005] According to a second aspect of embodiments of the present disclosure, a chip is provided, including: a processor and a memory, which communicate with each other; the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the method according to any one of the first aspect.
[0006] According to a third aspect of embodiments of the present disclosure, a network is provided, including: multiple connected nodes, where at least one node among the multiple nodes is a target node, and the target node includes the chip according to the second aspect.
[0007] According to a fourth aspect of embodiments of the present disclosure, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the method according to any one of the first aspect.
[0008] According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, which includes a computer program that, when executed by a processor, implements the method described in any one of the first aspect.
[0009] In the message transmission scheme of the embodiments of the present disclosure, on the one hand, it is capable of receiving a source message, determining first data based on the source message, then determining preset configuration information for converting the source message into a target message, and thereafter, in accordance with the determined preset configuration information, converting the source message into a target message for a target peripheral in the network, and then transmitting the target message to the target peripheral. Therefore, the target node among multiple nodes connected to form a network can directly be used as a gateway to implement the gateway function, effectively realizing message conversion and message transmission, and there is no need to additionally deploy a dedicated gateway device in the network, which is beneficial to reducing the network cost; on the other hand, since the target node in the message transmission scheme of this solution is not limited to a specific node in the network and can be served by any node among multiple nodes connected to form a network, after a source message is generated by a certain peripheral, the source message can be sent to the target node nearby to implement message conversion. Thus, the conversion of the message can be processed nearby, and then the target node transmits the converted target message to the corresponding target peripheral, which makes the transmission path of the message not too long, effectively reducing the message transmission delay, and also avoiding excessive processing pressure when the target node implements the gateway function and reducing the processing overhead. In addition, since gateway processing can be implemented at the target node, the requirement for an additional processing unit (such as an MCU, etc.) can be reduced, thereby saving the cost of the additional processing unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the embodiments of the present disclosure, and those of ordinary skill in the art can also obtain other drawings based on these drawings.
[0011] Figure 1 FIG. shows a schematic connection diagram of an in-vehicle gateway in a related art.
[0012] Figure 2 FIG. shows a schematic flowchart of a message transmission method for some examples in the embodiments of the present disclosure.
[0013] Figure 3A FIG. shows a schematic structural diagram of an example network in the embodiments of the present disclosure.
[0014] Figure 3B FIG. shows a schematic structural diagram of another example network in the embodiments of the present disclosure.
[0015] Figure 4 A schematic diagram of a preset configuration table showing some examples in the embodiments of the present disclosure.
[0016] Figure 5 Shows multiple preset configuration tables of some examples in the embodiments of the present disclosure.
[0017] Figure 6 Shows an optional functional schematic diagram of a target node in the embodiments of the present disclosure.
[0018] Figure 7 Shows another optional functional schematic diagram of a target node in the embodiments of the present disclosure.
[0019] Figure 8 Shows a schematic diagram of a functional domain divided in a network in the embodiments of the present disclosure.
[0020] Figure 9 Shows a schematic diagram of a chip of some examples in the embodiments of the present disclosure. Detailed implementation manners
[0021] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and detailedly described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the embodiments of the present disclosure, all other embodiments obtained by those of ordinary skill in the art shall fall within the scope of protection of the embodiments of the present disclosure.
[0022] In the related art, gateways can be deployed in a network. In some solutions, all the buses in the network are connected to the gateway, so that the messages sent by the peripherals (i.e., peripheral devices) in the network can be transmitted to the gateway through the bus, so as to implement functions such as message conversion, routing, and filtering through the gateway. For example, reference can be made to Figure 1 the schematic diagram of the connection manner of the in-vehicle gateway in the related art shown, to understand the connection between the bus and the gateway. In Figure 1 the example, the in-vehicle gateway can be an in-vehicle CAN / LIN gateway. As Figure 1As shown, multiple in-vehicle ECUs (Electronic Control Units) are respectively connected to the in-vehicle CAN (Controller Area Network) bus, CAN-FD (Controller Area Network Flexible Data-Rate) bus, and LIN (Local Interconnect Network) bus. The CAN bus, CAN-FD bus, and LIN bus are connected to a gateway. As Figure 1 As shown, assume that any ECU connected to any bus (for example, taking the CAN bus as an example) sends a message to other ECUs. Then, it needs to be sent to the in-vehicle gateway through the CAN bus, and the in-vehicle gateway realizes functions such as message conversion, routing, and filtering, and then transmits the message to other ECUs on the CAN bus, CAN-FD bus, and LIN bus, so as to realize communication between ECUs. In the solution in the related art, since various messages need to be uniformly aggregated to the gateway for processing and then transmitted to another peripheral device, it is easy to make the message transmission path longer, resulting in a larger message transmission delay.
[0023] According to a first aspect in the embodiments of the present disclosure, a message transmission method is provided. The message transmission method can be applied to a target node among multiple nodes connected in a network. As Figure 2 As shown in the flowchart, the message transmission method includes the following steps S102, S104, S106, and S108. Specifically:
[0024] S102: Receive a source message and determine first data based on the source message.
[0025] It should be noted that the network in the embodiments of the present disclosure can be any network form. For example, in some optional embodiments, the network in the embodiments of the present disclosure can be a ring network or a daisy chain network. Optionally, the target node can be any node among the multiple nodes. Among the multiple nodes in the network, one or more nodes can be used as the target node, and a suitable target node can be selectively deployed in the network as needed.
[0026] Optionally, one of the multiple nodes in the network can be used as the master node, and each of the other nodes can be used as a slave node (also referred to as a subordinate node), so as to form a "one master and multiple slaves" network form.
[0027] For example, Figure 3A As shown in the network schematic diagram, the network is a ring network. In this ring network, node 0 can be the master node, and the remaining nodes 1 to 6 are all slave nodes. Another example, Figure 3BThe network diagram shown, which is a daisy-chain network (the example in this case is a dual daisy-chain, and in other embodiments, it can also be a single daisy-chain, etc.). In this daisy-chain network, node 0 can be the master node, and the remaining nodes 1-6 are all slave nodes. Optionally, the various nodes in the network can be connected through physical transmission media including but not limited to twisted pairs, coaxial cables, etc. The network can include peripherals, which can be connected to different nodes. As Figure 3B shown in and Figure 3A and Figure 3B shown, some peripherals can be connected to the nodes of the network through a bus. For example, as Figure 3A and Figure 3B shown in the example, the bus can be a CAN bus, a CAN-FD bus, a LIN bus, etc. Optionally, as Figure 3A and Figure 3B shown, the master node (node 0) can also be connected to the host side. The network can be connected to the external network through the connection between the master node and the host side, and network isolation from the external network can be achieved through the host side. Network management of the network can also be achieved through the host side. In the embodiments of the present disclosure, for the sake of convenience of description, the peripherals connected to the nodes through the CAN bus can also be called CAN peripherals, the peripherals connected to the nodes through the CAN-FD bus can also be called CAN-FD peripherals, and the peripherals connected to the nodes through the LIN bus can also be called LIN peripherals. For the sake of convenience of description, the following can take the ring network in Figure 3A as an example for illustration.
[0028] In the embodiments of the present disclosure, the nodes in the network can be physical concept nodes. For example, in some embodiments, the nodes can be any module, device, or chip that can implement the solutions of the embodiments of the present disclosure. For example, in some embodiments, each of the multiple nodes includes at least one chip for data transmission in the network. In some embodiments, the node can also be a chip, that is, the chip can be directly used as a node.
[0029] In the embodiments of the present disclosure, the target node can receive the source message. The source message can be generated by the peripheral and transmitted to the target node. Optionally, the source message and the target message are at least one of a CAN protocol message, a CAN-FD protocol message, and a LIN protocol message. It should be understood that by using these types of messages, the stability of message transmission can be effectively ensured, and the message transmission requirements of the network, including but not limited to in-vehicle scenarios, can be effectively adapted.
[0030] In some alternative embodiments, the target node can be connected to buses of multiple different protocols and a physical transmission medium that supports physical layer transmission, receive source messages transmitted through the buses or the physical transmission medium, and transmit the target messages to the outside of the target node through the buses or the physical transmission medium. Thus, the target node in this solution can receive and transmit messages through buses that support multiple protocols, and can also receive and transmit messages based on the physical layer through the physical transmission medium that supports physical layer transmission. Compared with traditional gateways that generally connect a single-protocol bus for message processing and transmission, it is obvious that the applicability of the target node gateway processing function in the message transmission solution of this application embodiment is better. For example, the buses can include but are not limited to CAN bus, CAN-FD bus, LIN bus, etc. For example, the physical transmission medium can include but are not limited to twisted pair, coaxial cable, etc. Further optional content can also be understood by referring to other relevant parts of this application.
[0031] Optionally, when the target node is additionally connected to an external processing unit (such as an MCU, etc.), the source message can also be generated by the external processing unit. The external processing unit generates the source message and sends it to the target node, and the target node can subsequently convert the source message into a target message and transmit it to the target peripheral. In some other embodiments, the target node can also transmit the converted target message to the external processing unit. For example, it can be understood in combination with Figure 6 or Figure 7 the examples shown.
[0032] In some examples, the source message and the target message can both be messages of the same type. For example, it can be the conversion of messages of the same protocol (for example, converting a source message in the form of a CAN protocol message into a target message in the form of another CAN protocol message, etc.). In some other examples, the source message and the target message can be messages of different types. For example, it can perform conversions of different protocols on the source message (for example, converting a source message in the form of a CAN protocol message into a target message in the form of a LIN protocol message, etc.). It will be described in detail below and will not be elaborated here.
[0033] For example, in some alternative embodiments, the peripheral that generates the source message can be a peripheral connected to the target node. For example, taking Figure 3A node 3 as the target node as an example, it is connected to 3 peripherals, namely a CAN peripheral, a CAN-FD peripheral, and a LIN peripheral. All these 3 peripherals can send source messages to node 3 when needed, and the protocol types of the source messages sent by the three are CAN protocol messages, CAN-FD protocol messages, and LIN protocol messages respectively.
[0034] For another example, in some alternative embodiments, the peripheral device that generates the source message may be a peripheral device connected to other nodes in the network except the target node. The message sent by the peripheral device connected to other nodes can be sent to that node and transmitted by that node to the target node through the physical transmission medium (such as twisted pair, coaxial cable) between the nodes in the network link. Optionally, as described below, the message can be transmitted to the target node through the physical transmission medium (such as twisted pair, coaxial cable) between the nodes in the network link based on the physical layer.
[0035] Optionally, the target node may include multiple receiving units. Some receiving units can be respectively used to receive the source messages of the peripheral devices connected to the target node, and some other receiving units can receive the source messages transmitted to the target node through the physical transmission medium between the nodes. For example, referring to Figure 6 or Figure 7 the example shown, the target node may include three receiving units, namely the first receiving unit A1, the second receiving unit A2, and the third receiving unit A3. The first receiving unit A1 can receive the CAN protocol / CAN-FD protocol source messages of the CAN / CAN-FD peripheral devices connected to the target node, the second receiving unit A2 can receive the source messages of the LIN protocol of the LIN peripheral devices connected to the target node, and the third receiving unit A3 can receive the source messages transmitted to the target node through the physical transmission medium (such as twisted pair, coaxial cable, etc.). Of course, this is only an example and does not limit the embodiments of the present disclosure.
[0036] In the embodiments of the present disclosure, the first data can be determined based on the source message for subsequent determination of the preset configuration information. The embodiments of the present disclosure do not limit the specific implementation manner of determining the first data based on the source message. For example, in some embodiments, a predetermined calculation can be performed according to the source message to obtain the required first data; in some other alternative embodiments, the required data can also be directly extracted from the source message and determined to be used as the first data. The direct extraction is relatively convenient to implement. When the direct extraction method is adopted, any appropriate data can be extracted from the source message, which is not specifically limited herein.
[0037] In some alternative embodiments, the first message ID can be extracted from the source message in step S102 and the first message ID can be determined as the first data.
[0038] It should be understood that in the embodiments of the present disclosure, by directly extracting the first message ID from the source message and then using the extracted first message ID as the first data, it is convenient for subsequent steps to determine the preset configuration information based on the first message ID, so as to facilitate the message conversion in the subsequent steps.
[0039] Optionally, a message ID may be included in the source message of some protocol types. The message ID may be a unique identifier of the message, and different messages can be distinguished by the message ID.
[0040] For example, taking the CAN protocol message and the CAN-FD protocol message as an example, they generally include: start of frame, arbitration field, control field, data field, CRC (Cyclic Redundancy Check) field, acknowledgment field, end of frame. The message ID data can be stored in the arbitration field. Usually, in the standard frame format of the CAN protocol / CAN-FD protocol message, the message ID is 11-bit ID data. In addition, in the extended frame format of the CAN protocol / CAN-FD protocol message, the message ID is 29-bit ID data.
[0041] Another example is the LIN protocol message. It generally includes: synchronization interval field, synchronization field, protected ID field, data field, check field. The message ID of the LIN protocol message can be stored in the protected ID field. For example, the first 6 bits of the protected ID field are the Frame ID, which can be used as the above-mentioned message ID in the embodiments of the present disclosure.
[0042] It can be understood that the respective message structures of the CAN protocol message, the CAN-FD protocol message, and the LIN protocol message can be understood with reference to the related art, and will not be elaborated in detail here.
[0043] For example, taking node 3 as the target node, assuming that the source message is sent by the CAN peripheral connected to this node 3, then node 3 can receive the source message (CAN protocol message) through the receiving unit (as an example, it can be understood in combination with Figure 6 or Figure 7 the first receiving unit A1 therein). After that, it can extract the message ID from the source message (such as obtaining the message ID from the arbitration field of the CAN protocol message), that is, the first message ID, and determine it as the first data. Other situations can be inferred by analogy and will not be elaborated here.
[0044] S104: Based on the first data, determine preset configuration information, where the preset configuration information is used for the conversion of the source message to the target message.
[0045] The preset configuration information can be implemented in any form, for example, it can be implemented in the form of text information, structured data, etc. In some optional embodiments, the preset configuration information can be implemented in the form of a configuration table.
[0046] Optionally, the preset configuration information may be a preset configuration table. Figure 4 The schematic diagram of some example preset configuration tables in the embodiments of the present disclosure is shown. Optionally, as Figure 4As shown, the preset configuration table records at least: source message ID, source message ID type, target message ID, target message ID type, and target message protocol type.
[0047] Among them, the target message protocol type is used to indicate the protocol type of the target message. For example, it can be CAN protocol, CAN-FD protocol, LIN protocol.
[0048] In some alternative embodiments, the first data is the first message ID, and step S104 can be implemented in the following manner: determine the first data type of the first message ID; according to the first message ID and the first data type, determine the preset configuration table that records the source message ID as the first message ID and the source message ID type as the first data type.
[0049] The source message ID type / target message ID type recorded in the preset configuration table can be used to confirm the data type of the source message ID / target message ID respectively. Optionally, taking the CAN message, CAN-FD message, and LIN message described above as examples, the data type of the message ID can include: 11-bit ID of CAN, 29-bit ID of CAN, LIN ID. For example, in the preset configuration table, the data types of different message IDs can be recorded as different values. For example, taking the data types of the above 3 message IDs as examples, the 11-bit ID of CAN can be recorded as 0x00, the 29-bit ID of CAN can be recorded as 0x01, and the LIN ID can be recorded as 0x02 (for the convenience of description, this will be used as an example below). Of course, this is only an example and does not limit the embodiments of the present disclosure.
[0050] Optionally, the first data type of the first message ID can be determined when extracting the first message ID from the source message. Optionally, multiple preset configuration tables can be looked up according to the first message ID and the first data type, so as to determine the preset configuration table that records the source message ID as the first message ID and the source message ID type as the first data type.
[0051] For example, as Figure 5 shown, multiple preset configuration tables (preset configuration tables 1 to 4) are shown, and the data recorded in the multiple preset configuration tables can be at least partially different. For example, assuming that the message ID type (first data type) of the source message is the 11-bit ID of CAN (i.e., 0x00), and the first message ID of the source message is 0x00011, then it can be determined by looking up the table Figure 5 in the preset configuration table 1 (that is, the preset configuration table that records the source message ID as the first message ID and the source message ID type as the first data type), and the preset configuration table 1 is used as the preset configuration information for message conversion. Optionally, the embodiments of the present application do not limit the preset configuration table, and the user can customize the preset configuration table.
[0052] It should be understood that through the above optional solutions, the preset configuration table recording the source message ID as the first message ID and the source message ID type as the first data type can be accurately determined as the preset configuration information, so as to facilitate accurately converting the source message according to the preset configuration information in the subsequent steps to obtain the target message, enabling the target node to accurately implement the gateway function.
[0053] In some optional embodiments, when determining the preset configuration table, multiple preset configuration tables to be queried can be parallelly looked up according to the first message ID and the first data type, so as to determine, from the multiple preset configuration tables to be queried, the preset configuration table recording the source message ID as the first message ID and the source message ID type as the first data type.
[0054] For example, as Figure 5 shown, multiple preset configuration tables (preset configuration tables 1 to 4) are shown. Then, assuming that the message ID type (the first data type) of the source message is the 11-bit ID of CAN (i.e., 0x00), and the first message ID of the source message is 0x00011, the preset configuration tables 1 to 4 can be parallelly looked up. For example, the preset configuration tables 1, 2, 3, and 4 can be simultaneously and parallelly queried, and then it can be determined by looking up the table that Figure 5 the preset configuration table 1 in it is used as the preset configuration information for message conversion. Another example is that the preset configuration tables 1 and 2 can be first simultaneously and parallelly queried, and after the query is completed, the preset configuration tables 3 and 4 can be simultaneously and parallelly queried. Thus, after the query is completed, it can be determined that Figure 5 the preset configuration table 1 in it. The determined preset configuration table 1, which also records the source message ID as the first message ID and the source message ID type as the first data type, can be used as the preset configuration information for message conversion.
[0055] It should be understood that by parallelly looking up multiple preset configuration tables to be queried, the table lookup speed and efficiency can be increased, and the preset configuration table recording the source message ID as the first message ID and the source message ID type as the first data type can be quickly and accurately determined as the preset configuration information, so as to facilitate accurately converting the source message according to the preset configuration information in the subsequent steps to obtain the target message, enabling the target node to accurately implement the gateway function.
[0056] Optionally, referring to Figure 6 or Figure 7As shown, the target node may include a look-up table conversion unit, which can implement the process of determining the first data based on the source message and then looking up the table based on the first data, so as to determine the required preset configuration table as the preset configuration information, so as to convert the source message into a target message according to the preset configuration table in the subsequent steps.
[0057] S106: Convert the source message into a target message for the target peripheral in the network according to the preset configuration information.
[0058] After obtaining the preset configuration information (such as the required preset configuration table as described above), the source message can be converted into a target message for the target peripheral in the network according to the preset configuration information, so that the target message can be transmitted to the target peripheral to realize the communication between the peripheral that sends the source message and the target peripheral.
[0059] It should be noted that in the embodiments of the present disclosure, when converting the source message into a target message, the peripheral that sends the source message and the target peripheral may be different or the same. Optionally, when the two are different, an example use of converting the source message into a target message can be used for communication or other control interactions between the peripheral that sends the source message and the target peripheral; optionally, when the two are the same, an example use of converting the source message into a target message can be used for routing test of the message of the peripheral, that is, to test whether a certain target node can normally route the source message. A test method in this scenario can be to receive the source message from a peripheral and then send the converted target message to the peripheral. In addition, in the embodiments of the present disclosure, the protocol types of the source message and the target message do not necessarily have to be different. That is, optionally, according to the preset configuration information (such as the preset configuration table), it can be either converting the source message of the first protocol type into a target message of the first protocol type (that is, the conversion of messages with the same protocol can be realized), or converting the source message of the first protocol type into a target message of a protocol type different from the first protocol type (that is, the conversion of messages with different protocols can be realized). Optionally, when the peripheral that sends the source message and the target peripheral are different, the peripheral that sends the source message and the target peripheral may be connected to the same node or may not be connected to the same node.
[0060] For example, Figure 3AFor the networking structure, for example, assume that node 3 is the target node. If a source message is sent by the CAN peripheral connected to it, then node 3 can convert the source message. As some examples, it can be converted into a target message of the LIN protocol type for the LIN peripheral connected to node 4, into a target message of the CAN protocol type for the CAN peripheral connected to node 2, into a target message of the LIN protocol type for the LIN peripheral connected to node 3, into a target message of the CAN protocol type for the CAN peripheral connected to node 3, and so on. Other cases can be deduced by analogy. The above are only examples and do not limit the embodiments of the present disclosure.
[0061] In some alternative embodiments, for the implementation manner where the preset configuration information in the foregoing is a preset configuration table, step S106 may include: converting the source message of the first protocol type according to the preset configuration table, so as to convert the source message of the first protocol type into a target message of the second protocol type for the target peripheral in the networking, and the message ID in the target message is the target message ID recorded in the preset configuration table, the data type of the message ID in the target message is the target message ID type recorded in the preset configuration table, and the second protocol type is the target message protocol type recorded in the preset configuration table. That is to say, the preset configuration table actually reflects the mapping relationship between the source message ID type, the source message ID and the target message ID type, the target message ID, and the target message protocol type. Through the first data in step S104, the target message ID type, the target message ID, and the target message protocol type corresponding to the first data can be obtained by looking up the table.
[0062] Thus, through the above alternative technical solutions, the source message of the first protocol type can be effectively converted according to the preset configuration table to accurately obtain the target message of the second protocol type, so that the target node can accurately implement the gateway function.
[0063] In the embodiments of the present disclosure, the specific types of the first protocol type and the second protocol type are not specifically limited. Optionally, the second protocol type and the first protocol type may be the same protocol type. For example, when they are the same, the first protocol type and the second protocol type may be any one of the CAN protocol, the CAN-FD protocol, and the LIN protocol.
[0064] For example, as Figure 5As shown, assume that the message ID type (the first data type) of the source message is the 11-bit ID of CAN (i.e., 0x00), and the first message ID of the source message is 0x00011. Taking the determined preset configuration information as preset configuration table 1 as an example, the first protocol type is the CAN protocol. Then, the source message of the CAN protocol can be converted according to preset configuration table 1 into a target message of the second protocol type for the target peripheral in the network. Moreover, the message ID in the target message is the target message ID recorded in preset configuration table 1, i.e., 0x12345; the data type of the message ID in the target message is the target message ID type recorded in preset configuration table 1, i.e., 0x00 (which is also the 11-bit ID of CAN); the second protocol type is the same as the first protocol type and is also the CAN protocol. Of course Figure 5 and the above examples are not intended to impose any limitations on the embodiments of the present disclosure.
[0065] In some alternative embodiments, the second protocol type and the first protocol type are different protocol types. Optionally, when they are different, the first protocol type and the second protocol type can be any two of the CAN protocol, the CAN-FD protocol, and the LIN protocol. It should be understood that in the embodiments of the present disclosure, according to the preset configuration information, the source message can be accurately and effectively converted between different protocols to obtain a target message with a protocol type different from that of the source message, enabling the target node to accurately implement the gateway function.
[0066] For example, as Figure 5 shown, assume that the message ID type (the first data type) of the source message is the 29-bit ID of CAN (i.e., 0x01), and the first message ID of the source message is 0x00002. Taking the determined preset configuration information as preset configuration table 3 as an example, the first protocol type is the CAN protocol. Then, the source message of the CAN protocol can be converted according to preset configuration table 3 into a target message of the second protocol type for the target peripheral in the network. Moreover, the message ID in the target message is the target message ID recorded in preset configuration table 3, i.e., 0x12345; the data type of the message ID in the target message is the target message ID type recorded in preset configuration table 3, i.e., 0x02 (which is also the LIN ID); the second protocol type is different from the first protocol type and is the LIN protocol. Of course Figure 5 and the above examples are not intended to impose any limitations on the embodiments of the present disclosure.
[0067] In some alternative embodiments, the preset configuration table further records at least one of the following: the propagation mode type of the target message, the priority of the target message, and the node number of the node to which the target peripheral is connected.
[0068] Optionally, the propagation mode type of the target message is used to indicate the propagation mode of the target message for external propagation. For example, the propagation mode type may include at least one of unicast, multicast, and broadcast. In an optional example, hexadecimal numbers may be used to represent different propagation mode types. For example, 0x00 is unicast, 0x01 to 0xfe are multicast, and 0xff is broadcast. In the embodiments of the present disclosure, recording the propagation mode type in the preset configuration table can facilitate subsequent transmission of the target message according to the propagation mode type.
[0069] Optionally, the priority of the target message can be used for subsequent scheduling of the transmission of the target message, so as to improve the transmission efficiency and transmission effect. For example, different priorities can be indicated by different values. In one example, assuming that only two priorities, high priority and low priority, are set, the low priority can be 1 and the high priority can be 2, or any other feasible form can also be used to implement. The content of scheduling the target message according to the priority will be described later, and will not be elaborated here.
[0070] Optionally, in the embodiments of the present disclosure, the node number of the node to which the target peripheral is connected is recorded in the preset configuration table (for ease of description, the node to which the target peripheral is connected may also be referred to as the destination node, and the node number of the node to which the target peripheral is connected may also be referred to as the destination node number), so as to facilitate the subsequent accurate transmission of the target message from the target node to the target peripheral.
[0071] For example, in some examples, by comparing the destination node number with the node number of the target node, it can be determined whether the transmission of the target message is clockwise transmission, counterclockwise transmission, or transmission at the current node. This can facilitate the transmission of the target message. For example, taking Figure 3A the ring network shown as an example, if the destination node number is greater than the node number of the target node, the target message can be transmitted clockwise along the network link (for example, it can be understood exemplarily that the destination node number is 5 and the node number of the target node is 3, and node 3 transmits the target message clockwise to node 5); if the destination node number is less than the node number of the target node, the target message can be transmitted counterclockwise along the network link (for example, it can be understood exemplarily that the destination node number is 2 and the node number of the target node is 3, and node 3 transmits the target message counterclockwise to node 2); if the destination node number is the same as the node number of the target node, the destination node is the target node, and the target node can directly transmit the target message to the target peripheral.
[0072] For another example, in some other examples, the shortest distance transmission of the target message can be achieved by comparing the destination node number with the node number of the target node, thereby facilitating further reduction of the transmission delay of the target message. For example, the node distance can be determined based on the target node number and the node number of the target node, and the shortest distance can be selected for message transmission. For example, in some examples, the node numbers of the nodes in a ring network can be numbered in logical increment, so that Figure 3A taking the ring network shown with 7 sub-nodes (i.e., the known maximum number of nodes is 7) as an example, if node 3 (e.g., the target node) transmits the target message to node 5 (the destination node), it can be determined that the transmission distance in the clockwise direction is the shortest, and clockwise transmission can be selected. For another example, if node 3 transmits the target message to node 2 (the destination node), it can be determined that the transmission distance in the counterclockwise direction is the shortest, and counterclockwise transmission can be selected.
[0073] For yet another example, in still some other examples, the shortest distance transmission direction of the target message can be determined by comparing the destination node number with the node number of the target node, and the target message can be dynamically and randomly transmitted according to the load condition in the shortest distance transmission direction. This can improve the load balance of transmitting the target message in the network, and can dynamically change the transmission direction of the message, improving the flexibility of the target message transmission. For example, when the target node has a target message to send, if it is determined that the load in the shortest distance transmission direction is relatively high (e.g., the total amount of cached data of each node in the shortest distance transmission direction exceeds a certain threshold), while the load in the reverse longer distance transmission direction is relatively low (e.g., the total amount of cached data of each node in the longer distance transmission direction does not exceed a certain threshold), then the target message can be dynamically selected to be transmitted in the reverse direction, so as to transmit the target message through the reverse longer distance transmission direction. For example, taking Figure 3A the ring network shown as an example, if the destination node number is 5 and the node number of the target node is 3 for exemplary understanding, it can be determined that the shortest distance transmission direction for node 3 to transmit the target message to node 5 is the clockwise direction. If it is found that the loads of node 4 and node 5 are relatively high, while the loads of node 2, 1, 7, and 6 are relatively low, then node 3 can dynamically select to transmit the target message to node 5 in the counterclockwise direction (i.e., the longer distance transmission direction) through node 2, 1, 7, and 6, instead of continuing to transmit the target message in the clockwise direction (the shortest distance transmission direction).
[0074] In some optional embodiments, step S106 may include: converting the source message into multiple different target messages for different target peripherals in the network according to multiple preset configuration tables.
[0075] Accordingly, in the embodiments of the present disclosure, through the above optional implementation manners, it is possible to support converting the same message into multiple different target messages, so as to be subsequently sent to multiple different target peripherals, enabling the target node to better implement the gateway function.
[0076] For example, a source message can correspond to multiple preset configuration tables, and each preset configuration table is used for converting the source message into different target messages. For example, as Figure 5 shown, assuming that the message ID type (the first data type) of the source message is the 29-bit ID of CAN (i.e., 0x01), and the first message ID of the source message is 0x00002, the determined preset configuration information is preset configuration table 2 and preset configuration table 3 (as Figure 5 dashed-boxed in). If the first protocol type is the CAN protocol, then it can be converted into 2 target messages according to preset configuration table 2 and preset configuration table 3 respectively. Among them, the source message of the CAN protocol can be converted according to preset configuration table 2, and the source message of the CAN protocol is converted into the first target message of the second protocol type for a certain target peripheral in the network. And the message ID in the first target message is the target message ID recorded in preset configuration table 2, that is, 0x12345; the data type of the message ID in this target message is the target message ID type recorded in preset configuration table 2, that is, 0x01 (that is, the 29-bit ID of CAN); the second protocol type is the same as the first protocol type, which is the CAN protocol. In addition, the source message of the CAN protocol can be converted according to preset configuration table 3, and the source message of the CAN protocol is converted into the second target message of the second protocol type for another target peripheral in the network. And the message ID in the second target message is the target message ID recorded in preset configuration table 3, that is, 0x12345; the data type of the message ID in this target message is the target message ID type recorded in preset configuration table 3, that is, 0x02 (that is, LIN ID); the second protocol type is different from the first protocol type, which is the LIN protocol. Of course Figure 5 and the above example is not used as any limitation to the embodiments of the present disclosure.
[0077] Optionally, referring to Figure 6 or Figure 7 shown, the target node may include a look-up table conversion unit, and the look-up table conversion unit can be used to convert the source message into a target message according to the preset configuration table.
[0078] In some alternative embodiments, both the source message and the target message may include a conversion indication field, which is used to indicate whether the message needs to be converted. However, the difference between the two is that the conversion indication field in the source message can be configured to require message conversion or not, while the conversion indication field in all target messages is configured not to require message conversion. The conversion indication field can be implemented in any form. For example, different configurations can be represented by different characters. As an example, if the conversion indication field is configured as 1, it indicates that the message needs to be converted; if the conversion indication field is configured as 0, it indicates that the message does not need to be converted.
[0079] In this way, when any source message is received, the conversion indication field can be identified, and then, based on the indication of the conversion indication field, it can be determined whether to extract the first data and perform message conversion according to the preset configuration information (such as a preset configuration table). For example, when it is recognized that the indication of the conversion indication field in the source message is that message conversion is required, the first data can be determined based on the source message, the preset configuration information (such as a preset configuration table) can be determined based on the first data, and then the source message can be converted into a target message according to the preset configuration information; when it is recognized that the indication of the conversion indication field in the source message is that message conversion is not required, the first data is no longer extracted, and message conversion is no longer performed according to the preset configuration information (such as a preset configuration table), and the source message can be directly sent to the target peripheral device that needs to be sent to. Thus, the requirement of flexible message conversion as needed can be met, enabling the target node to better implement the gateway function.
[0080] In addition, since the target message itself is obtained by converting the source message, and the conversion indication field in all target messages is configured not to require message conversion, repeated conversion of the target message can be avoided, thus avoiding the occurrence of a dead loop situation, enabling the target node to better implement the gateway function.
[0081] S108: Transmit the target message to the target peripheral device.
[0082] In the embodiments of the present disclosure, after the target message is obtained, it can be transmitted to the target peripheral device. In some embodiments, the target message can be transmitted to the target peripheral device connected to the target node. In other embodiments, the target message can be transmitted to the node (i.e., the destination node) connected to the target peripheral device, so as to transmit the target message to the target peripheral device through the node connected to the target peripheral device.
[0083] Optionally, the target node may include a sending unit, and the target message can be transmitted to the target peripheral device through the sending unit.
[0084] Optionally, the target node may include multiple sending units. Some sending units may be respectively used to send target messages for the target peripherals connected to the target node, and some other sending units may transmit the target messages through the physical transmission medium between the nodes to the nodes connected to the target peripherals, and then the nodes connected to the target peripherals transmit the target messages to the target peripherals. For example, referring to Figure 6 or Figure 7 In the example shown, the target node may include three sending units, namely the first sending unit D1, the second sending unit D2, and the third sending unit D3. The first sending unit D1 may send a target message of the CAN protocol / CAN-FD protocol to the CAN / CAN-FD bus connected to the target node, the second sending unit D2 may send a target message of the LIN protocol to the LIN bus connected to the target node, and the third sending unit D3 may send the target message through the physical transmission medium (such as twisted pair, etc.) between the nodes. Of course, this is only an example and does not limit the embodiments of the present disclosure. It should be understood that in some embodiments, nodes may be connected only through the physical transmission medium (such as twisted pair, coaxial cable, etc.). If the target message involves transmission between different nodes, the third sending unit D3 is required.
[0085] Based on this, in the message transmission scheme in steps S102 - S108 in the embodiments of the present disclosure, on the one hand, it can receive the source message, determine the first data based on the source message, then determine the preset configuration information for converting the source message into the target message based on the first data, and then convert the source message into the target message for the target peripherals in the network according to the determined preset configuration information, and then transmit the target message to the target peripherals. Therefore, the target node among the multiple nodes connected to form the network can directly be used as a gateway to implement the gateway function, effectively realizing message conversion and message transmission, and there is no need to deploy a dedicated gateway device additionally in the network, which is beneficial to reducing the network cost; on the other hand, since the target node in the message transmission scheme in this solution is not limited to a specific node in the network, it can be served by any node among the multiple nodes connected to form the network. This enables the source message to be sent to the target node nearby for message conversion after a source message is generated by a certain peripheral. Thus, the message conversion can be processed nearby, and then the target node transmits the converted target message to the corresponding target peripheral. In this way, the transmission path of the message will not be too long, effectively reducing the message transmission delay, and also avoiding excessive processing pressure when the target node implements the gateway function, reducing the processing overhead. In addition, since the gateway processing can be implemented at the target node, the demand for additional processing units (such as MCUs, etc.) can be reduced, thereby saving the cost of additional processing units.
[0086] In addition, since it can reduce the processing pressure of the target node to a certain extent, the processing performance requirements for the target node are not too high, which is beneficial to controlling the cost of the target node.
[0087] In some alternative embodiments, in the embodiments of the present disclosure, the target node can perform hardware processing of the gateway on the message, thereby reducing the need for an additional processing unit (such as an MCU, etc.) to perform gateway processing on the message, reducing the processing burden of the additional processing unit, and also reducing the demand for the additional processing unit. Ultimately, the cost of the additional processing unit can be saved.
[0088] In some alternative embodiments, in step S108, the target message can be transmitted to the target peripheral based on the physical layer.
[0089] For example, if the target peripheral is the peripheral connected to the target node, optionally, the target message can be transmitted to the target peripheral connected to the target node based on the physical layer.
[0090] For another example, if the target peripheral is not the peripheral connected to the target node, optionally, the target message can be transmitted to the node connected to the target peripheral based on the physical layer, so that the target message can be transmitted to the target peripheral through the node connected to the target peripheral.
[0091] It should be understood that in the embodiments of the present disclosure, when transmitting the target message to the target peripheral, it can be directly transmitted based on the physical layer to achieve faster transmission and reduce the software processing time. It is also not necessary to encapsulate through a processor (such as an MCU, etc.) based on a standard protocol, that is, it is not necessary to process based on a high-level protocol above the physical layer, but directly transmit and process based on the physical layer, which can ensure the reliability of message transmission. In addition, when this solution transmits messages based on the physical layer, it also reduces the demand for a processor (such as an MCU, etc.) in the nodes of the network during message transmission. Therefore, the transmission delay of the message is effectively reduced, and the cost can be further reduced by reducing the number of processors (such as an MCU, etc.).
[0092] The physical layer is the bottom layer in network communication. It should be understood that the target message in the embodiments of the present disclosure can be transmitted and processed based on the physical layer, which does not mean that it only performs the functions that the physical layer defined in the standard protocol can execute. For example, in the standard protocol, the function of the physical layer is to convert the frame signal of the upper layer (such as the data link layer) above the physical layer into an electrical signal or an optical signal that can be transmitted on the physical transmission medium, and to convert the electrical signal or optical signal received from the physical transmission medium into a bit stream for the upper layer (such as the data link layer) to process. The transmission and processing of the target message of the present disclosure are implemented based on the physical layer, indicating that the data transmission and processing solution in the embodiments of the present disclosure do not pass through the upper layers (such as the data link layer, network layer, etc.) above the physical layer defined in the standard physical communication, but define a set of private protocols based on the physical layer, so that it can implement data transmission and processing in addition to some functions that the physical layer defined in the standard protocol can execute.
[0093] In some optional cases, the target node may receive multiple source messages within a period of time. Therefore, in the embodiments of the present disclosure, multiple source messages can be scheduled and processed to ensure the orderliness of message processing and conversion.
[0094] In some optional embodiments, step S102 may include: receiving multiple source messages, and sequentially extracting first data from the multiple source messages according to the priorities of the multiple source messages. Optionally, step S104 may include: determining corresponding preset configuration information based on the first data extracted from the multiple source messages, so that the target node can accurately and efficiently implement the gateway function.
[0095] Thus, in the embodiments of the present disclosure, by sequentially extracting first data (such as the first message ID) from the multiple source messages according to the priorities of the multiple source messages, and then determining the corresponding preset configuration information based on the first data extracted from the multiple source messages, the multiple source messages can be effectively scheduled and processed according to the priorities, so as to more orderly convert and process the multiple source messages, improve the orderliness of message and conversion, and enable the target node to better implement the gateway function.
[0096] Optionally, the first data can be sequentially extracted from the multiple source messages in the order of the priorities of the multiple source messages from high to low. In the embodiments of the present disclosure, the importance of the source message with a higher priority is usually greater than that of the source message with a lower priority. Therefore, optionally, the corresponding first data can be first extracted from the source message with a higher priority, and then the corresponding first data can be extracted from the source message with a lower priority. In this way, the source message with a higher priority can be processed and converted first, and the source message with a lower priority can be processed and converted later, so that more important tasks can be responded to and completed more timely.
[0097] In some alternative embodiments, the above step of "receiving multiple source messages and sequentially extracting first data from the multiple source messages according to the priorities of the multiple source messages" may include: receiving multiple source messages through at least one receiving unit, and caching the multiple source messages into multiple first buffer units configured with different priorities according to the priorities of the multiple source messages; sequentially obtaining source messages from the multiple first buffer units according to the priorities of the multiple source messages, and extracting the first data.
[0098] It should be understood that in the embodiments of the present disclosure, through such an alternative manner, multiple source messages can be effectively scheduled and processed according to priorities, so as to more orderly convert and process the multiple source messages, improve the orderliness of the messages and conversions, and enable the target node to better implement the gateway function.
[0099] Figure 6 An alternative functional schematic diagram of the target node in the embodiments of the present disclosure is shown. Figure 7 Another alternative functional schematic diagram of the target node in the embodiments of the present disclosure is shown. As Figure 6 or Figure 7 In the example shown, the target node may include 3 receiving units, which may be the first receiving unit A1, the second receiving unit A2, and the third receiving unit A3 respectively. Among them, the first receiving unit A1 may be used to receive source messages of the CAN / CAN-FD peripherals connected to the target node, the second receiving unit A2 may be used to receive source messages of the LIN peripherals connected to the target node, and the third receiving unit A3 may be used to receive source messages transmitted to the target node by other nodes through a physical transmission medium (such as twisted pair, etc.). The target node may also include multiple first buffer units. Among them, the first receiving unit A1 corresponds to 2 first buffer units (i.e., the first buffer unit B1 and B2), one with high priority and the other with low priority; the second receiving unit A2 corresponds to 2 first buffer units (i.e., the first buffer unit B3 and B4), one with high priority and the other with low priority; the third receiving unit A3 corresponds to 2 first buffer units (i.e., the first buffer unit B3 and B4), one with high priority and the other with low priority. Multiple source messages may be received by at least one of the 3 receiving units.
[0100] For example, in one example, assume that 2 source messages are received by the first receiving unit A1, and the second receiving unit A2 and the third receiving unit A3 do not receive any source messages. If among the 2 source messages received by the first receiving unit A1, one has a high priority and the other has a low priority, then one high-priority source message can be cached in the high-priority first cache unit B1 and one low-priority source message can be cached in the low-priority first cache unit B2 according to the priorities of these 2 source messages. After that, according to the priorities of the 2 source messages, the high-priority source message can be retrieved from the high-priority first cache unit B1 first to extract the first data, and then the low-priority source message can be retrieved from the low-priority first cache unit B2 to extract the first data.
[0101] For another example, in another example, assume that 4 source messages are received by the first receiving unit A1, and the second receiving unit A2 and the third receiving unit A3 do not receive any source messages. If among the 4 source messages received by the first receiving unit A1, 2 have a high priority and the other 2 have a low priority, then 2 high-priority source messages can be cached in the high-priority first cache unit B1 and 2 low-priority source messages can be cached in the low-priority first cache unit B2 according to the priorities of these 4 source messages. After that, according to the priorities of the 4 source messages, the high-priority source messages can be randomly retrieved from the high-priority first cache unit B1 in sequence to extract the first data. After the extraction of the 2 high-priority source messages is completed, the low-priority source messages can be randomly retrieved from the low-priority first cache unit B2 in sequence to extract the first data, so as to complete the extraction of the 2 low-priority source messages.
[0102] For another example, in another example, assume that 2 source messages are received by the first receiving unit A1 (1 with a high priority and the other with a low priority), 2 source messages are received by the second receiving unit A2 (1 with a high priority and the other with a low priority), and 2 source messages are received by the third receiving unit A3 (1 with a high priority and the other with a low priority). Then, the 2 source messages received by the first receiving unit A1 can be respectively stored in its corresponding 2 first buffer units (i.e., the first buffer units B1 and B2, 1 with a high priority and the other with a low priority), the 2 source messages received by the second receiving unit A2 can be respectively stored in its corresponding 2 first buffer units (i.e., the first buffer units B3 and B4, 1 with a high priority and the other with a low priority), and the 2 source messages received by the third receiving unit A3 can be respectively stored in its corresponding 2 first buffer units (i.e., the first buffer units B5 and B6, 1 with a high priority and the other with a low priority). After that, according to the priorities of the 6 source messages, the high-priority source messages can be randomly obtained in sequence from the 3 high-priority first buffer units (the first buffer units B1, B3, and B5) and the first data is extracted. After the extraction of the 3 high-priority source messages is completed, the low-priority source messages can be randomly obtained in sequence from the low-priority first buffer units (the first buffer units B2, B4, and B6) and the first data is extracted, so as to complete the extraction of the 3 low-priority source messages.
[0103] Optionally, the "randomly obtaining" in the above examples can also be performed in the order of reception. The source messages with the same priority can be obtained in the order of reception, and the source message received earlier by the receiving unit can be obtained and the first data can be extracted earlier.
[0104] It should be understood that the remaining cases can be analogized according to the above several examples and will not be elaborated here. In addition, the above several examples are only examples for easy understanding and do not limit the embodiments of the present disclosure.
[0105] In some alternative embodiments, the message transmission method in the embodiments of the present disclosure further includes: in response to the data volume in the target first buffer unit being greater than a preset threshold before any source message is cached in the target first buffer unit of the first buffer unit, transmitting the source message to another node other than the target node through the network, so as to process the source message by the other node.
[0106] Based on this, in the embodiments of the present disclosure, when the data volume in the first buffer unit is greater than the preset threshold, the source message is transmitted to another node other than the target node through the network, so as to process the source message by the other node, reducing the data cache size of the target node for implementing the gateway function, and effectively realizing the gateway load balancing sharing by using other nodes to process the source message, thereby improving the gateway processing ability in the network.
[0107] The preset threshold can be set as needed, and no specific limitation is imposed in the embodiments of the present disclosure. Optionally, the preset threshold can be set as a certain percentage, which can be the percentage of the cached data volume to the total storage volume of the cache unit. As an example, the preset threshold can be set as 80%, 90%, 95%, etc. Alternatively, the preset threshold can also be set as a specific data storage volume.
[0108] For example, Figure 8 shows a schematic diagram of the functional domains divided in the networking in the embodiments of the present disclosure. Refer to Figure 8 as shown, multiple nodes in the networking can be divided into different functional domains, so that multiple nodes in the same functional domain can process similar functions. It should be understood that dividing multiple nodes in the networking into different functional domains enables multiple nodes in the networking to process similar functions, making it more convenient for the networking to implement various functions, which is beneficial to improving the system efficiency of the networking. Since when one or more nodes in one or more functional domains fail among multiple functional domains, it is not easy to affect other functional domains without failures, the system reliability of the networking can be effectively enhanced, and the load balance of multiple nodes in a single functional domain is good, and the functions between multiple functional domains can also be coordinated with each other, thereby effectively improving various processing, transmission, storage and other performances of the networking. In one example, assuming that the networking is used in a vehicle-mounted scenario, different functional domains can be divided according to vehicle-mounted functions, such as including but not limited to a body domain (which can be used for body functions), an infotainment domain (which can be used for vehicle-mounted infotainment functions), an environment domain (which can be used for vehicle-mounted environment perception functions), and so on. For example, taking Figure 8 as an example, node 1 and node 3 are divided into functional domain 1 (which can be understood as the body domain), and node 5 and node 6 are divided into functional domain 2 (which can be understood as the infotainment domain). Taking node 1 and node 3 as an example, assuming that node 1 and node 3 are target nodes and can be used for the gateway function of functional domain 1, when a source message is sent by a CAN peripheral connected to node 3 to node 3 through the CAN bus, if the data volume of the first cache unit corresponding to the cached source message exceeds the preset threshold, the source message will be transmitted to node 1 (for example, node 3 transmits the source message counterclockwise along the networking link through node 2 to node 1) to process the source message through node 1. Other situations can be analogized according to this example and will not be elaborated here. Of course, this example is only for easy understanding and does not limit the embodiments of the present disclosure.
[0109] Optionally, referring to Figure 6 or Figure 7 as shown, the target node can include a data scheduling unit, and the data scheduling unit can be used to implement the priority scheduling of multiple source messages.
[0110] In some alternative embodiments, step S108 may include: sequentially transmitting a plurality of target packets to at least one target peripheral according to the priorities of the plurality of target packets obtained by converting a plurality of source packets.
[0111] Thus, in the embodiments of the present disclosure, by sequentially transmitting a plurality of target packets to the target peripheral according to the priorities of the plurality of target packets, the transmission of the plurality of target packets can be effectively scheduled according to the priorities, so as to more orderly transmit the plurality of target packets, improve the orderliness of packet transmission, and enable the target node to better implement the gateway function.
[0112] Optionally, the node to which the target peripheral is connected is the target node, or the node to which the target peripheral is connected is not the same node as the target node. Thus, it is possible to allow the transmission of target packets to the target peripherals connected to the target node itself, and it is also possible to allow the transmission of target packets to the target peripherals connected to other nodes, so as to meet the requirement of transmitting packets to the target peripherals connected to each node.
[0113] It can be understood that the plurality of target packets may be directed to the same target peripheral or different target peripherals. Therefore, the plurality of target packets can be sequentially transmitted to at least one target peripheral according to the priorities of the plurality of target packets.
[0114] Optionally, the plurality of target packets may be sequentially transmitted to the target peripheral according to the order of the priorities of the plurality of target packets from high to low. In the embodiments of the present disclosure, the importance of the target packet with a higher priority is generally greater than that of the target packet with a lower priority. Therefore, optionally, the target packet with a higher priority may be transmitted first, and the target packet with a lower priority may be transmitted later. In this way, more important tasks can be more timely responded to and completed.
[0115] Optionally, the priority of the target packet may be determined according to the "priority of the target packet" recorded in the corresponding preset configuration table, which can be understood as described in the relevant content above.
[0116] Optionally, the plurality of target packets may be sequentially transmitted to the target peripheral based on the physical layer according to the priorities of the plurality of target packets obtained by converting a plurality of source packets.
[0117] In some alternative embodiments, the plurality of target packets may be cached in a plurality of third cache units configured with different priorities according to the priorities of the plurality of target packets, and then the target packets may be sequentially obtained from the plurality of third cache units and transmitted to the target peripheral according to the priorities of the plurality of target packets.
[0118] It can be understood that through such an optional solution, the transmission of multiple target messages can be effectively scheduled according to priorities, so as to more orderly transmit multiple target messages, improve the orderliness of message transmission, and enable the target node to better implement the gateway function.
[0119] Optionally, the target node may include a sending unit, and at least one sending unit can be used to schedule the transmission of multiple target messages according to priorities.
[0120] Figure 6 FIG. shows an optional functional schematic diagram of the target node in an embodiment of the present disclosure. As Figure 6 shown, the target node may include three sending units, which may be a first sending unit D1, a second sending unit D2, and a third sending unit D3 respectively. Among them, the first sending unit D1 can be used to transmit target messages to the CAN / CAN-FD peripherals connected to the target node, the second sending unit D2 can be used to transmit target messages to the LIN peripherals connected to the target node, and the third sending unit D3 can be used to transmit target messages to other nodes through a physical transmission medium (such as twisted pair, etc.). The target node may also include multiple third buffer units. Among them, the first sending unit D1 corresponds to two third buffer units (i.e., third buffer units E1 and E2), one with high priority and the other with low priority; the second sending unit D2 corresponds to two third buffer units (i.e., third buffer units E3 and E4), one with high priority and the other with low priority; the third sending unit D3 corresponds to two third buffer units (i.e., third buffer units E5 and E6), one with high priority and the other with low priority. At least one of the three sending units can receive multiple target messages.
[0121] For example, in one example, assume that two target messages are obtained by converting two source messages, one of which is a target message with high priority and the other is a target message with low priority. If both of the two target messages are target messages to be sent to the LIN peripherals connected to the target node, then according to the priorities of the two target messages, one high-priority target message can be cached in the high-priority third buffer unit E3 (corresponding to the second sending unit D2), and one low-priority target message can be cached in the low-priority third buffer unit E4 (corresponding to the second sending unit D2). Then, according to the priorities of the two target messages, first, the second sending unit D2 can obtain the high-priority target message from the high-priority third buffer unit E3 and send it to the corresponding target peripheral through the LIN bus connected to the target node, and then the second sending unit D2 can obtain the low-priority target message from the low-priority third buffer unit E4 and send it to the corresponding target peripheral through the LIN bus connected to the target node.
[0122] For another example, in another instance, assume that 4 target messages are obtained by converting 4 source messages, where 2 are target messages with a high priority and the other 2 are target messages with a low priority. If all 4 target messages are to be sent to the LIN peripherals connected to the target node, then according to the priorities of these 4 target messages, 2 high-priority target messages can be cached in the third cache unit E3 with a high priority (corresponding to the second sending unit D2), and 2 low-priority target messages can be cached in the third cache unit E4 with a low priority (corresponding to the second sending unit D2). Subsequently, according to the priorities of the 4 target messages, the second sending unit D2 can first randomly obtain high-priority target messages from the third cache unit E3 with a high priority in sequence and send them to the corresponding target peripherals through the LIN bus connected to the target node. After the 2 high-priority target messages are sent, the second sending unit D2 can then obtain low-priority target messages from the third cache unit E4 with a low priority and send them to the corresponding target peripherals through the LIN bus connected to the target node, so as to complete the sending of the 2 low-priority target messages.
[0123] Optionally, the "randomly obtain" in the above example can also be implemented by obtaining the target messages in the order in which they are converted. Target messages with the same priority can be obtained in the converted order, and the earlier the target message is converted, the earlier it can be obtained and sent to the target peripheral.
[0124] Optionally, for multiple sending units, the process of obtaining target packets from third buffer units with different priorities and sending them to target peripherals can be independent of each other or executed in parallel. For example, in another example, assume that 6 target packets are obtained by converting 6 source packets, where 3 are target packets with high priority and the other 3 are target packets with low priority. The 3 target packets with high priority need to be sent by the first sending unit D1, the second sending unit D2, and the third sending unit D3 respectively, and the other 3 target packets with low priority also need to be sent by the first sending unit D1, the second sending unit D2, and the third sending unit D3 respectively. Then, according to the priorities of these 6 target packets, 1 target packet with high priority to be sent by the first sending unit D1 is cached in the third buffer unit E1 with high priority (corresponding to the first sending unit D1), and 1 target packet with low priority to be sent by the first sending unit is cached in the third buffer unit E2 with low priority (corresponding to the first sending unit D1); 1 target packet with high priority to be sent by the second sending unit D2 is cached in the third buffer unit E3 with high priority (corresponding to the second sending unit D2), and 1 target packet with low priority to be sent by the second sending unit D2 is cached in the third buffer unit E4 with low priority (corresponding to the second sending unit D2); 1 target packet with high priority to be sent by the third sending unit D3 is cached in the third buffer unit E5 with high priority (corresponding to the third sending unit D3), and 1 target packet with low priority to be sent by the third sending unit D3 is cached in the third buffer unit E6 with low priority (corresponding to the third sending unit D3). After that, according to the priorities of the 6 source packets, the first sending unit D1 first obtains the target packet with high priority from the corresponding third buffer unit E1 with high priority and sends it to the target peripheral, and then the first sending unit D1 obtains the target packet with low priority from the corresponding third buffer unit E2 with low priority and sends it to the target peripheral; the second sending unit D2 first obtains the target packet with high priority from the corresponding third buffer unit E3 with high priority and sends it to the target peripheral, and then the second sending unit D2 obtains the target packet with low priority from the corresponding third buffer unit E4 with low priority and sends it to the target peripheral; the third sending unit D3 first obtains the target packet with high priority from the corresponding third buffer unit E5 with high priority and sends it to the target peripheral, and then the third sending unit D3 obtains the target packet with low priority from the corresponding third buffer unit E6 with low priority and sends it to the target peripheral. The process of the first sending unit D1, the second sending unit D2, and the third sending unit D3 obtaining target packets from third buffer units with different priorities and sending them to target peripherals can be independent of each other or executed in parallel.
[0125] It should be understood that the remaining cases can be analogized according to the above examples and will not be elaborated here. In addition, the above examples are only for easy understanding and do not limit the embodiments of the present disclosure.
[0126] In some other alternative embodiments, the message transmission method in the embodiments of the present disclosure further includes: caching a plurality of target messages into a shared cache unit, and caching the address information of the plurality of target messages in the shared cache unit into a plurality of second cache units configured with different priorities according to the priorities of the plurality of target messages. Optionally, when sequentially transmitting a plurality of target messages according to the priorities, the address information of the target messages in the shared cache unit can be sequentially obtained from the plurality of second cache units according to the priorities of the plurality of target messages, and the target messages can be obtained from the shared cache unit according to the address information of the target messages in the shared cache unit, so as to sequentially transmit the plurality of target messages to the target peripherals.
[0127] It should be understood that through such an alternative solution, on the one hand, the transmission of a plurality of target messages can be effectively scheduled according to the priorities, so as to more orderly transmit the plurality of target messages, improve the orderliness of message transmission, and enable the target node to better implement the gateway function; on the other hand, since a shared cache unit is used to cache the plurality of target messages, and only the address information of the target messages in the shared cache unit is stored in the second cache unit, the cache pressure of one or more second cache units can be reduced, and the waste of storage resources can be reduced.
[0128] Optionally, the address information of the target message in the shared cache unit can be embodied in any form, for example, it can adopt RAM (Random Access Memory) address information.
[0129] Optionally, the target node may include a sending unit, and the transmission of a plurality of target messages can be scheduled according to the priorities through at least one sending unit.
[0130] Figure 7 Another alternative functional schematic diagram of the target node in the embodiments of the present disclosure is shown. As Figure 7In the example shown, the target node may include three sending units, namely the first sending unit D1, the second sending unit D2, and the third sending unit D3. Among them, the first sending unit D1 is used to transmit the target message to the CAN / CAN-FD peripheral device connected to the target node, the second sending unit D2 is used to transmit the target message to the LIN peripheral device connected to the target node, and the third sending unit D3 is used to transmit the target message to other nodes through a physical transmission medium (such as twisted pair, etc.). The target node may also include a shared buffer unit and multiple second buffer units. Among them, the first sending unit D1 corresponds to two second buffer units (i.e., the second buffer units C1 and C2), one with high priority and the other with low priority; the second sending unit D2 corresponds to two second buffer units (i.e., the second buffer units C3 and C4), one with high priority and the other with low priority; the third sending unit D3 corresponds to two second buffer units (i.e., the second buffer units C5 and C6), one with high priority and the other with low priority. At least one of the three sending units may receive multiple target messages. The shared buffer unit is used to buffer the target messages, while each of the other second buffer units only buffers the address information of the target messages in the shared buffer unit.
[0131] For example, in one example, assume that 2 target messages are obtained by converting 2 source messages, where 1 is a target message with high priority and the other is a target message with low priority. If both of the 2 target messages are target messages to be sent to the LIN peripheral device connected to the target node, then these 2 target messages can be buffered in the shared buffer unit, and then according to the priorities of these 2 target messages, the address information of the 1 high-priority target message in the shared buffer unit is buffered in the high-priority second buffer unit C3 (corresponding to the second sending unit D2), and the address information of the 1 low-priority target message in the shared buffer unit is buffered in the low-priority second buffer unit C4 (corresponding to the second sending unit D2). After that, according to the priorities of the 2 target messages, first, the second sending unit D2 obtains the address information of the high-priority target message in the shared buffer unit from the high-priority second buffer unit C3, obtains the high-priority target message from the shared buffer unit according to this address information, and sends it to the corresponding target peripheral device through the LIN bus connected to the target node. Then, the second sending unit D2 obtains the address information of the low-priority target message in the shared buffer unit from the low-priority second buffer unit C4, obtains the low-priority target message from the shared buffer unit according to this address information, and sends it to the corresponding target peripheral device through the LIN bus connected to the target node.
[0132] For another example, in another example, assume that 4 target messages are obtained by converting 4 source messages, where 2 are target messages with high priority and the other 2 are target messages with low priority. If all 4 target messages are target messages to be sent to the LIN peripherals connected to the target node, then these 4 target messages can be cached in the shared cache unit. Then, according to the priorities of these 4 target messages, the address information of 2 high-priority target messages in the shared cache unit can be cached in the second cache unit C3 with high priority (corresponding to the second sending unit D2), and the address information of 2 low-priority target messages in the shared cache unit can be cached in the second cache unit C4 with low priority (corresponding to the second sending unit D2). After that, according to the priorities of the 4 target messages, first, the second sending unit D2 randomly obtains the high-priority target messages from the second cache unit C3 with high priority in sequence, and first, the second sending unit D2 randomly obtains the address information of the high-priority target messages in the shared cache unit from the second cache unit C3 with high priority. According to this address information, the high-priority target message is obtained from the shared cache unit C3 and sent to the corresponding target peripheral through the LIN bus connected to the target node. After the 2 high-priority target messages are sent, then the second sending unit D2 randomly obtains the address information of the low-priority target messages in the shared cache unit from the second cache unit C4 with low priority in sequence. According to this address information, the low-priority target message is obtained from the shared cache unit and sent to the corresponding target peripheral through the LIN bus connected to the target node, so as to complete the sending of the 2 low-priority target messages.
[0133] Optionally, the "randomly obtain" in the above example can also be obtained in the order of the converted target messages. The target messages with the same priority can be obtained in the converted order, and the earlier the target message is converted, the earlier it can be obtained and sent to the target peripheral.
[0134] Optionally, for multiple sending units, the process of obtaining the target message from the second buffer units with different priorities and sending it to the target peripheral can be independent of each other or executed in parallel. For example, in another example, assume that 6 target messages are obtained by converting 6 source messages, where 3 are target messages with high priority and the other 3 are target messages with low priority. The 3 target messages with high priority need to be sent by the first sending unit D1, the second sending unit D2, and the third sending unit D3 respectively, and the other 3 target messages with low priority also need to be sent by the first sending unit D1, the second sending unit D2, and the third sending unit D3 respectively. Then, the 6 target messages can be cached in the shared buffer unit. Then, according to the priorities of the 6 target messages, the address information of the 1 target message with high priority to be sent by the first sending unit D1 in the shared buffer unit can be cached in the second buffer unit C1 with high priority (corresponding to the first sending unit D1); the address information of the 1 target message with low priority to be sent by the first sending unit D1 in the shared buffer unit can be cached in the second buffer unit C2 with low priority (corresponding to the first sending unit D1); the address information of the 1 target message with high priority to be sent by the second sending unit D2 in the shared buffer unit can be cached in the second buffer unit C3 with high priority (corresponding to the second sending unit D2); the address information of the 1 target message with low priority to be sent by the second sending unit D2 in the shared buffer unit can be cached in the second buffer unit C4 with low priority (corresponding to the second sending unit D2); the address information of the 1 target message with high priority to be sent by the third sending unit D3 in the shared buffer unit can be cached in the second buffer unit C5 with high priority (corresponding to the third sending unit D3); the address information of the 1 target message with low priority to be sent by the third sending unit D3 in the shared buffer unit can be cached in the second buffer unit C6 with low priority (corresponding to the third sending unit D3).After that, according to the priorities of the 6 source messages, the first sending unit D1 first obtains the address information of the high-priority target message in the shared buffer unit from the corresponding high-priority second buffer unit C1, and obtains the high-priority target message from the shared buffer unit according to this address information and sends it to the target peripheral. Then, the first sending unit D1 obtains the address information of the low-priority target message in the shared buffer unit from the corresponding low-priority second buffer unit C2, and obtains the low-priority target message from the shared buffer unit according to this address information and sends it to the target peripheral. The second sending unit D2 first obtains the address information of the high-priority target message in the shared buffer unit from the corresponding high-priority second buffer unit C3, and obtains the high-priority target message from the shared buffer unit according to this address information and sends it to the target peripheral. Then, the second sending unit D2 obtains the address information of the low-priority target message in the shared buffer unit from the corresponding low-priority second buffer unit C4, and obtains the low-priority target message from the shared buffer unit according to this address information and sends it to the target peripheral. The third sending unit D3 first obtains the address information of the high-priority target message in the shared buffer unit from the corresponding high-priority second buffer unit C5, and obtains the high-priority target message from the shared buffer unit according to this address information and sends it to the target peripheral. Then, the third sending unit D3 first obtains the address information of the low-priority target message in the shared buffer unit from the corresponding low-priority second buffer unit C6, and obtains the low-priority target message from the shared buffer unit according to this address information and sends it to the target peripheral. In the process that the first sending unit D1, the second sending unit D2, and the third sending unit D3 obtain the address information of the target message in the shared buffer unit from the second buffer units with different priorities, and obtain the target message according to the address information and send it to the target peripheral, they can be independent of each other or executed in parallel.
[0135] It should be understood that the remaining cases can be analogized according to the above examples and will not be elaborated here. In addition, the above examples are only examples for easy understanding and do not limit the embodiments of the present disclosure.
[0136] The following briefly describes here Figure 6 some problems existing in the shown solution to further highlight Figure 7 the beneficial effects of the shown solution:
[0137] For example Figure 6In the shown solution, assuming that all of its multiple target messages are high-priority target messages to be sent by the first sending unit D1, then all the multiple target messages need to be cached in the third cache unit C2 with a lower priority corresponding to the first sending unit D1, resulting in a relatively large cache pressure on a single third cache unit C2, while the other 5 third cache units are in an idle state, which also causes a certain degree of waste of the storage resources of the other third cache units.
[0138] However Figure 7 In the solution of [reference], due to the existence of a shared cache unit, multiple target messages can share the storage space of this cache unit, so that there is basically no waste of storage resources in the shared cache unit. In addition, each second cache unit can only store the address information of the target message in the shared cache unit. Since the address information is much smaller than the data volume of the target message, on the one hand, the cache pressure of the second cache unit for caching the address information of multiple target messages can be reduced, and on the other hand, the total storage capacity of the second cache unit can be appropriately designed to be smaller, thus avoiding the waste of storage resources of other unused second storage units in some cases.
[0139] It can be understood that the above description of the message transmission method in the embodiments of the present disclosure is only some optional embodiments in the embodiments of the present disclosure, and does not impose any limitation on the embodiments of the present disclosure.
[0140] According to a second aspect of the embodiments of the present disclosure, a chip is provided, including: a processor and a memory, which communicate with each other; the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the operations corresponding to the method described in any one of the first aspect.
[0141] Figure 9 FIG. [figure number] is a schematic block diagram of a chip provided by the embodiments of the present disclosure. The specific embodiments of the present disclosure do not limit the specific implementation of the chip. As Figure 9 shown, the chip 1000 may include: a processor 1002 and a memory 1006. Among them:
[0142] The processor 1002 communicates with the memory 1006.
[0143] The processor 1002 is used to execute the program 1010, and specifically can execute the relevant steps in any of the foregoing message transmission method embodiments.
[0144] Specifically, the program 1010 may include program code, and the program code includes computer operation instructions.
[0145] The processor 1002 may be a CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present disclosure. One or more processors included in the intelligent device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.
[0146] RISC-V is an open-source instruction set architecture based on the principle of reduced instruction set (RISC). It can be applied to various aspects such as single-chip microcontrollers and FPGA chips, and can be specifically applied in the fields of Internet of Things security, industrial control, mobile phones, personal computers, etc. Moreover, due to the consideration of the reality of small size, fast speed, and low power consumption in its design, it is particularly suitable for modern computing devices such as warehouse-scale cloud computers, high-end mobile phones, and tiny embedded systems. With the rise of artificial intelligence Internet of Things (AIoT), the RISC-V instruction set architecture has received more and more attention and support, and is expected to become the next-generation CPU architecture widely used.
[0147] The computer operation instructions in the embodiments of the present disclosure may be computer operation instructions based on the RISC-V instruction set architecture. Correspondingly, the processor 1002 may be designed based on the RISC-V instruction set. Specifically, the chip provided in the embodiments of the present disclosure may be a chip designed with the RISC-V instruction set. The chip can execute executable code based on the configured instructions, thereby implementing the message transmission method in the above embodiments.
[0148] The memory 1006 is used to store the program 1010. The memory 1006 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
[0149] The program 1010 may specifically be used to cause the processor 1002 to execute the message transmission method in any of the foregoing embodiments.
[0150] For the specific implementation of each step in the program 1010, reference may be made to the corresponding steps and units in any of the foregoing message transmission methods and message transmission system 100 embodiments, which will not be elaborated here. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described devices and modules can refer to the corresponding process descriptions in the foregoing method embodiments, which will not be repeated here.
[0151] According to the third aspect in the embodiments of the present disclosure, the embodiments of the present disclosure further provide a network, including: a plurality of connected nodes, at least one of the plurality of nodes being a target node, and the target node including the chip 1000 as described in the second aspect.
[0152] In the embodiments of the present disclosure, the structure form of the network is not limited, as long as it can meet the requirements. For example, it can be Figure 3A the form of a ring network in Figure 3B or it can also be the form of a daisy chain network in
[0153] According to the fourth aspect in the embodiments of the present disclosure, the embodiments of the present disclosure further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the message transmission method as described in any one of the foregoing items.
[0154] For example, the computer storage medium includes but is not limited to: Compact Disc Read-Only Memory (CD-ROM), Random Access Memory (RAM), floppy disk, hard disk, magneto-optical disk, etc.
[0155] According to the fifth aspect in the embodiments of the present disclosure, the embodiments of the present disclosure further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the message transmission method as described in any one of the foregoing items.
[0156] The embodiments of the chip 1000, network, computer storage medium, and computer program product in the embodiments of the present disclosure have been described in detail in the foregoing embodiments of the message transmission method. Therefore, the relevant content and beneficial effects thereof can be understood with reference to the above embodiments, and will not be elaborated herein.
[0157] In addition, it should be noted that the information related to users (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to sample data for training the model, data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present disclosure are all information and data authorized by the users or fully authorized by all parties. And the collection, use, and processing of the relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0158] It should be noted that according to the needs of implementation, each component / step described in the embodiments of the present disclosure can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present disclosure. It should be understood that the various technical features in the technical solutions of the embodiments of the present disclosure can be combined or split in any suitable manner.
[0159] The methods according to the embodiments of the present disclosure described above can be implemented in hardware, firmware, or be implemented as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or be implemented as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium and to be downloaded through a network and stored in a local recording medium, so that the methods described herein can be stored in such software processes on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an Application Specific Integrated Circuit (ASIC) or a Field Programmable Gate Array (FPGA)). It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component (such as a Random Access Memory (RAM), a Read-Only Memory (ROM), a flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the methods described herein are implemented. In addition, when a general-purpose computer accesses the code for implementing the methods shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the methods shown herein.
[0160] Those of ordinary skill in the art can realize that the units and method steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for a specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present disclosure.
[0161] The above embodiments are only used to illustrate the embodiments of the present disclosure, rather than to limit the embodiments of the present disclosure. Those of ordinary skill in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present disclosure. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present disclosure. The patent protection scope of the embodiments of the present disclosure shall be defined by the claims.
[0162] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". It should be noted that the concepts such as "first", "second", etc. mentioned in the embodiments of the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "multiple" mentioned in the embodiments of the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present disclosure, and not to limit them; although the embodiments of the present disclosure have been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A message transmission method, applied to a target node among a plurality of nodes connected into a network, the method comprising: receiving a source message, and determining first data based on the source message; Based on the first data, determine preset configuration information, wherein the preset configuration information is used for converting the source message to the target message; According to the preset configuration information, converting the source message into a target message for a target peripheral device in the network; The target message is transmitted to the target peripheral device.
2. The method according to claim 1, wherein: The determining the first data based on the source message includes: extracting a first message ID from the source message, and determining the first message ID as the first data; The preset configuration information is a preset configuration table, wherein the preset configuration table records at least: a source message ID, a source message ID type, a target message ID, a target message ID type, and a target message protocol type.
3. The method according to claim 2, wherein: The determining the preset configuration information based on the first data includes: Determine a first data type of the first message ID; According to the first message ID and the first data type, a preset configuration table is determined that records that the source message ID is the first message ID and the source message ID type is the first data type.
4. The method according to claim 3, wherein: The converting the source message into a target message for a target peripheral device in the network according to the preset configuration information includes: According to the preset configuration table, the source message of the first protocol type is converted to convert the source message of the first protocol type into a target message of the second protocol type for the target peripheral in the networking, and the message ID in the target message is the target message ID recorded in the preset configuration table, the data type of the message ID in the target message is the target message ID type recorded in the preset configuration table, and the second protocol type is the target message protocol type recorded in the preset configuration table.
5. The method according to claim 4, wherein: The second protocol type and the first protocol type are different protocol types.
6. The method according to claim 3, wherein: The determining, according to the first message ID and the first data type, a preset configuration table recording that the source message ID is the first message ID and the source message ID type is the first data type, includes: According to the first message ID and the first data type, multiple preset configuration tables to be queried are looked up in parallel to determine, from the multiple preset configuration tables to be queried, a preset configuration table that records that the source message ID is the first message ID and the source message ID type is the first data type.
7. The method according to claim 2, wherein: The preset configuration table also records at least one of the propagation mode type of the target message, the priority of the target message, and the node number of the node to which the target peripheral device is connected.
8. The method according to claim 2, wherein: The converting the source message into a target message for a target peripheral device in the network according to the preset configuration information includes: According to a plurality of preset configuration tables, the source message is converted into a plurality of different target messages for different target peripherals in the network.
9. The method according to any one of claims 1 to 8, wherein: The receiving of the source message and determining the first data based on the source message includes: receiving a plurality of source messages and extracting the first data from the plurality of source messages in sequence according to the priorities of the plurality of source messages; The determining of preset configuration information based on the first data includes: determining corresponding preset configuration information respectively based on the first data extracted from a plurality of source messages.
10. The method according to claim 9, wherein: The receiving of multiple source messages and extracting the first data from the multiple source messages in sequence according to the priorities of the multiple source messages includes: Receiving a plurality of source messages through at least one receiving unit, and caching the plurality of source messages into a plurality of first cache units configured with different priorities according to the priorities of the plurality of source messages; According to the priorities of the multiple source messages, the source messages are sequentially acquired from the multiple first cache units, and the first data is extracted.
11. The method according to claim 10, wherein: The method further comprises: In response to the fact that the amount of data in a target first cache unit is greater than a preset threshold before any source message is cached in a target first cache unit among multiple first cache units, the source message is transmitted through the networking to another node other than the target node so that the source message is processed by the other node.
12. The method according to claim 9, wherein: The transmitting the target message to the target peripheral device includes: According to the priorities of the multiple target messages obtained by converting the multiple source messages, the multiple target messages are transmitted to at least one target peripheral device in sequence, and the node connected to the target peripheral device is the target node, or the node connected to the target peripheral device is not the same node as the target node.
13. The method according to claim 12, wherein: The method further includes: caching the multiple target messages in a shared cache unit, and caching address information of the multiple target messages in the shared cache unit in multiple second cache units configured with different priorities according to the priorities of the multiple target messages; The transmitting the plurality of target messages to the target peripheral device in sequence according to the priorities of the plurality of target messages converted from the plurality of source messages comprises: According to the priorities of the multiple target messages, address information of the target messages in the shared cache unit is obtained from the multiple second cache units in sequence, and based on the address information of the target message in the shared cache unit, the target message is obtained from the shared cache unit to transmit the multiple target messages to the target peripheral device in sequence.
14. The method according to any one of claims 1 to 8, wherein: The transmitting the target message to the target peripheral device includes: The target message is transmitted to the target peripheral device based on the physical layer.
15. The method according to any one of claims 1 to 8, wherein: The source message and the target message are at least one of a CAN protocol message, a CAN-FD protocol message, and a LIN protocol message.
16. The method according to any one of claims 1 to 8, wherein: The target node is connected to multiple buses of different protocols and a physical transmission medium supporting physical layer transmission, receives source messages transmitted via the bus or the physical transmission medium, and transmits target messages to the outside of the target node via the bus or the physical transmission medium.
17. A chip, comprising: A processor and a memory, the processor and the memory communicating with each other; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1 to 16.
18. A network comprising: A plurality of nodes are connected, at least one of the plurality of nodes is a target node, and the target node comprises the chip as claimed in claim 17.
19. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 16.
20. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 16.
Citation Information
Cited By
Intelligent communication system, communication method and device based on dynamic priority, and vehicle
CN120567761A