A bus message transmission control method, device, equipment and storage medium

By configuring a unique identifier and a dynamic timeout detection mechanism in the bus communication system, the problems of errors in message identification, inaccurate timeout judgment and out of order of messages in the bus communication system are solved, and high reliability and stability of bus communication are achieved.

CN119363296BActive Publication Date: 2025-03-18SHENZHEN SANMING ELECTRIC CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411913923.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-03-18
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

In the existing bus communication systems, communication packets lack unique identifiers, resulting in identification errors; many bus module slave stations are equipped with a fixed timeout detection mechanism, which cannot adapt to network fluctuations, resulting in inaccurate timeout judgment; insufficient order of message inspection, resulting in out-of-order transmission, affecting data accuracy and system stability.

Method used

Configure the unique communication object identifier of the main station of the bus module, configure the dynamic timeout detection mechanism of the slave station of the bus module, assign the first sequence identification identifier and the second sequence identification identifier, and dynamically adjust the timeout threshold according to the network load and message transmission rate to ensure the uniqueness, sequence and timelinearity of the packets.

Benefits of technology

It improves the accuracy of packet identification, reduces communication errors caused by identifier conflicts, enhances the system's adaptability to network changes, improves the reliability and stability of communication, and ensures the reliable transmission of important packets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363296B_ABST
    Figure CN119363296B_ABST
Patent Text Reader

Abstract

The present invention discloses a bus message transmission control method, device, equipment and storage medium. The present invention configures the communication object identifier of the bus module master station; configures a dynamic timeout detection mechanism; allocates a first sequence identification identifier and a second sequence identification identifier to the communication message; controls the bus module master station to send the communication message through the allocated communication object identifier; checks the communication object identifier to confirm the uniqueness of the communication message; controls the bus module slave station to perform message sequence check according to the first sequence identification identifier and the second sequence identification identifier; dynamically adjusts the timeout threshold according to the current network load and message transmission rate; monitors the reception timestamp of the communication message in real time, and determines whether the communication message is timed out according to the reception timestamp and the adjusted timeout threshold; if timed out, triggers the timeout processing flow to realize the correct transmission control of the communication message. The present invention can realize the effective transmission control of the bus communication message and improve the communication quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of bus control technology, and in particular to a bus message transmission control method, device, equipment and storage medium. Background Art

[0002] The bus module, also known as the bus device, can control the bus and is the bottom-level data communication network in the field of automation. The bus module is used in the production site to connect the intelligent field equipment and the automatic control system with a two-way transmission and branch structure communication network, and can exchange data with other communicative devices.

[0003] In existing bus communication systems, in order to ensure the reliability and efficiency of data transmission, it is usually necessary to effectively control the bus message transmission. However, there are some limitations in the traditional bus message transmission control method. The main problems of the bus message transmission control method in the prior art include: 1) In traditional bus communication systems, communication messages often lack a unique identifier configuration, which may cause recognition errors during the transmission of the message, affecting the accuracy and efficiency of communication. 2) Many existing bus module slaves are configured with a fixed timeout detection mechanism. This bus communication system cannot adapt to network fluctuations or load changes when facing network fluctuations, which can easily lead to inaccurate timeout judgments, thereby affecting the stability of communication. 3) Insufficient message sequence checking: During the message transmission process, the lack of an effective sequence checking mechanism may cause the message to be transmitted out of order, affecting the correctness of the data and the stability of the system.

[0004] Therefore, how to reliably and efficiently control bus message transmission has become an urgent problem to be solved by technicians in this field. Summary of the invention

[0005] In view of the above defects, the embodiments of the present invention provide a bus message transmission control method, device, equipment and storage medium to solve the problems existing in the prior art.

[0006] In order to solve the above technical problems, an embodiment of the present invention provides a bus message transmission control method, the method comprising:

[0007] Configuring a bus module master station, and configuring a unique communication object identifier for a communication message of the bus module master station;

[0008] Configuring a bus module slave station, configuring a dynamic timeout detection mechanism for the bus module slave station;

[0009] Before sending, assigning a first sequence identification identifier and a second sequence identification identifier to the communication message;

[0010] According to a predetermined communication cycle or event trigger, control the bus module master station to send the communication message through the assigned communication object identifier;

[0011] After the bus module receives the communication message from the station, it checks the communication object identifier to confirm the uniqueness of the communication message;

[0012] Control the bus module slave station to perform message sequence check according to the first sequence identification identifier and the second sequence identification identifier;

[0013] If network fluctuations are detected, the dynamic timeout detection mechanism is activated to dynamically adjust the timeout threshold according to the current network load and message transmission rate;

[0014] Recording the reception timestamp of the communication message, and determining whether the communication message has timed out according to the reception timestamp and the adjusted timeout threshold;

[0015] If the communication message times out, a timeout processing flow is triggered to achieve correct transmission control of the communication message.

[0016] Preferably, controlling the bus module slave station to perform message sequence check according to the first sequence identification identifier and the second sequence identification identifier comprises:

[0017] If the confirmation is correct, control the bus module slave station to send a response signal back to the bus module master station;

[0018] If it is confirmed to be incorrect, the bus module is controlled to trigger a message error handling mechanism from the station to achieve correct transmission of the communication message.

[0019] Preferably, in configuring the bus module slave station and configuring a dynamic timeout detection mechanism for the bus module slave station, the dynamic timeout detection mechanism includes:

[0020] Real-time monitoring of network load and message transmission rate;

[0021] Calculating a timeout threshold using a preset algorithm based on the monitored network load and the message transmission rate;

[0022] A timer is set on the bus module slave station, and the timer is used to count the time between the timestamp of sending the communication message and the timestamp of receiving the communication message;

[0023] Control the bus module slave station to continuously monitor whether the communication message is received;

[0024] The bus module slave station is controlled to perform timeout judgment and processing according to the receiving timestamp and the adjusted timeout threshold.

[0025] Preferably, the bus message transmission control method further includes:

[0026] Establishing a heartbeat mechanism between the bus module master station and the bus module slave station;

[0027] Regularly sending heartbeat messages to monitor the connectivity of the communication link between the bus module master station and the bus module slave station;

[0028] If it is detected that the link between the bus module master station and the bus module slave station is abnormal, the message retransmission process is started.

[0029] Preferably, the controlling the bus module slave station to perform timeout judgment and processing according to the receiving timestamp and the adjusted timeout threshold comprises:

[0030] If a communication message is received before the timer reaches the timeout threshold, the timer is reset and the normal communication process continues;

[0031] If no communication message is received after the timer reaches the timeout threshold, it is determined to be a timeout, triggering the timeout processing flow.

[0032] Preferably, the calculating the timeout threshold by applying a preset algorithm based on the monitored network load and message transmission rate includes:

[0033] The timeout threshold is calculated by a preset random forest algorithm.

[0034] Preferably, before sending, allocating a first sequence identification identifier and a second sequence identification identifier to the communication message includes:

[0035] The first sequence identification mark is a timestamp mark;

[0036] The second sequence identification mark is a serial number mark.

[0037] In order to solve the above technical problems, an embodiment of the present invention provides a bus message transmission control device, the device comprising:

[0038] A first configuration module, used to configure a bus module master station, and configure a unique communication object identifier for a communication message of the bus module master station;

[0039] A second configuration module is used to configure the bus module slave station and configure a dynamic timeout detection mechanism for the bus module slave station;

[0040] An identification allocation module, used for allocating a first sequence identification identification and a second sequence identification identification to the communication message before sending;

[0041] A sending control module, used for controlling the bus module master station to send the communication message through the assigned communication object identifier according to a predetermined communication cycle or event trigger;

[0042] A first checking module, used for controlling the bus module to check the communication object identifier to confirm the uniqueness of the communication message after receiving the communication message from the station;

[0043] A second checking module, used for controlling the bus module slave station to perform message sequence checking according to the first sequence identification identifier and the second sequence identification identifier;

[0044] An adjustment module, for starting the dynamic timeout detection mechanism if a network fluctuation is detected, and dynamically adjusting the timeout threshold according to the current network load and message transmission rate;

[0045] A judgment module, used to record the reception timestamp of the communication message, and judge whether the communication message has timed out according to the reception timestamp and the adjusted timeout threshold;

[0046] The trigger control module is used to trigger a timeout processing flow to achieve correct transmission control of the communication message if the communication message times out.

[0047] To solve the above technical problems, an embodiment of the present invention provides a bus message transmission control device, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the method of the first aspect in the above embodiment is implemented.

[0048] To solve the above technical problem, an embodiment of the present invention provides a storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method of the first aspect in the above embodiment is implemented.

[0049] In summary, an embodiment of the present invention provides a bus message transmission control method, device, equipment and storage medium. The present invention configures a bus module master station to configure a unique communication object identifier for the communication message of the bus module master station, thereby ensuring that each communication message can be uniquely identified in a multi-node communication network, thereby improving the accuracy of message identification and reducing communication errors caused by identifier conflicts; configuring a bus module slave station, configuring a dynamic timeout detection mechanism for the bus module slave station, so as to enhance the system's adaptability to network changes, so that the system can effectively respond to network delays and fluctuations, thereby improving communication reliability and reducing communication interruptions caused by timeouts; before sending, assigning a first sequence identification identifier and a second sequence identification identifier to the communication message to ensure that the communication message can be transmitted in sequence and that the bus module slave station sorts and verifies the received message; according to a predetermined communication cycle or event trigger, controlling the bus module master station to send the communication message through the assigned communication object identifier; controlling the bus module slave station to receive After receiving the communication message, check the communication object identifier to confirm the uniqueness of the communication message, avoid repeated or erroneous reception of the communication message, and improve the accuracy of communication; control the bus module slave station to perform message sequence check according to the first sequence identification mark and the second sequence identification mark, so that the bus module slave station can timely discover and handle the problem of communication message loss or misorder, and ensure the integrity and correctness of the data; start the dynamic timeout detection mechanism, dynamically adjust the timeout threshold according to the current network load and message transmission rate, and reduce the misjudgment caused by the fixed timeout threshold not adapting to network changes; record the receiving timestamp of the communication message, and judge whether the communication message is timed out according to the receiving timestamp and the adjusted timeout threshold; if the communication message is timed out, trigger the timeout processing flow to realize the correct transmission control of the communication message, thereby ensuring the reliable transmission of important messages and improving the stability of communication. Therefore, a bus message transmission control method of the present invention can realize the effective transmission control of bus communication messages and improve the communication quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following briefly introduces the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 The present invention is a flowchart of a bus message transmission control method according to an embodiment of the present invention.

[0052] Figure 2 The present invention is a flowchart of a control bus module slave station performing message sequence check according to a first sequence identification identifier and a second sequence identification identifier in an embodiment of the present invention.

[0053] Figure 3 The present invention is a flowchart of configuring a bus module slave station and configuring a dynamic timeout detection mechanism for the bus module slave station.

[0054] Figure 4 It is a flow chart of another bus message transmission control method according to an embodiment of the present invention.

[0055] Figure 5 It is a flowchart of an embodiment of the present invention for controlling the bus module slave station to perform timeout judgment and processing according to the receiving timestamp and the adjusted timeout threshold.

[0056] Figure 6 It is a structural schematic diagram of a bus message transmission control device according to an embodiment of the present invention.

[0057] Figure 7 It is a structural diagram of a bus message transmission control device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.

[0059] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0060] See also Figure 1 , Figure 1 A bus message transmission control method provided by the present application comprises the following steps:

[0061] S1. Configure the bus module master station and configure a unique communication object identifier for the communication message of the bus module master station;

[0062] Specifically, in this embodiment, the bus module is composed of a bus module master station and a plurality of bus module slave stations. The bus module master station is the core control role in the bus communication network, which is used to manage and coordinate the communication activities of the bus communication network, and to exchange data and transmit instructions with each bus module slave station.

[0063] Specifically, in this embodiment, the bus module slave station serves as an execution unit of the bus communication network, and is used to receive and respond to instructions from the bus module master station to perform specific tasks.

[0064] Specifically, in this embodiment, after the bus module master station is powered on, it is initialized through the CANopen protocol, including setting the node ID, communication parameters, etc., to ensure that the bus module master station can work normally.

[0065] Specifically, before sending the message, this application first configures the bus module master station through the CANopen protocol, assigns a unique communication object identifier (COB-ID) to each communication message, and sets the corresponding communication parameters, such as transmission type, cycle, etc., which will not be repeated here.

[0066] S2, configure the bus module slave station, and configure a dynamic timeout detection mechanism for the bus module slave station;

[0067] Specifically, the present application configures a dynamic timeout detection mechanism for the bus module slave station, wherein the dynamic timeout detection mechanism enables the bus module slave station to dynamically adjust the timeout threshold based on the current network load and message transmission rate when detecting changes in network conditions, thereby enhancing the system's adaptability to network fluctuations and improving communication reliability.

[0068] S3. Before sending, assign a first sequence identification identifier and a second sequence identification identifier to the communication message;

[0069] Specifically, in this embodiment, the first sequence identification identifier and the second sequence identification identifier are used to perform a sequence check on the communication message after the bus module receives the communication message from the station, thereby ensuring that the communication message is received and processed in the correct order and improving the accuracy of data transmission.

[0070] S4, according to a predetermined communication cycle or event trigger, the bus module master station is controlled to send a communication message through the assigned communication object identifier;

[0071] S5, after the control bus module receives the communication message from the station, it checks the communication object identifier to confirm the uniqueness of the communication message;

[0072] Specifically, in this embodiment, the bus module master sends a communication message through the assigned communication object identifier COB-ID according to a predetermined communication cycle or event trigger.

[0073] Specifically, in this embodiment, after receiving the communication message from the station, the bus module checks the communication object identifier COB-ID of the communication message to confirm the uniqueness of the communication message.

[0074] S6, controlling the bus module slave station to perform a message sequence check according to the first sequence identification identifier and the second sequence identification identifier;

[0075] Specifically, in this embodiment, after confirming that the communication message is correct, the bus module slave station sends a response signal to the bus module master station. If the bus module slave station detects that the communication message is lost or the sequence is wrong, an error handling process will be triggered. Among them, the error handling process includes requesting the bus module master station to retransmit the lost message or perform other error recovery measures, which are not specifically limited here.

[0076] S7. If network fluctuations are detected, a dynamic timeout detection mechanism is started to dynamically adjust the timeout threshold according to the current network load and message transmission rate;

[0077] Specifically, in this embodiment, at the initial stage, the system is configured with a timeout threshold, which is based on an empirical value or a preset standard network condition. At the same time, the system defines monitoring parameters for network load and message transmission rate, including maximum transmission unit (MTU), message sending frequency, monitoring parameters for network load and message transmission rate, network traffic, etc. The monitoring parameters for network load and message transmission rate are not specifically limited here.

[0078] Specifically, in this embodiment, the bus module slave station monitors the network status in real time. When the bus module slave station detects that the network status fluctuates, the system determines whether the network status has a significant impact on message transmission, such as high network load or message transmission delay.

[0079] Specifically, in this embodiment, the system dynamically adjusts the timeout threshold according to the network status analysis result. If the network status is good, the system lowers the timeout threshold; if the network status is poor, the system increases the timeout threshold.

[0080] S8, recording the receiving timestamp of the communication message, and judging whether the communication message has timed out according to the receiving timestamp and the adjusted timeout threshold;

[0081] S9. If the communication message times out, a timeout processing flow is triggered to achieve correct transmission control of the communication message.

[0082] Specifically, in this embodiment, the adjusted timeout threshold is applied to the timeout detection mechanism for receiving communication messages. The bus module slave station records the receiving timestamp of the communication message in real time, and determines whether the communication message has timed out based on the receiving timestamp and the adjusted timeout threshold. If the communication message times out, the timeout processing process is triggered to achieve correct transmission control of the communication message.

[0083] Specifically, in this embodiment, after the timeout processing flow is triggered, the system records the timeout event, including information such as the message identifier and the timeout time, and decides whether to resend the message, increase the waiting time, report an error, or take other recovery measures according to the preset timeout processing strategy in the timeout processing flow. It is understandable that the preset timeout processing strategy can be set as needed and is not specifically limited here.

[0084] In summary, the present application provides a bus message transmission control method. In this scheme, by configuring the bus module master station, a unique communication object identifier is configured for the communication message of the bus module master station to ensure that in a multi-node communication network, each communication message can be uniquely identified, thereby improving the accuracy of message identification and reducing communication errors caused by identifier conflicts; configuring the bus module slave station, and configuring a dynamic timeout detection mechanism for the bus module slave station to enhance the system's adaptability to network changes, so that the system can effectively respond to network delays and fluctuations, thereby improving communication reliability and reducing communication interruptions caused by timeouts; before sending, a first sequence identification identifier and a second sequence identification identifier are assigned to the communication message to ensure that the communication message can be transmitted in sequence and that the bus module slave station sorts and verifies the received message; according to a predetermined communication cycle or event trigger, the bus module master station is controlled to send the communication message through the assigned communication object identifier. Message; after the control bus module receives the communication message from the station, it checks the communication object identifier to confirm the uniqueness of the communication message, avoids repeated or erroneous reception of the communication message, and improves the accuracy of communication; the control bus module performs message sequence check according to the first sequence identification mark and the second sequence identification mark from the station, which is convenient for the bus module to promptly discover and handle the problem of communication message loss or misorder from the station, and ensures the integrity and correctness of the data; starts the dynamic timeout detection mechanism, dynamically adjusts the timeout threshold according to the current network load and message transmission rate, and reduces the misjudgment caused by the fixed timeout threshold not adapting to network changes; records the receiving timestamp of the communication message, and judges whether the communication message is timed out according to the receiving timestamp and the adjusted timeout threshold; if the communication message is timed out, the timeout processing flow is triggered to realize the correct transmission control of the communication message, thereby ensuring the reliable transmission of important messages and improving the stability of communication. Therefore, a bus message transmission control method of the present invention can realize the effective transmission control of bus communication messages and improve the communication quality.

[0085] Based on the above embodiments:

[0086] See also Figure 2 , Figure 2 The present application provides a flow chart for controlling a bus module slave station to perform message sequence checking based on a first sequence identification identifier and a second sequence identification identifier.

[0087] As a preferred embodiment, controlling the bus module slave station to perform message sequence check according to the first sequence identification identifier and the second sequence identification identifier includes:

[0088] S61, if the confirmation is correct, the bus module slave station is controlled to send a response signal back to the bus module master station;

[0089] S62. If the confirmation is incorrect, the bus module is controlled to trigger a message error handling mechanism from the station to achieve correct transmission of the communication message.

[0090] As a preferred embodiment, before sending, allocating a first sequence identification identifier and a second sequence identification identifier to the communication message includes:

[0091] The first sequence identification identifier is a timestamp identifier;

[0092] The second sequential identification mark is a serial number mark.

[0093] Specifically, in this embodiment, after receiving the communication message, the bus module slave station checks the first sequence identification identifier, i.e., the timestamp identifier, and the second sequence identification identifier, i.e., the serial number identifier. If the bus module slave station confirms that the sequence of the received communication message is correct, it sends a response signal back to the bus module master station to confirm that the message has been correctly received. If the bus module slave station confirms that the sequence of the received communication message is incorrect, the message error handling mechanism is triggered. It is understandable that the message error handling mechanism is used to correct the sequence error, including requesting the retransmission of the message and marking the error message for subsequent processing, which is not specifically limited here.

[0094] Therefore, the present application can reduce the risk of system failure caused by incorrect message sequence and ensure the integrity and correctness of the data.

[0095] See also Figure 3 , Figure 3 A flowchart of configuring a bus module slave station and configuring a dynamic timeout detection mechanism for the bus module slave station is provided in the present application.

[0096] As a preferred embodiment, in configuring the bus module slave station, configuring the dynamic timeout detection mechanism for the bus module slave station, the dynamic timeout detection mechanism includes:

[0097] S21, real-time monitoring of network load and message transmission rate;

[0098] S22, according to the monitored network load and message transmission rate, a preset algorithm is applied to calculate a timeout threshold;

[0099] S23, setting a timer on the bus module slave station, the timer is used to count the time between the timestamp of sending the communication message and the timestamp of receiving the communication message;

[0100] Specifically, in the dynamic timeout detection mechanism, the system monitors the network status in real time, and calculates a suitable timeout threshold using a preset algorithm based on the monitored network load and message transmission rate.

[0101] S24, controlling the bus module slave station to continuously monitor whether the communication message is received;

[0102] S25, controlling the bus module slave station to perform timeout judgment and processing according to the receiving timestamp and the adjusted timeout threshold.

[0103] Specifically, in this embodiment, a timer is set at the bus module slave station to measure the time between the sending timestamp of the communication message sent by the bus module master station and the receiving timestamp of the communication message received by the bus module slave station; then, the system configures the calculated dynamic timeout threshold into the timer as a criterion for judging timeout.

[0104] See also Figure 4 , Figure 4 A flowchart of another bus message transmission control method provided by the present application.

[0105] As a preferred embodiment, a bus message transmission control method further includes:

[0106] S10, establishing a heartbeat mechanism between the bus module master station and the bus module slave station;

[0107] S11, regularly sending heartbeat messages to monitor the connectivity of the communication link between the bus module master station and the bus module slave station;

[0108] S12: If it is detected that the link between the bus module master station and the bus module slave station is abnormal, the message retransmission process is started.

[0109] Specifically, in this embodiment, a heartbeat mechanism is provided between the bus module master station and the bus module slave station, and the heartbeat mechanism confirms the state of the communication link by periodically sending and receiving heartbeat messages. The bus module master station sends a heartbeat message to the bus module slave station at a predetermined time interval, and the heartbeat message usually contains a small amount of data for testing the connectivity of the link without carrying actual business data.

[0110] Specifically, in this embodiment, link anomaly detection is based on the time interval between sending and receiving heartbeat messages. If the heartbeat message is not received for more than a predetermined time threshold, it is considered that there may be an abnormality in the link.

[0111] Specifically, the message retransmission process of the present application is used to resend messages that failed to be successfully transmitted during the link abnormality after the link is restored. Therefore, the present application can timely discover potential problems in the message transmission process and improve the reliability of data transmission between bus modules.

[0112] See also Figure 5 , Figure 5 The present application provides a flowchart for controlling the bus module slave station to perform timeout judgment and processing based on the receiving timestamp and the adjusted timeout threshold.

[0113] As a preferred embodiment, controlling the bus module slave station to perform timeout judgment and processing according to the receiving timestamp and the adjusted timeout threshold comprises:

[0114] S251. If a communication message is received before the timer reaches the timeout threshold, the timer is reset and the normal communication process continues;

[0115] S252: If no communication message is received after the timer reaches the timeout threshold, it is determined to be a timeout, triggering a timeout processing flow.

[0116] Specifically, in this embodiment, the timer is started immediately after the bus module master station sends a communication message; while the timer is running, it is continuously monitored whether the bus module slave station receives the communication message.

[0117] Specifically, in this embodiment, if a communication message is received before the timer reaches the dynamic timeout threshold, the timer is reset and the normal communication process continues;

[0118] Specifically, in this embodiment, if the timer reaches the dynamic timeout threshold and still has not received a communication message, it is determined to be a timeout, triggering a timeout processing flow.

[0119] As a preferred embodiment, according to the monitored network load and message transmission rate, applying a preset algorithm to calculate the timeout threshold includes:

[0120] The timeout threshold is calculated by the preset random forest algorithm.

[0121] Specifically, in this embodiment, a preset random forest algorithm is applied to calculate the timeout threshold according to the monitored network load and message transmission rate.

[0122] Specifically, in this embodiment, the random forest model is trained by a preset random forest algorithm. During training, data collection and preprocessing are first performed. The collected data includes network load, message transmission rate, and corresponding reasonable timeout thresholds. Data preprocessing includes the following steps: 1) Data cleaning: removing outliers and noise; 2) Feature engineering: creating new features, such as historical average network load, rate of change of transmission rate, etc.; 3) Data normalization / standardization: ensuring that all data features are on the same scale.

[0123] Specifically, in this embodiment, the second step is to perform feature selection, that is, to select the feature most relevant to the timeout threshold. In this embodiment, the main features include: network load (such as current bandwidth utilization), message transmission rate (such as the number of data packets transmitted per second) and other possible features, such as network delay, jitter, packet loss rate, etc.

[0124] Specifically, in this embodiment, after feature selection, the preprocessed data is used to train the random forest model, including the following steps:

[0125] 1) Bootstrap sampling: Perform random sampling with replacement from the dataset to generate multiple sub-datasets.

[0126] 2) Tree node splitting: For each sub-dataset, randomly select a feature subset and find the optimal split point to split the data.

[0127] 3) Tree growth: Each tree is fully grown on the corresponding sub-dataset.

[0128] 4) Model training: Repeat the above process until a predetermined number of decision trees are constructed.

[0129] Specifically, in this embodiment, after the random forest model is trained, the validation set is used to evaluate the performance of the random forest model and adjustments are made as needed, including:

[0130] 1) Cross-validation: Use cross-validation to evaluate the generalization ability of the random forest model.

[0131] 2) Parameter tuning: Adjust the parameters of the random forest, such as the number of trees, tree depth, size of feature subsets, etc.

[0132] Specifically, in this embodiment, after the random forest model training is completed and verified, the random forest model is used to predict the timeout threshold under the new network state. The currently monitored network load and message transmission rate are used as the input feature vector x, and the trained random forest model is used to predict the timeout threshold .

[0133] Specifically, in this embodiment, the prediction formula of the random forest is applied to the input feature vector x, and the prediction formula of the random forest is specifically:

[0134] ;

[0135] in:

[0136] B is the number of trees in the forest.

[0137] is the prediction result of the bth tree for input x.

[0138] It is the average of all tree prediction results, that is, the final prediction timeout threshold.

[0139] Therefore, the present application can apply the random forest algorithm to dynamically adjust the timeout threshold to adapt to the ever-changing network conditions, effectively prevent misjudgment caused by the fixed timeout threshold not adapting to network changes, and improve communication accuracy and efficiency.

[0140] Specifically, in this embodiment, network load and packet transmission rate are two different variables. In machine learning, each feature usually represents a dimension of input data, so this application combines the two indicators of network load and packet transmission rate into a two-dimensional feature vector as input x. For example, the currently monitored network load L is 80%, and the packet transmission rate R is 1000 packets / sec, then the feature vector will be This vector is then fed into a random forest model, which outputs a predicted timeout threshold.

[0141] See also Figure 6 The embodiment of the present invention provides a bus message receiving control device, the device comprising:

[0142] The first configuration module 1 is used to configure the bus module master station and configure a unique communication object identifier for the communication message of the bus module master station;

[0143] The second configuration module 2 is used to configure the bus module slave station and configure a dynamic timeout detection mechanism for the bus module slave station;

[0144] The identification allocation module 3 is used to allocate a first sequence identification identification and a second sequence identification identification to the communication message before sending;

[0145] A sending control module 4, used to control the bus module master station to send a communication message through the assigned communication object identifier according to a predetermined communication cycle or event trigger;

[0146] A first checking module 5, used for controlling the bus module to check the communication object identifier to confirm the uniqueness of the communication message after receiving the communication message from the station;

[0147] A second checking module 6, used to control the bus module slave station to perform message sequence checking according to the first sequence identification identifier and the second sequence identification identifier;

[0148] An adjustment module 7 is used to start a dynamic timeout detection mechanism if a network fluctuation is detected, and dynamically adjust the timeout threshold according to the current network load and message transmission rate;

[0149] A judgment module 8, used for recording the reception timestamp of the communication message, and judging whether the communication message has timed out according to the reception timestamp and the adjusted timeout threshold;

[0150] The trigger control module 9 is used to trigger a timeout processing flow if the communication message times out to achieve correct transmission control of the communication message.

[0151] In addition, combined Figure 1 The bus message transmission control method described in the embodiment of the present invention can be implemented by a network bus message receiving control device. Figure 6 A schematic diagram of the hardware structure of a bus message receiving control device provided in an embodiment of the present invention is shown.

[0152] The bus message receiving control device may include a processor 401 and a memory 402 storing computer program instructions.

[0153] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.

[0154] The memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 402 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 402 may be inside or outside the data processing device. In a specific embodiment, the memory 402 is a non-volatile solid-state memory. In a specific embodiment, the memory 402 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0155] The processor 401 implements any one of the bus message transmission control methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .

[0156] In one example, the bus message receiving control device may further include a communication interface 403 and a bus 410. Figure 7 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.

[0157] The communication interface 403 is mainly used to implement the communication between the modules, devices, units and / or equipment in the embodiment of the present invention.

[0158] Bus 410 includes hardware, software or both, and couples the components of the bus message receiving control device to each other. For example, but not limitation, the bus may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnect, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, bus 410 may include one or more buses. Although the embodiments of the present invention describe and illustrate a specific bus, the present invention contemplates any suitable bus or interconnect.

[0159] In addition, in combination with a bus message transmission control method in the above embodiment, an embodiment of the present invention can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any bus message transmission control method in the above embodiment is implemented.

[0160] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.

[0161] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.

Claims

1. A bus message transmission control method, characterized in that: The bus message transmission control method comprises: Configuring a bus module master station, and configuring a unique communication object identifier for a communication message of the bus module master station; Configuring a bus module slave station, configuring a dynamic timeout detection mechanism for the bus module slave station; Before sending, assigning a first sequence identification identifier and a second sequence identification identifier to the communication message; According to a predetermined communication cycle or event trigger, control the bus module master station to send the communication message through the assigned communication object identifier; After the bus module receives the communication message from the station, it checks the communication object identifier to confirm the uniqueness of the communication message; Control the bus module slave station to perform message sequence check according to the first sequence identification identifier and the second sequence identification identifier; If network fluctuations are detected, the dynamic timeout detection mechanism is activated to dynamically adjust the timeout threshold according to the current network load and message transmission rate. The dynamic timeout detection mechanism includes: Real-time monitoring of network load and message transmission rate; According to the monitored network load and the message transmission rate, a preset algorithm is applied to calculate the timeout threshold; wherein the preset algorithm formula is: ; B is the number of trees in the random forest; is the prediction result of the b-th tree for the input x, where the input x is a two-dimensional feature vector composed of the network load and the message transmission rate; is the average of all tree prediction results, i.e. the final prediction timeout threshold; A timer is set on the bus module slave station, and the timer is used to count the time between the timestamp of sending the communication message and the timestamp of receiving the communication message; Control the bus module slave station to continuously monitor whether the communication message is received; Control the bus module slave station to perform timeout judgment and processing according to the receiving timestamp and the adjusted timeout threshold; Recording the reception timestamp of the communication message, and determining whether the communication message has timed out according to the reception timestamp and the adjusted timeout threshold; If the communication message times out, a timeout processing flow is triggered to achieve correct transmission control of the communication message.

2. A bus message transmission control method according to claim 1, characterized in that: The controlling the bus module slave station to perform message sequence checking according to the first sequence identification identifier and the second sequence identification identifier comprises: If the confirmation is correct, control the bus module slave station to send a response signal back to the bus module master station; If it is confirmed to be incorrect, the bus module is controlled to trigger a message error handling mechanism from the station to achieve correct transmission of the communication message.

3. A bus message transmission control method according to claim 1, characterized in that: The bus message transmission control method further comprises: Establishing a heartbeat mechanism between the bus module master station and the bus module slave station; Regularly sending heartbeat messages to monitor the connectivity of the communication link between the bus module master station and the bus module slave station; If it is detected that the link between the bus module master station and the bus module slave station is abnormal, the message retransmission process is started.

4. A bus message transmission control method according to claim 1, characterized in that: The controlling the bus module slave station to perform timeout judgment and processing according to the receiving timestamp and the adjusted timeout threshold comprises: If a communication message is received before the timer reaches the timeout threshold, the timer is reset and the normal communication process continues; If no communication message is received after the timer reaches the timeout threshold, it is determined to be a timeout, triggering the timeout processing flow.

5. A bus message transmission control method according to claim 1, characterized in that: The step of calculating the timeout threshold by applying a preset algorithm based on the monitored network load and message transmission rate includes: The timeout threshold is calculated by a preset random forest algorithm.

6. A bus message transmission control method according to claim 1, characterized in that: The allocating a first sequence identification identifier and a second sequence identification identifier to the communication message before sending includes: The first sequence identification mark is a timestamp mark; The second sequence identification mark is a serial number mark.

7. A bus message receiving control device, characterized in that: The device comprises: A first configuration module, used to configure a bus module master station, and configure a unique communication object identifier for a communication message of the bus module master station; A second configuration module is used to configure the bus module slave station and configure a dynamic timeout detection mechanism for the bus module slave station; An identification allocation module, used for allocating a first sequence identification identification and a second sequence identification identification to the communication message before sending; A sending control module, used for controlling the bus module master station to send the communication message through the assigned communication object identifier according to a predetermined communication cycle or event trigger; A first checking module, used for controlling the bus module to check the communication object identifier to confirm the uniqueness of the communication message after receiving the communication message from the station; A second checking module, used for controlling the bus module slave station to perform message sequence checking according to the first sequence identification identifier and the second sequence identification identifier; The adjustment module is used to start the dynamic timeout detection mechanism if network fluctuations are detected, and dynamically adjust the timeout threshold according to the current network load and message transmission rate. The dynamic timeout detection mechanism includes: Real-time monitoring of network load and message transmission rate; According to the monitored network load and the message transmission rate, a preset algorithm is applied to calculate the timeout threshold; wherein the preset algorithm formula is: ; B is the number of trees in the random forest; is the prediction result of the b-th tree for the input x, where the input x is a two-dimensional feature vector composed of the network load and the message transmission rate; is the average of all tree prediction results, i.e. the final prediction timeout threshold; A timer is set on the bus module slave station, and the timer is used to count the time between the timestamp of sending the communication message and the timestamp of receiving the communication message; Control the bus module slave station to continuously monitor whether the communication message is received; Control the bus module slave station to perform timeout judgment and processing according to the receiving timestamp and the adjusted timeout threshold; A judgment module, used to record the reception timestamp of the communication message, and judge whether the communication message has timed out according to the reception timestamp and the adjusted timeout threshold; The trigger control module is used to trigger a timeout processing flow to achieve correct transmission control of the communication message if the communication message times out.

8. A bus message receiving control device, characterized in that: include: At least one processor, at least one memory and computer program instructions stored in the memory, when the computer program instructions are executed by the processor, implement the method according to any one of claims 1 to 6.

9. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Design method for rapidly controlling network link access

    CN102035688A

  • Protocol stack communication method and device based on CAN bus and storage medium

    CN113079074A

  • Data transmission method and device and electronic equipment

    CN114268416A