CN117640533A - Data transmitting method, data receiving method, data transmitting device, data receiving device, electronic equipment and readable storage medium - Google Patents

Data transmitting method, data receiving method, data transmitting device, data receiving device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN117640533A
CN117640533A CN202311710784.2A CN202311710784A CN117640533A CN 117640533 A CN117640533 A CN 117640533A CN 202311710784 A CN202311710784 A CN 202311710784A CN 117640533 A CN117640533 A CN 117640533A
Authority
CN
China
Prior art keywords
node
message
data
transmission
sending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311710784.2A
Other languages
Chinese (zh)
Inventor
刘绪洪
王怀宽
刘月美
韩怡
王鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weichai Power Co Ltd
Original Assignee
Weichai Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Weichai Power Co Ltd filed Critical Weichai Power Co Ltd
Priority to CN202311710784.2A priority Critical patent/CN117640533A/en
Publication of CN117640533A publication Critical patent/CN117640533A/en
Pending legal-status Critical Current

Links

Abstract

The invention relates to a data transmitting and receiving method, a device, an electronic device and a readable storage medium, which CAN judge the current value of an error counter of a node when the node identifier of a received message is the same as the node identifier in the message transmitted by the node in a CAN network, so that two new node identifiers are obtained by splitting according to the node identifier of the current transmitted message of the node based on a preset generation rule before the bus of the node is closed, each new node identifier is further formed into a new transmitted message, other nodes in the CAN network CAN combine each component part of the transmitted content according to characteristic information after receiving the two new messages, and a complete transmitted message is obtained, thereby avoiding the occurrence of the function deficiency condition in the CAN network due to the bus closing of the node when the node identifier of the current received message and the node identifier of the transmitted message conflict.

Description

Data transmitting method, data receiving method, data transmitting device, data receiving device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of communications networks, and in particular, to a data sending method, a data receiving method, a data sending device, a data receiving device, an electronic device, and a readable storage medium.
Background
CAN (Controller Area Network), i.e. controller area network, is widely used in industrial automation, ships, medical equipment, industrial equipment, etc. due to its high performance and high reliability, especially in the automotive industry. Various ECUs (electronic control units) on the vehicle CAN be used as nodes in the CAN network to communicate with other nodes to form an automobile electronic control network.
However, in the actual use process, when the node identifier in the node receiving message and the node ID (node identifier) in the sending message in the CAN network are the same but the data fields are different, the data field filling error of the node will be caused, so that a large number of error frames are generated to cause the bus closing of the CAN node to be unusable, and the user experience is very affected.
Disclosure of Invention
The invention provides a data sending and receiving method, a data sending and receiving device, electronic equipment and a readable storage medium, which can avoid the problem of bus closing caused by the fact that the node identification for receiving a message is the same as the node identification for sending the message.
In order to achieve the above purpose, the present invention provides the following technical solutions:
according to the data transmission method provided by the embodiment of the invention, the data transmission method is applied to a target node of a CAN (controller area network), wherein the target node is any node in the CAN, and the method comprises the following steps:
judging whether the current receiving node identifier on the same channel of the target node is the same as the transmitting node identifier of the target node, wherein the current node identifier is the node identifier in the message currently received on the same channel of the target node, and the transmitting node identifier is the node identifier of the message currently transmitted by the target node;
if yes, determining whether the current value of the error counter of the target node is in a preset value range, wherein the maximum value in the preset value range is not greater than a target closing value, and the target closing value is an error counting threshold for triggering the bus closing of the target node;
if yes, processing the node identification of the current sending message based on a preset generation rule to obtain two new node identifications;
combining one new node identifier of the two new node identifiers with the characteristic information of the transmission content of the current transmission message to obtain a first transmission message;
combining the other new node identifier of the two new node identifiers with each component part obtained by splitting the transmission content respectively to obtain at least one second transmission message;
and respectively transmitting the first transmission message and the second transmission message.
Further, the processing the node identifier of the current sending message based on the preset generation rule to obtain two new node identifiers includes:
and respectively replacing the parameter group part in the node identifier of the current transmission message with two groups of new parameters to obtain the two new node identifiers, wherein each group of new parameters has characteristic parameters different from the other group of parameters.
Further, the step of combining the new node identifier of the two new node identifiers with the characteristic information of the transmission content of the current transmission message to obtain a first transmission message includes:
and combining the new node identifier with a control word, a data length value, the number of data packets, part of parameters in the first new parameters and a parameter group number in sequence to obtain the first transmission message, wherein the control word occupies one byte, the data length value occupies two bytes, the number of the data packets occupies one byte, part of parameters in the first new parameters occupy one byte, and the parameter group number occupies three bytes.
Further, the combining the other new node identifier of the two new node identifiers with each component part after splitting the transmission content to obtain at least one second transmission message includes:
and combining the other new node identifier with the data packet number and the data packet content of each component part respectively to correspondingly obtain a second transmission message of each component part, wherein the data packet number of each component part occupies one byte, and the data packet content of each component part occupies seven bytes.
Further, the difference between the maximum value in the preset numerical range and the target closing value is not smaller than the maximum change value accumulated by the error counter of the target node each time.
According to the invention, the data receiving method is applied to the nodes except the target node in the CAN network, and comprises the following steps:
receiving a first sending message and a second sending message;
respectively identifying the received first sending message and the received second sending message based on a preset analysis rule, and identifying the first sending message and the second sending message;
splitting the identified first sending message and the second sending message respectively to obtain characteristic information of the sending content and the components;
and combining the components based on the characteristic information of the transmission content to obtain the transmission content.
According to an embodiment of the present invention, a data transmitting device is applied to a target node of a CAN network, where the target node is any node in the CAN network, and the data transmitting device includes:
the first judging module is used for judging whether the current receiving node identifier on the same channel of the target node is the same as the transmitting node identifier of the target node, wherein the current node identifier is the node identifier in the message currently received on the same channel of the target node, and the transmitting node identifier is the node identifier of the message currently transmitted by the target node;
the second judging module is used for determining whether the current value of the error counter of the target node is in a preset value range or not if yes, wherein the maximum value in the preset value range is not greater than a target closing value, and the target closing value is an error counting threshold value for triggering the bus closing of the target node;
the identifier generating module is used for processing the node identifiers of the current sending message based on a preset generating rule to obtain two new node identifiers;
the first combination module is used for combining one new node identifier of the two new node identifiers with the characteristic information of the transmission content of the current transmission message to obtain a first transmission message;
the second combination module is used for respectively combining the other new node identifier of the two new node identifiers with each component part obtained by splitting the transmission content to obtain at least one second transmission message; and
and the sending module is used for respectively sending the first sending message and the second sending message.
According to an embodiment of the present invention, a data receiving device is applied to a node except for the target node in the CAN network, and includes:
the receiving module is used for receiving the first sending message and the second sending message;
the identification recognition module is used for recognizing the received first transmission message and the received second transmission message based on a preset analysis rule respectively, and recognizing the first transmission message and the second transmission message;
the data splitting module is used for splitting the identified first sending message and the second sending message respectively to obtain the characteristic information of the sending content and the components; and
and the data combination module is used for combining the components based on the characteristic information of the transmission content to obtain the transmission content.
According to an embodiment of the present invention, there is provided an electronic device including: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement the respective steps of the data transmission method or the data reception method as described above.
A readable storage medium according to an embodiment of the present invention is provided, on which a computer program is stored, which, when being executed by a processor, implements the respective steps of the data transmission method or the data reception method as described above.
According to the technical scheme, the data sending and receiving method disclosed by the invention CAN judge the current value of the error counter of the node when the node identification of the received message and the node identification of the message sent by the node are identical in the same communication channel, namely, the repetition exists, so that the node identification of the current message sent by the node is split to obtain two new node identifications based on a preset generation rule before the bus of the node is closed, meanwhile, the content of the current message sent by the node is split, each new node identification is further formed into a new message sent by the node, other nodes in the CAN network CAN obtain corresponding characteristic information and each component part according to the new node identifications obtained by analysis after receiving the two new messages, and then the component parts of the sent content are combined according to the characteristic information to obtain a complete message sent, thereby avoiding the situation that the bus of the node is closed due to the existence of conflict between the node identifications of the current message and the node identifications of the message, and the function loss condition in the CAN network is caused, and the user experience is not influenced.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a data transmission method according to an embodiment of the present invention;
FIG. 2 is a diagram of a message structure before processing according to an embodiment of the present invention;
FIG. 3 is a diagram of a message structure after processing according to an embodiment of the present invention;
FIG. 4 is a diagram of another message structure after processing according to an embodiment of the present invention;
fig. 5 is an application flowchart of a data transmission method according to an embodiment of the present invention;
fig. 6 is a flowchart of a data receiving method according to an embodiment of the present invention;
fig. 7 is a block diagram of a data transmission device according to an embodiment of the present invention;
fig. 8 is a block diagram of a data receiving apparatus according to an embodiment of the present invention;
fig. 9 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
According to the arbitrated line and principle of the CAN bus, the implicit level is always masked by the dominant level when the two transceivers together announce different level signals. The controller of the node in the CAN network monitors whether the bus condition is common with the level transmitted by the controller when the controller transmits the message, if the controller does not generate the node identification, namely the CAN ID section, the controller generates an arbitration, and if the controller generates the node identification, the CAN ID section, the controller generates the CAN ID section, the controller triggers corresponding error. Thus, the error counter of the node is caused to accumulate correspondingly, and when the accumulated total number exceeds the set value for causing the bus to be closed, the node is caused to be closed, so that the node cannot be used.
In view of the above technical problems, referring to fig. 1, an embodiment of the present invention provides a data transmission method, which may be applied to a target node of a CAN network, where the target node may be any node in the CAN network, and the data transmission method may include the following steps:
101. judging whether the current receiving node identification on the same channel of the target node is the same as the transmitting node identification of the target node, wherein the current node identification is the node identification in the message currently received on the same channel of the target node, and the transmitting node identification is the node identification of the message currently transmitted by the target node.
Specifically, when the target node normally operates in the CAN network, the data segment of the CAN ID (node identifier) is separated from the received message by analyzing the received message, and the data segment is compared with the CAN ID data segment in the message currently sent by the target node, and whether the two data segments are identical or not is judged, so that whether the node identifiers are identical or not is further judged.
102. If so, determining whether the current value of the error counter of the target node is in a preset value range, wherein the maximum value in the preset value range is not greater than a target closing value, and the target closing value is an error counting threshold for triggering the bus closing of the target node.
Specifically, after it is determined that the current receiving node identifier is the same as the transmitting node identifier of the target node, the accumulated value of the current error counter may be obtained from the error counter of the target node, because the accumulation of the error counter of the target node will be caused after the error occurs in which the current receiving node identifier is the same as the transmitting node identifier of the target node. According to the related principle of error detection of the CAN network, when the detected error is either a bit error, a filling error, a form error or a response error, error mark information is sent out in the next bit, and error counting is carried out by using an error counter for defining the type of the fault, wherein each node has two kinds of counting, namely a sending error count and a receiving error count, and when the value of the sending error counter is larger than the corresponding counting value such as 255 which causes the bus to be closed, the node is set into a bus closed state. To prevent the bus of the target node from closing, a reliable and safe range value can be set, and when the accumulated value of the counter is in the range, the subsequent processing steps are triggered. In order to ensure safety, the difference between the maximum value in the preset numerical range and the target closing value is not smaller than the maximum change value accumulated by the error counter of the target node each time. For example, the target shutdown value that causes the target node to shutdown is 255, and the maximum increment value of the error counter caused by the filling error of the data field is 8, then the maximum value in the preset value range may be set to 246, and the minimum value may be set according to the requirement, so as to ensure that the target node is not shutdown after the error occurs.
It will be appreciated that the setting of the preset data range can be performed by those skilled in the art as desired, and is not limited herein.
103. If yes, processing the node identification of the current sending message based on a preset generation rule to obtain two new node identifications.
Specifically, referring to fig. 2, the structure of the current transmission message of the target node is shown and is composed of a CAN ID part and a data part with 8 bytes, wherein 18 in the CAN ID part represents the priority of the target node, the middle part is a hexadecimal value of a parameter set (PGN valid part) such as FEDF, mm is a part of the content of the source address of the target node, and the later data part is filled with specific transmission content. According to the relevant regulations of SAE J1939 protocol in CAN network, the priority part in the node mark of the current sending message and the source address part of the target node are kept unchanged, and the parameter group part in the node mark of the current sending message is replaced by two groups of new parameters respectively to obtain two new node marks, wherein each group of new parameters has characteristic parameters different from the other group.
For example, referring to the two new CAN ID parts shown in fig. 3 and fig. 4, respectively, the two new CAN IDs are obtained, 18 also represents the priority of the destination node, mm is the partial content of the source address of the destination node, FF represents the broadcast to the outside, and xx and yy CAN be used to distinguish two different types of messages respectively.
It will be appreciated that the content of the new CAN ID may be defined and used by those skilled in the art according to the actual operational requirements, without limitation.
104. And combining one new node identifier of the two new node identifiers with the characteristic information of the transmission content of the current transmission message to obtain a first transmission message.
Specifically, the CAN ID shown in fig. 3 may be used to combine with the feature information of the transmission content, including a Control word (Control Byte), a data length value (DLC), the number of packets (Pack Num), a part of parameters (FF) among the first new parameters, and a parameter group number combination (PGN). Wherein the control word occupies one byte, the data length value occupies two bytes, the data packet number occupies one byte, part of the first new parameters occupy one byte, and the parameter group number occupies three bytes.
105. And combining the other new node identifier of the two new node identifiers with each component part after splitting the transmission content respectively to obtain at least one second transmission message.
Specifically, the CAN ID shown in fig. 4 may be used to combine with the split transmission content, where Pack Serial Num is the packet number, and the next seven bytes are the content of the packet number. Because the transmission content may be more than seven bytes, if there are 15 bytes, two second transmission messages are needed, and the CAN ID is still the CAN ID shown in fig. 4, but the data packet number and the corresponding data packet content are changed, and so on, when the transmission content is more, the transmission content CAN be split into a plurality of second transmission messages for transmission, and the combination CAN be performed by identifying the corresponding data packet number.
106. And respectively transmitting the first transmission message and the second transmission message.
And finally, respectively transmitting the first transmission message and the second transmission message, after the corresponding receiving node receives the first transmission message, identifying xx and yy in the first transmission message according to corresponding analysis, and then combining the data packet content in the second transmission message according to the content of corresponding characteristic information to obtain complete transmission content, thereby avoiding the bus closing problem caused by the repetition of the CAN ID of the receiving message and the CAN ID of the transmission message and ensuring user experience.
As a practical application, when the above data processing method is specifically implemented, reference may be made to the flowchart shown in fig. 5, where a corresponding early warning flag (early warning bit) is set on the target node to perform a corresponding split instruction. Specific:
1) First an ECU (electronic control unit in a CAN network) is initialized.
2) And judging whether the ECU is repeated with the CAN ID of the same CAN channel receiving message and the CAN ID of the sending message.
If yes, then:
and judging that the value of the error counter of the CAN controller reaches a threshold value.
If yes, then:
and setting an early warning signal, namely setting 1 by repeated early warning flag between the ECU receiving message CAN ID and the sending message CAN ID.
The ECU processes the duplicate message content and processes the send message ECU duplicate ID (i.e., the target node) as 18xxFFmm (hex) and 18yyFFmm (hex), where hex represents hexadecimal. Wherein, 18xxFFmm (hex) and 18yyFFmm (hex) are CAN IDs of two custom messages. The mm value flexibly identifies the source address of the CAN node from the ECU. The 18xxFFmm (hex) data content is Control Byte1 (1 Byte), data length information DLC (1 Byte), packet number Pack Num (1 Byte), FF and parameter group number PGN (3 bytes), wherein the PGN value flexibly identifies the PGN of the repeated ID of the ECU of the sending message; the 18yyFFmm (hex) data content includes the packet number Pack Serial Num. The data content is derived from the repeated ID content of the ECU sending the message;
the ECU sends the processed message content;
if not, then:
and the ECU receives the message CAN ID and sends the message CAN ID and repeatedly pre-warning flag is set to 0, the pre-warning is released, and the data sending is completed.
The embodiment of the present invention shown in fig. 6 further provides a corresponding data receiving method implemented in a node other than the target node in the CAN network, which may include the steps of:
601. and receiving the first sending message and the second sending message.
602. And respectively identifying the received first sending message and the received second sending message based on a preset analysis rule, and identifying the first sending message and the second sending message.
603. Splitting the identified first sending message and the second sending message respectively to obtain characteristic information and each component of the sending content.
604. And combining the components based on the characteristic information of the transmission content to obtain the transmission content.
Specifically, the data processing procedure is the inverse of the data processing method applied at the target transmitting node in the above embodiment. After receiving the message, the receiving node corresponding to the target node obtains two CAN ID parts through splitting, determines which is the first sending message and which is the second sending message through identifying two marks of xx and yy in the CAN ID parts, and then combines all sending contents in the second sending message based on the characteristic parameter content of the corresponding data segment of the first sending message to obtain complete sending content.
The embodiment of the present invention shown in fig. 7 is also provided with a data sending device, which is applied to a target node of a CAN network, wherein the target node is any node in the CAN network, and the device may include:
a first determining module 701, configured to determine whether a current receiving node identifier on the same channel of the target node is the same as a sending node identifier of the target node, where the current node identifier is a node identifier in a message currently received on the same channel of the target node, and the sending node identifier is a node identifier of a message currently sent by the target node.
A second determining module 702, configured to determine if the current value of the error counter of the target node is within a preset value range, where a maximum value in the preset value range is not greater than a target shutdown value, and the target shutdown value is an error count threshold that triggers a bus shutdown of the target node.
The identifier generating module 703 is configured to, if yes, process the node identifier of the current sending message based on a preset generating rule, so as to obtain two new node identifiers.
A first combining module 704, configured to combine one new node identifier of the two new node identifiers with characteristic information of a transmission content of the current transmission message, to obtain a first transmission message.
And the second combination module 705 is configured to combine the other new node identifier of the two new node identifiers with each component part obtained by splitting the transmission content, so as to obtain at least one second transmission message. And
And a sending module 706, configured to send the first sending message and the second sending message respectively.
Further, the identifier generating module 703 is specifically configured to:
and respectively replacing the parameter group part in the node identifier of the current transmission message with two groups of new parameters to obtain the two new node identifiers, wherein each group of new parameters has characteristic parameters different from the other group of parameters.
Further, the first combining module 704 is specifically configured to:
and combining the new node identifier with a control word, a data length value, the number of data packets, part of parameters in the first new parameters and a parameter group number in sequence to obtain the first transmission message, wherein the control word occupies one byte, the data length value occupies two bytes, the number of the data packets occupies one byte, part of parameters in the first new parameters occupy one byte, and the parameter group number occupies three bytes.
Further, the second combination module 705 is specifically configured to:
and combining the other new node identifier with the data packet number and the data packet content of each component part respectively to correspondingly obtain a second transmission message of each component part, wherein the data packet number of each component part occupies one byte, and the data packet content of each component part occupies seven bytes.
Further, the difference between the maximum value in the preset numerical range and the target closing value in the second judging module 702 is not smaller than the maximum change value accumulated by the error counter of the target node each time.
Referring to fig. 8, an embodiment of the present invention further provides a data receiving apparatus applied to a node other than the target node in the CAN network, where the apparatus may include:
a receiving module 801, configured to receive the first sending message and the second sending message.
The identification identifying module 802 is configured to identify the received first sending message and the received second sending message based on a preset parsing rule, and identify the first sending message and the second sending message.
And a data splitting module 803, configured to split the identified first transmission packet and the identified second transmission packet, so as to obtain feature information of the transmission content and the components. And
And the data combination module 804 is configured to combine the components based on the feature information of the transmission content to obtain the transmission content.
Referring to fig. 9, an embodiment of the present invention further provides an electronic device, which may be an electronic processing unit in a CAN network, and may include: a memory 901 and a processor 902.
A memory 901 for storing a program.
A processor 902 for executing the program to implement the respective steps of the data transmission method or the data reception method described in the above embodiment.
Embodiments of the present invention also provide a readable storage medium having stored thereon a computer program for use by a corresponding electronic control unit, which computer program, when executed by a processor, implements the steps of the data transmission method or the data reception method as described in the above embodiments.
For the foregoing method embodiments, for simplicity of explanation, the methodologies are shown as a series of acts, but one of ordinary skill in the art will appreciate that the present invention is not limited by the order of acts, as some steps may, in accordance with the present invention, occur in other orders or concurrently. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other. For the apparatus class embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference is made to the description of the method embodiments for relevant points.
The steps in the method of each embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs, and the technical features described in each embodiment can be replaced or combined.
The modules and the submodules in the device and the terminal of the embodiments of the invention can be combined, divided and deleted according to actual needs.
In the embodiments provided in the present invention, it should be understood that the disclosed terminal, apparatus and method may be implemented in other manners. For example, the above-described terminal embodiments are merely illustrative, and for example, the division of modules or sub-modules is merely a logical function division, and there may be other manners of division in actual implementation, for example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
The modules or sub-modules illustrated as separate components may or may not be physically separate, and components that are modules or sub-modules may or may not be physical modules or sub-modules, i.e., may be located in one place, or may be distributed over multiple network modules or sub-modules. Some or all of the modules or sub-modules may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional module or sub-module in the embodiments of the present invention may be integrated in one processing module, or each module or sub-module may exist alone physically, or two or more modules or sub-modules may be integrated in one module. The integrated modules or sub-modules may be implemented in hardware or in software functional modules or sub-modules.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software unit executed by a processor, or in a combination of the two. The software elements may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. The data transmission method is applied to a target node of a CAN network, wherein the target node is any node in the CAN network, and is characterized by comprising the following steps:
judging whether the current receiving node identifier on the same channel of the target node is the same as the transmitting node identifier of the target node, wherein the current node identifier is the node identifier in the message currently received on the same channel of the target node, and the transmitting node identifier is the node identifier of the message currently transmitted by the target node;
if yes, determining whether the current value of the error counter of the target node is in a preset value range, wherein the maximum value in the preset value range is not greater than a target closing value, and the target closing value is an error counting threshold for triggering the bus closing of the target node;
if yes, processing the node identification of the current sending message based on a preset generation rule to obtain two new node identifications;
combining one new node identifier of the two new node identifiers with the characteristic information of the transmission content of the current transmission message to obtain a first transmission message;
combining the other new node identifier of the two new node identifiers with each component part obtained by splitting the transmission content respectively to obtain at least one second transmission message;
and respectively transmitting the first transmission message and the second transmission message.
2. The method for sending data according to claim 1, wherein the processing the node identifier of the current sending message based on the preset generation rule to obtain two new node identifiers includes:
and respectively replacing the parameter group part in the node identifier of the current transmission message with two groups of new parameters to obtain the two new node identifiers, wherein each group of new parameters has characteristic parameters different from the other group of parameters.
3. The method for transmitting data according to claim 2, wherein said combining the characteristic information of the transmission content of the current transmission message with one of the two new node identifiers to obtain a first transmission message includes:
and combining the new node identifier with a control word, a data length value, the number of data packets, part of parameters in the first new parameters and a parameter group number in sequence to obtain the first transmission message, wherein the control word occupies one byte, the data length value occupies two bytes, the number of the data packets occupies one byte, part of parameters in the first new parameters occupy one byte, and the parameter group number occupies three bytes.
4. The method for transmitting data according to claim 2, wherein said combining the other new node identifier of the two new node identifiers with each component part obtained by splitting the transmission content, respectively, to obtain at least one second transmission message includes:
and combining the other new node identifier with the data packet number and the data packet content of each component part respectively to correspondingly obtain a second transmission message of each component part, wherein the data packet number of each component part occupies one byte, and the data packet content of each component part occupies seven bytes.
5. The data transmission method according to claim 1, wherein a difference between a maximum value in the preset numerical range and the target closing value is not smaller than a maximum change value accumulated by an error counter of the target node each time.
6. The data receiving method is applied to nodes except the target node in the CAN network, and is characterized by comprising the following steps:
receiving a first sending message and a second sending message;
respectively identifying the received first sending message and the received second sending message based on a preset analysis rule, and identifying the first sending message and the second sending message;
splitting the identified first sending message and the second sending message respectively to obtain characteristic information of the sending content and the components;
and combining the components based on the characteristic information of the transmission content to obtain the transmission content.
7. The data transmitting device is applied to a target node of a CAN network, wherein the target node is any node in the CAN network, and is characterized by comprising the following components:
the first judging module is used for judging whether the current receiving node identifier on the same channel of the target node is the same as the transmitting node identifier of the target node, wherein the current node identifier is the node identifier in the message currently received on the same channel of the target node, and the transmitting node identifier is the node identifier of the message currently transmitted by the target node;
the second judging module is used for determining whether the current value of the error counter of the target node is in a preset value range or not if yes, wherein the maximum value in the preset value range is not greater than a target closing value, and the target closing value is an error counting threshold value for triggering the bus closing of the target node;
the identifier generating module is used for processing the node identifiers of the current sending message based on a preset generating rule to obtain two new node identifiers;
the first combination module is used for combining one new node identifier of the two new node identifiers with the characteristic information of the transmission content of the current transmission message to obtain a first transmission message;
the second combination module is used for respectively combining the other new node identifier of the two new node identifiers with each component part obtained by splitting the transmission content to obtain at least one second transmission message; and
and the sending module is used for respectively sending the first sending message and the second sending message.
8. A data receiving apparatus applied to a node other than the target node in the CAN network, comprising:
the receiving module is used for receiving the first sending message and the second sending message;
the identification recognition module is used for recognizing the received first transmission message and the received second transmission message based on a preset analysis rule respectively, and recognizing the first transmission message and the second transmission message;
the data splitting module is used for splitting the identified first sending message and the second sending message respectively to obtain the characteristic information of the sending content and the components; and
and the data combination module is used for combining the components based on the characteristic information of the transmission content to obtain the transmission content.
9. An electronic device, comprising: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement the respective steps of the data transmission method according to any one of claims 1 to 5 or the data reception method according to claim 6.
10. A readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the data transmission method according to any one of claims 1 to 5 or the data reception method according to claim 6.
CN202311710784.2A 2023-12-12 2023-12-12 Data transmitting method, data receiving method, data transmitting device, data receiving device, electronic equipment and readable storage medium Pending CN117640533A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311710784.2A CN117640533A (en) 2023-12-12 2023-12-12 Data transmitting method, data receiving method, data transmitting device, data receiving device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311710784.2A CN117640533A (en) 2023-12-12 2023-12-12 Data transmitting method, data receiving method, data transmitting device, data receiving device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117640533A true CN117640533A (en) 2024-03-01

Family

ID=90033919

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311710784.2A Pending CN117640533A (en) 2023-12-12 2023-12-12 Data transmitting method, data receiving method, data transmitting device, data receiving device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117640533A (en)

Similar Documents

Publication Publication Date Title
US11411681B2 (en) In-vehicle information processing for unauthorized data
CN111147437B (en) Attributing bus disconnect attacks based on erroneous frames
JPH01503110A (en) Distributed local area network monitoring system
CN104956626A (en) Network device and data sending and receiving system
US20030210699A1 (en) Extending a network management protocol to network nodes without IP address allocations
CN111131126B (en) Attack detection method and device
CN111182659B (en) Mode switching method and mode switching device of Mesh equipment and Mesh equipment
CN109451091B (en) Protection method and proxy equipment
CN112751733A (en) Link detection method, device, equipment, system and switch
KR20200136751A (en) Apparatus for communicating diagnosis of a vehicle, system having the same and method thereof
CN110597226A (en) Abnormity early warning method and device for vehicle-mounted Ethernet
US11700271B2 (en) Device and method for anomaly detection in a communications network
CN117640533A (en) Data transmitting method, data receiving method, data transmitting device, data receiving device, electronic equipment and readable storage medium
Dekanic et al. Integration of CAN bus drivers and UDS on Aurix platform
CN115442177B (en) Data communication method and device of CAN (controller area network)
US20220417718A1 (en) Detection device, vehicle, detection method, and detection program
US11494325B2 (en) Communication module, user and method
CN110177032B (en) Message routing quality monitoring method and gateway controller
CN113938844A (en) Network connection monitoring method, system, computer device and storage medium
CN112235195B (en) Method for processing reported data and related equipment
US6847996B2 (en) Method for managing an open computer system
CN112291125B (en) Multi-node automatic identification method and device for CAN bus
CN114338275B (en) AUTBUS bus network node management method, device, equipment and storage medium
US20230198954A1 (en) Method for analyzing services of nodes of a network
CN112261056B (en) Communication control method and device for power system, control equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination