A method for configuring a multi-node broadcast
By setting a broadcast countdown timer in the master and slave nodes and controlling the number of broadcast data transmissions, the problem of inconsistent broadcast configurations in a multi-node serial communication system is solved, enabling simultaneous configuration and activation of nodes and improving the robustness of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEWCOSEMI BEIJING TECH CO LTD
- Filing Date
- 2024-12-16
- Publication Date
- 2026-06-16
Smart Images

Figure CN119561917B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic circuit technology, and more specifically to a multi-node broadcast configuration method. Background Technology
[0002] Serial communication systems typically employ a master-slave architecture, requiring only one master node to control the slave nodes. This design is simple to control and inexpensive. When identical configurations are needed for both master and slave nodes, a broadcast mechanism can be used, allowing a single broadcast write operation to affect all nodes. However, data transmission over the link is often susceptible to interference and bit errors, leading to erroneous data received by slave nodes, causing the broadcast write operation to fail and resulting in poor robustness.
[0003] In existing technologies, a broadcast write operation is typically repeated after a failed broadcast write operation until it succeeds. However, in this approach, the configurations of all nodes are not simultaneous, nor can they all take effect at the same time. For some application scenarios that require nodes to take effect simultaneously, if the nodes cannot take effect at the same time, the nodes that have not taken effect will lose their locks, causing those nodes to go offline.
[0004] Therefore, how to configure and activate multiple nodes simultaneously with high robustness is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a multi-node broadcast configuration method to enable all nodes to be configured and effective simultaneously, and to improve the robustness of broadcast configuration by sending broadcast data multiple times.
[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0007] This invention discloses a multi-node broadcast configuration method applied to a serial communication system, the serial communication system comprising: a host, a master node, and multiple slave nodes, the method comprising:
[0008] The host configures the value of the broadcast countdown timer in the master node and sends the configuration data to the master node;
[0009] The master node sends broadcast data to each of the slave nodes; the broadcast data includes: the value of the broadcast countdown timer in the master node before the broadcast data is sent and the configuration data.
[0010] The broadcast countdown timer in the master node is decremented by 1 at preset intervals, and the broadcast data is repeatedly sent to each of the slave nodes.
[0011] Each of the slave nodes verifies the broadcast data to obtain a verification result;
[0012] If the verification result indicates that it is correct, then based on the value of the broadcast countdown timer in the master node before the broadcast data is sent, the value of the broadcast countdown timer in the slave node is configured; the value of the broadcast countdown timer in the slave node decreases by 1 every preset time interval;
[0013] When the broadcast countdown timer in the master node decrements to 0, the master node writes the configuration data into its register, and each slave node writes the configuration data into its register.
[0014] Preferably, the serial communication system is a daisy-chain topology, in which the master node and each of the slave nodes are connected sequentially; the master node sends broadcast data to each of the slave nodes at preset time intervals, including:
[0015] The master node sends broadcast data to the slave nodes connected to it at preset intervals, so that the broadcast data is forwarded to each slave node in turn.
[0016] Preferably, the method further includes:
[0017] When the last node in the daisy chain topology receives broadcast data from the node, the broadcast data is verified to obtain a verification result.
[0018] Determine whether the verification result indicates correctness;
[0019] If so, the last slave node will change the value of the confirmation field in the confirmation data from the default value to the target value; the confirmation data is the data that the last slave node needs to feed back to the master node each time it receives the broadcast data, which is used to characterize whether each slave node verifies whether the broadcast data is correct.
[0020] If not, the value of the confirmation field in the confirmation data will not be changed;
[0021] The confirmation data is sent to the slave node connected to the last slave node, so that the confirmation data is forwarded to the master node level by level.
[0022] The master node verifies each of the received confirmation data. If the confirmation data is verified correctly, the confirmation data is parsed to obtain the value of the confirmation field in each of the confirmation data.
[0023] If the value of any of the confirmation fields is the target value, then the broadcast configuration is determined to be successful.
[0024] Preferably, the serial communication system has a star topology, and the master node and each slave node in the serial communication system are connected via a separate line; the master node sends broadcast data to each slave node at preset time intervals, including:
[0025] The master node broadcasts data to each slave node simultaneously via a separate line at preset intervals.
[0026] Preferably, the method further includes:
[0027] For each of the slave nodes, whenever the broadcast data is received, the broadcast data is verified to obtain a verification result;
[0028] Determine whether the verification result indicates correctness;
[0029] If so, the slave node will change the value of the confirmation field in the confirmation data from the default value to the target value; the confirmation data is the data that the slave node needs to feed back to the master node each time it receives the broadcast data, which is used to characterize whether each slave node verifies whether the broadcast data is correct;
[0030] If not, the value of the confirmation field in the confirmation data will not be changed;
[0031] Each of the slave nodes sends the corresponding confirmation data to the master node;
[0032] For each piece of confirmation data sent by each of the slave nodes, the master node verifies the confirmation data. If the confirmation data is verified correctly, the master node parses the confirmation data to obtain the value of the confirmation field.
[0033] For each of the slave nodes, if the value of the confirmation field in any of the confirmation data sent by the slave node is the target value, then it is determined that the slave node has correctly received the broadcast data.
[0034] When it is confirmed that each of the slave nodes has correctly received the broadcast data, the broadcast configuration is considered successful. Preferably, the serial communication system is a bus topology, and the master node and each of the slave nodes in the serial communication system are connected via a bus; the master node sends broadcast data to each of the slave nodes at preset time intervals, including:
[0035] The master node sends broadcast data to the bus at preset intervals so that each slave node receives the broadcast data.
[0036] Preferably, the process of setting the preset duration includes:
[0037] Calculate the time taken for the master node to send the broadcast data to each slave node to obtain the first duration;
[0038] If the serial communication system is a bus topology, then a preset duration is set based on the first duration, such that the preset duration is longer than the first duration;
[0039] If the serial communication system is a daisy chain topology or a star topology, then based on the time taken for one or more slave nodes to send the confirmation data to the master node, a second duration is obtained. The sum of the first duration and the second duration is calculated to obtain a third duration. A preset duration is set based on the third duration, such that the preset duration is greater than the third duration.
[0040] Preferably, the host configures the value of the broadcast countdown timer in the master node, including:
[0041] The host obtains the bit error rate that meets the requirements of the serial communication system;
[0042] Based on the bit error rate, an initial value is set, and the value of the broadcast countdown timer in the master node is configured to the initial value.
[0043] Preferably, the address of the register in the master node is the same as the address of the register in each of the slave nodes.
[0044] Preferably, the verification results obtained by each slave node verifying the broadcast data include:
[0045] Each of the slave nodes checks the broadcast data for errors;
[0046] If so, a verification result indicating a verification error in the broadcast data is obtained;
[0047] If not, a verification result indicating that the broadcast data verification is correct is obtained.
[0048] Based on the above embodiments of the present invention, a multi-node broadcast configuration method is provided. The host configures the value of the broadcast countdown timer in the master node and sends configuration data to the master node. The master node sends broadcast data to each of the slave nodes, and at preset intervals, decrements the value of the broadcast countdown timer in the master node by 1, and repeatedly sends the broadcast data to each of the slave nodes. The broadcast data includes: the value of the broadcast countdown timer in the master node before the broadcast data is sent and the configuration data. Each slave node verifies the broadcast data to obtain a verification result. If the verification result indicates correctness, the value of the broadcast countdown timer in the slave node is configured based on the value of the broadcast countdown timer in the master node before the broadcast data is sent. The value of the broadcast countdown timer in the slave node decrements by 1 at preset intervals. When the value of the broadcast countdown timer in the master node decrements to 0, the master node writes the configuration data into its register, and each slave node writes the configuration data into its register. In this scheme, a mechanism is set in the master node and slave nodes to decrement the value of the broadcast countdown timer by 1 at preset intervals. The master node sends broadcast data once every preset interval, so that when the value of the broadcast countdown timer in the master node decrements to 0, the master node and slave node are triggered to perform write operations simultaneously, so that all nodes are configured and effective at the same time. The multiple sending of broadcast data improves the robustness of broadcast configuration. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0050] Figure 1 This is a flowchart of a multi-node broadcast configuration method disclosed in an embodiment of the present invention;
[0051] Figure 2 This is a schematic diagram of a master-slave node bus topology disclosed in an embodiment of the present invention;
[0052] Figure 3 This is a schematic diagram of a daisy-chain topology of master and slave nodes disclosed in an embodiment of the present invention;
[0053] Figure 4 This is a flowchart for determining successful broadcast configuration using a daisy-chain topology, as disclosed in an embodiment of the present invention.
[0054] Figure 5 This is a schematic diagram of a star topology structure of master-slave nodes disclosed in an embodiment of the present invention;
[0055] Figure 6 This is a flowchart for determining successful broadcast configuration using a star topology structure, as disclosed in an embodiment of the present invention. Detailed Implementation
[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0058] As the background technology shows, in existing technologies, after a broadcast write operation fails, the broadcast write operation is usually repeated until it succeeds. However, in this approach, the configurations of all nodes are not simultaneous, nor can they take effect at the same time. For some application scenarios that require nodes to take effect simultaneously, if the nodes cannot take effect at the same time, the ineffective nodes will lose their locks, causing those nodes to go offline.
[0059] Therefore, this invention discloses a multi-node broadcast configuration method. In this scheme, a mechanism is set in the master node and slave nodes to decrement the value of the broadcast countdown timer by 1 at preset intervals. The master node sends broadcast data once every preset interval, so that when the value of the broadcast countdown timer in the master node decrements to 0, the master node and slave node are triggered to perform write operations simultaneously, so that all nodes are configured and effective at the same time. Moreover, sending broadcast data multiple times improves the robustness of broadcast configuration.
[0060] like Figure 1 The diagram shown is a flowchart of a multi-node broadcast configuration method disclosed in an embodiment of the present invention. This method is applied to a serial communication system, which includes a host, a master node, and multiple slave nodes, and includes the following steps:
[0061] Step S101: The host configures the value of the broadcast countdown timer in the master node and sends the configuration data to the master node.
[0062] In step S101, the value of the master node's broadcast countdown timer indicates the number of times the master node needs to broadcast to the slave nodes. The initial value of the broadcast countdown timer is a positive integer.
[0063] For example, suppose the master node needs to broadcast to the slave node 5 times, then the initial value of the master node's broadcast countdown timer is 5.
[0064] In this embodiment of the invention, broadcast data needs to be sent multiple times to increase the probability that each slave node will receive the broadcast data correctly, because if it is sent only once, the slave node is more likely to fail to receive the broadcast data correctly due to link interference.
[0065] It should be noted that the initial value of the master node's broadcast countdown timer should not be set too high, as a high initial value will result in a longer waiting time. The initial value setting is related to the acceptable bit error rate of the serial communication system.
[0066] In the specific implementation of step S101, the host obtains the bit error rate that meets the requirements of the serial communication system; based on the bit error rate, the initial value is set, and the value of the broadcast countdown timer in the master node is configured as the initial value.
[0067] Step S102: The master node sends broadcast data to each slave node.
[0068] In step S102, the broadcast data includes: the value of the broadcast countdown timer in the master node before the broadcast data is sent and the configuration data.
[0069] For example, before the master node sends broadcast data 'a', the broadcast countdown timer in the master node has a value of 5. At this time, the broadcast countdown timer in the master node contained in broadcast data 'a' has a value of 5. After the master node sends broadcast data 'a', the broadcast countdown timer in the master node will change to 4 after a preset interval. The master node then sends broadcast data 'a' again, and this time the broadcast countdown timer in the master node contained in broadcast data 'a' has a value of 4.
[0070] Step S103: At preset intervals, decrement the value of the broadcast countdown timer in the master node by 1, and repeatedly send broadcast data to each slave node.
[0071] It should be noted that the preset duration should be greater than the sum of the time it takes for broadcast data to be broadcast from the master node to the slave node and the time it takes for acknowledgment data to be sent back from the slave node to the master node. For example, if it takes 10μs for broadcast data to be broadcast from the master node to the slave node and 10μs for acknowledgment data to be sent back from the slave node to the master node, then the preset duration should be greater than 20μs.
[0072] The confirmation data refers to the signal fed back by the slave node in a specific topology of the serial communication system, indicating whether the slave node has received the correct broadcast data (the feedback of the confirmation data is explained in detail in the following embodiments of the invention). In setting the specific preset duration, it is necessary to consider whether the topology of the serial communication system supports the slave node's feedback of confirmation data. If not, the preset duration should be greater than the time it takes for the broadcast data to be broadcast from the master node to each slave node. The specific implementation process is as follows:
[0073] Calculate the time it takes for the master node to send broadcast data to each slave node to obtain the first duration;
[0074] If the serial communication system is a bus topology, then a preset duration is set based on the first duration, such that the preset duration is longer than the first duration;
[0075] If the serial communication system is a daisy chain topology or a star topology, the second duration is obtained based on the time taken for one or more slave nodes to send acknowledgment data to the master node. The sum of the first and second durations is calculated to obtain the third duration. A preset duration is set based on the third duration, such that the preset duration is greater than the third duration.
[0076] Step S104: Each slave node verifies the broadcast data and obtains the verification result.
[0077] In step S104, after each slave node receives the broadcast data, if the verification is correct, it indicates that the broadcast data received by the slave node is correct and there are no errors.
[0078] In the specific implementation of step S104, each slave node checks whether there are any errors in the broadcast data; if so, it obtains a verification result indicating that the broadcast data verification is incorrect; if not, it obtains a verification result indicating that the broadcast data verification is correct.
[0079] Step S105: If the verification result indicates that it is correct, then configure the value of the broadcast countdown timer in the slave node based on the value of the broadcast countdown timer in the master node before the broadcast data is sent.
[0080] Specifically, the value of the broadcast countdown timer in the slave node decreases by 1 at preset intervals, so that the values of the broadcast countdown timers in the master node and the slave node decrease to 0 simultaneously.
[0081] In step S105, if the verification result indicates correctness, the broadcast data is parsed to obtain the value of the broadcast countdown timer in the master node and the configuration data. Then, the value of the broadcast countdown timer in the slave node becomes the value of the broadcast countdown timer in the master node, and the value of the broadcast countdown timer in the slave node is decremented by 1 every preset time interval. This ensures that the value of the broadcast countdown timer in each slave node is synchronized with the value of the broadcast countdown timer in the master node. When the value of the broadcast countdown timer in the master node decrements to 0, the value of the broadcast countdown timer in each slave node also decrements to 0.
[0082] It is understandable that, since the value of the broadcast countdown timer in the master node decreases by 1 every preset time interval, and the broadcast data is sent once by the master node, the value of the broadcast countdown timer in the master node and the value of the broadcast countdown timer in the slave node are the same, both decreasing by 1 every preset time interval, and will eventually decrease to 0 at the same time.
[0083] Step S106: Determine whether the value of the broadcast countdown timer in the master node has decreased to 0; if yes, proceed to step S107; if no, proceed to step S103.
[0084] In the specific implementation of step S106, the master node determines whether the value of the broadcast countdown timer in the master node has decreased to 0;
[0085] If not, it means that the broadcast countdown timer values in each slave node have not decreased to 0, and the master node returns to step S103 to continue sending broadcast data.
[0086] If so, it means that the value of the broadcast countdown timer in each slave node has also decreased to 0. At this time, the master node no longer sends broadcast data and executes step S107.
[0087] It's important to note that both the master and slave nodes contain a broadcast countdown timer and registers. The broadcast countdown timer in the master node and each slave node decrements by 1 at predetermined intervals. The registers in the master node and each slave node share the same address, ensuring simultaneous configuration data writing. The broadcast countdown timer values in each slave node are synchronized with those in the master node; when the master node's broadcast countdown timer reaches 0, the values in each slave node's broadcast countdown timer also decrease to 0. Furthermore, the configuration data received by each slave node is parsed from the verified broadcast data from the master node and is identical to the configuration data to be written to the master node's register. When the broadcast countdown timer in the master node reaches 0, a write operation is performed, configuring all nodes at once, and the configuration takes effect simultaneously on all nodes.
[0088] Step S107: The master node writes the configuration data into the registers in the master node, and each slave node writes the configuration data into the registers in the slave node.
[0089] In step S107, when the value of the broadcast countdown timer in the master node decreases to 0, the master node performs a write operation to write the configuration data into the register in the master node. At the same time, the value of the broadcast countdown timer in each slave node also decreases to 0, and each slave node also performs a write operation to write the configuration data into the register in the slave node.
[0090] It's important to note that only if the broadcast data received by the slave node is correctly verified can the value of the broadcast countdown timer and configuration data in the master node after the broadcast data was sent be parsed. Only then can the value of the broadcast countdown timer in the slave node be set, and finally, when the value of the broadcast countdown timer in the slave node decrements to 0, the configuration data can be written to the slave node's register. Therefore, if the broadcast countdown timer value in the master node decrements to 0, and the broadcast data received by any slave node consistently fails verification (indicating that the broadcast data received by that slave node is incorrect and contains errors), then no write operation will be performed.
[0091] Based on the above-described multi-node broadcast configuration method disclosed in this embodiment of the invention, this solution sets a mechanism in which the value of the broadcast countdown timer in the master node and the slave node decreases by 1 at preset intervals. The master node sends broadcast data once every preset interval, so that when the value of the broadcast countdown timer in the master node and the slave node decreases to 0 at the same time, the master node and the slave node are triggered to perform write operations simultaneously, so that all nodes are configured and effective at the same time. Moreover, sending broadcast data multiple times improves the robustness of broadcast configuration.
[0092] like Figure 2 The diagram shown is a schematic diagram of a master-slave node bus topology disclosed in an embodiment of the present invention.
[0093] The host communicates with the master node, and the master node and N slave nodes are connected on a bus. Each node transmits data through the bus.
[0094] In this embodiment of the invention, broadcast data is sent from the master node to N slave nodes via a bus; due to the characteristics of the bus topology, the N slave nodes do not send back confirmation data.
[0095] When the multi-node broadcast configuration method disclosed in the above embodiments of the present invention is applied to a serial communication system with a bus topology, the host configures the initial value of the broadcast countdown timer in the master node and sends configuration data to the master node. The master node broadcasts broadcast data containing the configuration data to be configured and the value of the broadcast countdown timer in the master node before the broadcast to each slave node via the bus. If, during the repeated broadcasting process from the master node to each slave node, each slave node receives the correctly verified broadcast data after at least one broadcast and parses it to obtain the configuration data, even if each slave node does not receive the correctly verified broadcast data at the same time, it can be guaranteed that at the same moment (i.e., when the value of the broadcast countdown timer in the master node is 0), the configuration data is simultaneously written to the registers of the master node and each slave node, so that the configuration takes effect simultaneously.
[0096] like Figure 3 The diagram shown is a schematic diagram of a daisy-chain topology of master and slave nodes disclosed in an embodiment of the present invention.
[0097] In this system, the master node and N slave nodes are connected sequentially, with the last slave node N being the most end slave node. Broadcast data is sent sequentially from the master node to the next node until the end slave node (slave node N). Acknowledgment data is sent sequentially from the end slave node (slave node N) to the previous node until the master node.
[0098] When the multi-node broadcast configuration method disclosed in the above embodiments of the present invention is applied to a serial communication system with a daisy-chain topology, the host configures the initial value of the broadcast countdown timer in the master node and sends configuration data to the master node; the master node sends broadcast data to the slave nodes directly connected to the master node, and the broadcast data is sent sequentially from slave node 1 to slave node N (the last slave node); after receiving the broadcast data, slave node N sends back confirmation data containing an acknowledgment field to the previous node, until it is forwarded to the master node; the master node replies to the host with the broadcast configuration result according to the value of the acknowledgment field.
[0099] Based on the daisy chain topology disclosed in the above embodiments of the present invention, such as Figure 4 The diagram shown is a flowchart for determining successful broadcast configuration in a daisy-chain topology according to an embodiment of the present invention. This method is applied to a serial communication system with a daisy-chain topology and includes the following steps:
[0100] Step S201: When the last node in the daisy chain topology receives broadcast data, the broadcast data is verified to obtain the verification result.
[0101] Step S202: Determine whether the verification result indicates that it is correct; if yes, proceed to step S203; if no, proceed to step S204.
[0102] In step S202, a correct verification result indicates that the last slave node has received the correct broadcast data. Due to the characteristics of the daisy chain topology, it can be determined that every slave node before the last slave node has received the correct broadcast data. If the verification result indicates an incorrect verification, it means that at least one slave node in the daisy chain topology has not received the correct broadcast data.
[0103] Step S203: The last node changes the value of the confirmation field in the confirmation data from the default value to the target value.
[0104] Among them, the confirmation data is the data that the last slave node needs to feed back to the master node each time it receives broadcast data, which is used to indicate whether each slave node verifies whether the broadcast data is correct.
[0105] After step S203 is completed, step S205 is executed.
[0106] Step S204: Do not change the value of the confirmation field in the confirmation data.
[0107] It should be noted that if the broadcast data received by the last slave node is not validated correctly, the value of the confirmation field remains unchanged at the default value of 0; if the broadcast data received by the last slave node is validated correctly, that is, when the last slave node receives the correct broadcast data, the value of the confirmation field of the last slave node is set to the target value of 1.
[0108] It should also be noted that since broadcast data is sent sequentially from the master node to the last slave node, if the last slave node receives the correct broadcast data, it means that all slave nodes before the last slave node have received the correct broadcast data.
[0109] Step S205: Send the acknowledgment data to the slave node connected to the last slave node, so that the acknowledgment data is forwarded to the master node level by level.
[0110] In step S205, after the last slave node receives the broadcast data, regardless of whether the verification is correct, the last slave node must sequentially send back the acknowledgment data containing the acknowledgment field to the previous node, until the master node. Only the last slave node can modify the value of the acknowledgment field; other slave nodes only send back the acknowledgment data containing the acknowledgment field to the previous node sequentially.
[0111] Step S206: The master node verifies each received confirmation data. If the confirmation data is verified correctly, the confirmation data is parsed to obtain the value of the confirmation field in each confirmation data. If the value of any confirmation field is the target value, the broadcast configuration is determined to be successful.
[0112] In step S206, after the master node receives the confirmation data, if the verification is correct, it indicates that the confirmation data received by the master node is correct and there are no errors. Then, the value of the confirmation field fed back by the last slave node can be parsed.
[0113] In the specific implementation, if the broadcast countdown timer value in the master node is 0, and the value of the acknowledgment field returned by the last slave node after each broadcast from the master node to the slave node is always 0, it indicates that the broadcast write operation has failed, i.e., the broadcast configuration has failed. If the broadcast countdown timer value in the master node is 0, and the value of the broadcast acknowledgment field returned by the last slave node after at least one broadcast from the master node to the slave node is 1, it indicates that the broadcast write operation has succeeded, i.e., the broadcast configuration has been successfully confirmed.
[0114] It's important to note that after each broadcast from the master node to a slave node, the master node receives a confirmation field value from the last slave node, which can be either 0 or 1. If, after at least one broadcast from the master node to a slave node, the last slave node receives a confirmation field value of 1 from the last slave node, it indicates that the last slave node received correctly validated broadcast data at least once. Because broadcast data is sent sequentially from the master node to the last slave node, if the last slave node receives correctly validated broadcast data, it means that all slave nodes before the last slave node have received correctly validated broadcast data. This means that after at least one broadcast, all slave nodes have received correctly validated broadcast data, parsed the configuration data, and when the broadcast countdown timer in the master node reaches 0, the configuration data is simultaneously written to the registers of both the master node and all slave nodes, indicating a successful broadcast write operation and confirming successful broadcast configuration.
[0115] Preferably, the master node must send a feedback message to the host after confirming whether the broadcast configuration was successful or failed.
[0116] Based on the multi-node broadcast configuration method disclosed in the above embodiments of the present invention, this solution not only enables all nodes to be configured and effective simultaneously, but also improves the robustness of broadcast configuration by sending broadcast data multiple times. In the case of a daisy-chain topology in the serial communication system, a mechanism is established for the slave nodes to report whether they have received the correct broadcast data. This not only allows the master node and host to understand the broadcast configuration results in a timely manner and make accurate decisions for the next step, but also only requires the last slave node to report confirmation data, thereby improving the system's operating efficiency.
[0117] like Figure 5 The diagram shown is a schematic diagram of a star topology structure of master-slave nodes disclosed in an embodiment of the present invention.
[0118] In this system, the master node and N slave nodes are connected via a separate line; broadcast data is sent from the master node to the N slave nodes via a separate line; and acknowledgment data is sent from the N slave nodes back to the master node via a separate line.
[0119] It should be noted that the host configures the initial value of the broadcast countdown timer in the master node and sends the configuration data to the master node; the master node sends broadcast data to each slave node through a separate line; after receiving the broadcast data, each slave node sends back confirmation data containing an acknowledgment field to the master node through a separate line; the master node replies to the host with the broadcast configuration result.
[0120] Based on the star topology disclosed in the above embodiments of the present invention, such as Figure 6 The diagram shown is a flowchart for determining successful broadcast configuration in a star topology structure according to an embodiment of the present invention. This method is applied to a serial communication system with a star topology and includes the following steps:
[0121] Step S301: For each slave node, whenever broadcast data is received, the broadcast data is verified to obtain the verification result.
[0122] Step S302: Determine whether the verification result indicates that it is correct; if yes, proceed to step S303; if no, proceed to step S304.
[0123] In step S302, for each slave node, if the verification result obtained by the slave node from verifying the broadcast data indicates that the slave node has correctly received the broadcast data.
[0124] Step S303: Change the value of the confirmation field in the confirmation data from the default value to the target value from the node.
[0125] The confirmation data is the data that each slave node needs to send back to the master node each time it receives broadcast data, which is used to indicate whether each slave node verifies the correctness of the broadcast data.
[0126] It should be noted that after receiving the broadcast data, each slave node must send confirmation data containing the confirmation field back to the master node via a separate line, regardless of whether the verification is correct.
[0127] After executing step S303, proceed to step S305.
[0128] Step S304: Do not change the value of the confirmation field in the confirmation data.
[0129] It should be noted that the acknowledgment field value of each slave node is the default value of 0. If the broadcast data received by each slave node is not validated correctly, the value of the acknowledgment field remains unchanged; if the broadcast data received by each slave node is validated correctly, that is, if each slave node has received the correct broadcast data, then the value of the acknowledgment field of each slave node is set to the target value of 1. Each slave node has its own corresponding acknowledgment field, and the values are independent of each other.
[0130] Step S305: Each slave node sends the corresponding acknowledgment data to the master node.
[0131] In step S305, each slave node must send confirmation data back to the master node via a separate line.
[0132] Step S306: For each acknowledgment data sent by each slave node, the master node verifies the acknowledgment data. If the acknowledgment data is verified correctly, the master node parses the acknowledgment data to obtain the value of the acknowledgment field.
[0133] In step S306, after the master node receives multiple confirmation data, it performs verification on each of them. If the verification is correct, it indicates that the confirmation data received by the master node is correct and there are no errors. Then, the values of the confirmation fields fed back by each slave node can be parsed.
[0134] Step S307: For each slave node, if the value of the acknowledgment field in any acknowledgment data sent by the slave node is the target value, then it is determined that the slave node has correctly received the broadcast data. When it is determined that each slave node has correctly received the broadcast data, it is determined that the broadcast configuration is successful.
[0135] In step S307, if the broadcast countdown timer in the master node is 0, and at least one slave node sends its own acknowledgment field back to the master node with a value of 0 after each broadcast from the master node to the slave node, then the broadcast write operation has failed, i.e., the broadcast configuration has failed. If the broadcast countdown timer in the master node is 0, and each slave node sends its own acknowledgment field back to the master node with a value of 1 at least once during the repeated broadcast from the master node to the slave node, then the broadcast write operation has succeeded, i.e., the broadcast configuration has succeeded.
[0136] It's important to note that after each broadcast from the master node to the slave nodes, the master node receives the values of the respective acknowledgment fields from each slave node, which are either 0 or 1. If at least one slave node consistently sends a 0 value to its own broadcast acknowledgment field, then at least one slave node has not received correctly validated broadcast data, indicating that at least one slave node has not parsed the configuration data and has not written it to its registers, thus signifying a broadcast write operation failure. Conversely, if during repeated broadcasts from the master node to the slave nodes, each slave node sends a 1 value to its own acknowledgment field at least once, then each slave node has received correctly validated broadcast data after at least one broadcast. This indicates that when the broadcast countdown timer in the master node reaches 0, all slave nodes have received correctly validated broadcast data, parsed the configuration data, and written it to the registers of both the master node and all slave nodes, thus signifying a successful broadcast write operation, i.e., successful broadcast configuration.
[0137] Preferably, the master node must send a feedback message to the host after confirming whether the broadcast configuration was successful or failed.
[0138] Based on the multi-node broadcast configuration method disclosed in the above embodiments of the present invention, this solution not only enables all nodes to be configured and effective simultaneously, but also improves the robustness of broadcast configuration by sending broadcast data multiple times. In the case of a star topology serial communication system, a mechanism is established for slave nodes to report whether they have received the correct broadcast data. This not only allows the master node and host to understand the broadcast configuration results in a timely manner and make accurate decisions for the next step, but also confirms that the data is fed back through the separate line corresponding to the slave node, thereby clarifying which slave node has a problem.
[0139] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0140] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0141] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not 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
1. A multi-node broadcast configuration method, characterized in that, Applied to a serial communication system, the serial communication system comprising: a host, a master node, and multiple slave nodes, the method includes: The host configures the value of the broadcast countdown timer in the master node and sends the configuration data to the master node; The master node sends broadcast data to each of the slave nodes; the broadcast data includes: the value of the broadcast countdown timer in the master node before the broadcast data is sent and the configuration data. The broadcast countdown timer in the master node is decremented by 1 at preset intervals, and the broadcast data is repeatedly sent to each of the slave nodes. Each of the slave nodes verifies the broadcast data to obtain a verification result; If the verification result indicates that it is correct, then based on the value of the broadcast countdown timer in the master node before the broadcast data is sent, the value of the broadcast countdown timer in the slave node is configured; the value of the broadcast countdown timer in the slave node decreases by 1 every preset time interval; When the broadcast countdown timer in the master node decrements to 0, the master node writes the configuration data into its register, and each slave node writes the configuration data into its register.
2. The method according to claim 1, characterized in that, The serial communication system is a daisy-chain topology, in which the master node and each slave node are connected sequentially. The master node broadcasts data to each slave node at preset intervals, including: The master node sends broadcast data to the slave nodes connected to it at preset intervals, so that the broadcast data is forwarded to each slave node in turn.
3. The method according to claim 2, characterized in that, The method further includes: When the last node in the daisy chain topology receives broadcast data from the node, the broadcast data is verified to obtain a verification result. Determine whether the verification result indicates correctness; If so, the last slave node will change the value of the confirmation field in the confirmation data from the default value to the target value; the confirmation data is the data that the last slave node needs to feed back to the master node each time it receives the broadcast data, which is used to characterize whether each slave node verifies whether the broadcast data is correct. If not, the value of the confirmation field in the confirmation data will not be changed; The confirmation data is sent to the slave node connected to the last slave node, so that the confirmation data is forwarded to the master node level by level. The master node verifies each of the received confirmation data. If the confirmation data is verified correctly, the confirmation data is parsed to obtain the value of the confirmation field in each of the confirmation data. If the value of any of the confirmation fields is the target value, then the broadcast configuration is determined to be successful.
4. The method according to claim 1, characterized in that, The serial communication system has a star topology, and the master node and each slave node in the serial communication system are connected via a separate line; the master node sends broadcast data to each slave node at preset time intervals, including: The master node broadcasts data to each slave node simultaneously via a separate line at preset intervals.
5. The method according to claim 4, characterized in that, The method further includes: For each of the slave nodes, whenever the broadcast data is received, the broadcast data is verified to obtain a verification result; Determine whether the verification result indicates correctness; If so, the slave node will change the value of the confirmation field in the confirmation data from the default value to the target value; the confirmation data is the data that the slave node needs to feed back to the master node each time it receives the broadcast data, which is used to characterize whether each slave node verifies whether the broadcast data is correct; If not, the value of the confirmation field in the confirmation data will not be changed; Each of the slave nodes sends the corresponding confirmation data to the master node; For each piece of confirmation data sent by each of the slave nodes, the master node verifies the confirmation data. If the confirmation data is verified correctly, the master node parses the confirmation data to obtain the value of the confirmation field. For each of the slave nodes, if the value of the confirmation field in any of the confirmation data sent by the slave node is the target value, then it is determined that the slave node has correctly received the broadcast data. The broadcast configuration is considered successful when it is confirmed that each of the slave nodes has correctly received the broadcast data.
6. The method according to claim 1, characterized in that, The serial communication system has a bus topology, and the master node and each slave node in the serial communication system are connected via a bus; the master node sends broadcast data to each slave node at preset time intervals, including: The master node sends broadcast data to the bus at preset intervals so that each slave node receives the broadcast data.
7. The method according to claim 3, characterized in that, The process of setting the preset duration includes: Calculate the time taken for the master node to send the broadcast data to each slave node to obtain the first duration; If the serial communication system is a bus topology, then a preset duration is set based on the first duration, such that the preset duration is longer than the first duration; If the serial communication system is a daisy chain topology or a star topology, then based on the time taken for one or more slave nodes to send the confirmation data to the master node, a second duration is obtained. The sum of the first duration and the second duration is calculated to obtain a third duration. A preset duration is set based on the third duration, such that the preset duration is greater than the third duration.
8. The method according to claim 1, characterized in that, The host configures the value of the broadcast countdown timer in the master node, including: The host obtains the bit error rate that meets the requirements of the serial communication system; Based on the bit error rate, an initial value is set, and the value of the broadcast countdown timer in the master node is configured to the initial value.
9. The method according to claim 1, characterized in that, The addresses of the registers in the master node are the same as the addresses of the registers in each of the slave nodes.
10. The method according to any one of claims 1 to 9, characterized in that, Each of the slave nodes verifies the broadcast data to obtain a verification result, including: Each of the slave nodes checks the broadcast data for errors; If so, a verification result indicating a verification error in the broadcast data is obtained; If not, a verification result indicating that the broadcast data verification is correct is obtained.