Switching method of on-demand communication and multicast communication under same port number of microcontroller

By configuring multiple sockets on the FPGA side and switching communication modes using internal state machines, the problem of multicast and on-demand communication switching under the same port number in the naval gun weapon system is solved, and efficient and real-time network communication is achieved to meet the special needs of the naval gun weapon system.

CN119628980AInactive Publication Date: 2025-03-14CHONGQING HUAYU ELECTRIC GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411683860.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the naval gun weapon system, traditional network communication design cannot efficiently switch multicast communication and on-demand communication under the same port number, resulting in waste of network resources and real-time requirements being difficult to meet.

Method used

By configuring three sockets on the FPGA side, using the FPGA internal state machine to perform mode switching, switching from multicast mode to on-demand mode, updating the send register base address, switching from socket2 to socket3, and pointing to the determined target device, achieving fast and accurate communication mode switching.

Benefits of technology

It realizes efficient switching of multicast and on-demand communication without introducing additional delay, meets the real-time, volume, and power consumption requirements of naval gun weapon systems, and improves resource utilization and system flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119628980A_ABST
    Figure CN119628980A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of intelligent communication, and particularly relates to a method for switching on-demand communication and multicast communication under the same port number of a microcontroller, which comprises the following steps of: S1, configuring three sockets at an FPGA (Field Programmable Gate Array) end; the socket 1 is used for receiving external information; the socket 2 and the socket 3 share the same port number, the socket 2 is used for multicast data transmission, and the socket 3 is used for on-demand data transmission; s2, setting a default communication mode as a multicast mode; s3, analyzing external information in real time by using a built-in instruction analysis module of the FPGA; if the on-demand instruction is analyzed, determining a target device; s4, switching from a multicast mode to an on-demand mode; updating a base address of a sending register, switching from a socket 2 to a socket 3, and pointing to a target device; and S5, after the on-demand communication is completed, switching back to the multicast mode, and recovering the base address of the sending register to be the multicast address of the socket 2. According to the method, switching between multicast communication and on-demand communication can be efficiently realized under the condition that additional delay is not introduced, and meanwhile, the requirements of a ship gun weapon system on the size, power consumption and real-time performance are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of intelligent communication, and in particular relates to a method for switching between on-demand communication and multicast communication under the same port number of a microcontroller. Background Art

[0002] In the naval gun weapon system, the inertial navigation system plays a vital role. The system not only requires small size and low power consumption, but also has extremely high requirements for real-time performance. Traditional computer boards often cannot meet the stringent requirements of the inertial navigation system in the naval gun weapon system due to their large size, high power consumption and limited real-time performance. Therefore, the use of embedded chips to implement network communication design has become an ideal choice.

[0003] Embedded chips, especially field programmable gate arrays (FPGAs), have shown great potential in the network communication design of naval gun weapon systems with their high integration, low power consumption and powerful parallel processing capabilities. During network communication, naval gun weapon systems often need to exchange data with multiple devices, which includes both multicast communication that sends data to multiple devices at the same time and on-demand communication that exchanges data one-to-one with specific devices. However, in practical applications, how to efficiently switch between multicast communication and on-demand communication under the same port number has become an urgent problem to be solved.

[0004] In the prior art, the common practice is to configure different port numbers for multicast communication and on-demand communication. However, this practice not only increases the complexity of network management, but also may lead to a waste of network resources. Especially in naval gun weapon systems, due to limited space and numerous devices, the reasonable allocation and utilization of network resources is particularly important. In addition, due to the high real-time requirements of naval gun weapon systems, frequent switching of port numbers may also introduce additional delays, thereby affecting the overall performance of the system.

[0005] The root of the problem is that traditional network communication design often does not fully consider the special needs of naval gun weapon systems, that is, supporting multicast communication and on-demand communication at the same port number. This requires that the network communication design must not only have a high degree of flexibility and scalability, but also be able to maximize resource utilization while ensuring real-time performance. However, due to the complexity of network communication and the particularity of naval gun weapon systems, there are many challenges in achieving this goal. For example, how to quickly and accurately switch communication modes without introducing additional delays; how to ensure the integrity and consistency of data during the switching process; and how to achieve efficient resource allocation and utilization when network resources are limited.

[0006] Therefore, how to efficiently switch between multicast communication and on-demand communication without introducing additional delays while meeting the requirements of naval gun weapon systems on volume, power consumption and real-time performance has become an urgent problem to be solved. Summary of the invention

[0007] In view of the deficiencies of the above-mentioned prior art, the present invention provides a method for switching between on-demand communication and multicast communication under the same port number of a microcontroller, which can efficiently realize the switching between multicast communication and on-demand communication without introducing additional delay, while meeting the requirements of naval gun weapon systems on volume, power consumption and real-time performance.

[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions: The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller comprises the following steps: S1. Configure three sockets on the FPGA side, namely socket1, socket2 and socket3; socket1 is used to receive external information; socket2 and socket3 share the same port number, where socket2 is used for multicast data transmission and socket3 is used for on-demand data transmission; S2, set the default communication mode to multicast mode and use Socket2 for data transmission; S3, using the built-in instruction parsing module of FPGA to parse the external information received by socket1 in real time; if the on-demand instruction is parsed, the target device is determined and go to S4; S4, execute mode switching through the internal state machine of FPGA, switching from multicast mode to on-demand mode; update the base address of the send register, switch from socket 2 to socket 3, and point to the target device determined in S3, and send data to the target device through socket 3; S5. After the on-demand communication is completed, the internal state machine of the communication FPGA automatically switches back to the multicast mode and restores the sending register base address to the multicast address of socket2; and returns to S3 to continue monitoring external information.

[0009] Compared with the prior art, the present invention has the following beneficial effects: 1. This method can switch the communication mode quickly and accurately. This method realizes the fast switching from multicast mode to on-demand mode by configuring three sockets on the FPGA side and using the internal state machine of the FPGA to perform mode switching. The design of the state machine enables the switching process to respond quickly to on-demand instructions without additional processing time. In this way, the switching process is fast and accurate, and can meet the high real-time requirements of the naval gun weapon system without introducing additional delays.

[0010] 2. This method ensures data integrity and consistency. During the switching process, this method ensures that the data transmission channel smoothly transitions from socket 2 to socket 3 by updating the base address of the transmission register, while maintaining the continuity and integrity of the data. In addition, the instruction parsing module inside the FPGA can parse external information in real time to ensure the accuracy of the data before and after the switching. In this way, the data can maintain integrity and consistency during the switching process, avoiding the problem of data loss or erroneous transmission.

[0011] 3. This method can achieve efficient resource allocation and utilization. This method uses the feature that socket2 and socket3 share the same port number to achieve effective utilization of network resources. In multicast mode, socket2 is used for data transmission; in on-demand mode, it switches to socket3. This design avoids the occupation of additional port resources and improves resource utilization. In the case of limited network resources, this method can efficiently allocate and utilize resources, reducing the complexity and cost of the system.

[0012] 4. This method improves the flexibility and scalability of the system. By configuring multiple sockets on the FPGA side and using the internal state machine to switch modes, this method enables the system to flexibly respond to different communication needs. In the future, if new communication modes or functions need to be added, only the corresponding configuration and modification need to be performed on the FPGA side.

[0013] 5. This method also enhances the stability and reliability of the system. The hardware characteristics of FPGA enable the system to run stably and have high reliability. At the same time, this method further enhances the stability and reliability of the system by real-time parsing of external information and updating the base address of the send register.

[0014] In summary, this method can efficiently realize the switching between multicast communication and on-demand communication without introducing additional delay, while meeting the requirements of naval gun weapon system on volume, power consumption and real-time performance.

[0015] Preferably, in S1, a multicast member management submodule is also configured to maintain the multicast member list in multicast mode; the maintenance includes adding new multicast members and deleting multicast members; the multicast member list includes the communication information of all current multicast members; the communication information includes IP addresses and MAC addresses.

[0016] With this setting, the multicast member list not only records the IP addresses of all current multicast members, but also includes the MAC addresses. This detailed communication information record helps to accurately transmit and route data at the network layer and data link layer, improving the reliability and efficiency of data transmission. By accurately managing multicast members, the system can avoid sending data to non-existent members, thereby reducing unnecessary network traffic and bandwidth usage. This is particularly important in environments with limited network resources, and can effectively improve the overall performance and efficiency of the network.

[0017] In addition, the introduction of the multicast member management submodule enables the system to easily expand the number of multicast members and adapt to network environments of different sizes and complexities. At the same time, it also provides higher flexibility, allowing the system to dynamically adjust the composition of multicast members according to actual needs.

[0018] Preferably, the process of adding a new multicast member includes: the multicast member management submodule receives an add request sent by the administrator through an external interface, and the add request includes the communication information of the specified new member; thereafter, the multicast member management submodule adds the information of the new member to the multicast member list, and updates the relevant routing table and MAC address table.

[0019] Preferably, the process of deleting multicast members includes: the multicast member management submodule receives a deletion request sent by the administrator through an external interface, and the deletion request includes the communication information of the member to be deleted; thereafter, the multicast member management submodule deletes the information of the specified member from the multicast member list and updates the relevant routing table and MAC address table.

[0020] With this setup, 1. the multicast member management submodule can precisely control the joining and exiting of multicast members through the add and delete requests sent by the administrator. This precise management ensures the real-time and accuracy of the multicast member list and avoids data transmission problems caused by incorrect or outdated member information.

[0021] 2. It can optimize network performance. Accurate multicast member management and automated routing and MAC address table updates help optimize network performance. The system can more accurately determine the path and destination of data transmission, reducing unnecessary network traffic and bandwidth usage. This is crucial to improving the overall throughput of the network and reducing latency.

[0022] 3. It can also improve the scalability and flexibility of the system. By receiving administrator requests through external interfaces to add or delete multicast members, the system can easily adapt to network environments of different sizes and complexities. This design improves the scalability and flexibility of the system, allowing the system to dynamically adjust the composition of multicast members according to actual needs to meet changing business needs.

[0023] Preferably, the multicast member management submodule is also used to monitor the status of each member in real time, and when it is monitored that the status of the member reaches the warning state, a corresponding warning signal is generated and sent to the management end; the status includes online, offline, delay, and packet loss; the warning state includes offline duration, delay and / or packet loss rate exceeding the corresponding warning threshold.

[0024] Such a setting can, 1. Enhance network stability. By real-time monitoring of member status, the system can promptly detect and resolve potential network problems. For example, when a member is offline for too long or the delay or packet loss rate exceeds the warning threshold, the system will immediately generate a warning signal to remind the administrator to take corresponding measures. This real-time monitoring and warning mechanism helps prevent network failures and enhance network stability and reliability.

[0025] 2. It can enhance troubleshooting capabilities. The early warning signal contains the specific status of the member and the early warning status information, such as offline time, delay and packet loss rate. This information provides administrators with detailed troubleshooting basis, helps to quickly locate the root cause of the problem and take effective solutions.

[0026] 3. It can optimize network performance. Real-time monitoring of member status helps the system evaluate network performance more accurately. By monitoring key indicators such as latency and packet loss rate, the system can promptly detect network bottlenecks or performance degradation trends, and take optimization measures, such as adjusting routing strategies, increasing bandwidth, etc., to improve the overall performance of the network.

[0027] Preferably, the multicast member management submodule also dynamically adjusts the warning threshold of the status evaluation according to historical data and the current network environment.

[0028] Such settings can 1. improve network adaptability. By dynamically adjusting the warning threshold, the system can better adapt to different network environments and business needs. For example, in the case of network congestion or instability, the system can appropriately relax the tolerance range of delay and packet loss rate to avoid frequent warnings and unnecessary interventions caused by overly strict warning conditions.

[0029] 2. It can optimize resource utilization. Dynamic adjustment of warning thresholds helps the system allocate and utilize network resources more reasonably. When the network environment is good, the system can set stricter warning conditions to ensure the stability and quality of network services; when network resources are tight, the conditions can be appropriately relaxed to balance network performance and resource utilization.

[0030] 3. It can reduce false alarms and missed alarms. Traditional static warning threshold settings are often difficult to adapt to the dynamic changes in the network environment, which can easily lead to false alarms (i.e., the warning signal is mistakenly sent when the network condition is good) or missed alarms (i.e., the warning signal is not sent in time when the network condition deteriorates). Dynamic adjustment of the warning threshold can more accurately reflect the network condition, reduce the occurrence of false alarms and missed alarms, and improve the accuracy and reliability of the warning signal.

[0031] Preferably, a plurality of levels of warning thresholds are set in the multicast member management submodule, and a warning threshold of a corresponding level is selected for adjustment according to the current network environment.

[0032] Such settings can achieve refined network management. Multiple levels of warning thresholds make network management more refined. The system can select the most appropriate warning level according to the real-time changes in the network environment, so as to more accurately reflect the network status and avoid excessive or insufficient warning reactions. By setting different levels of warning thresholds, the system can more accurately determine the severity of network problems. This helps administrators quickly locate problems and take appropriate measures, thereby improving the accuracy and effectiveness of warning signals.

[0033] 2. It can optimize resource allocation. Selecting the warning level according to the network environment helps the system allocate network resources more reasonably. When the network condition is good, you can choose a higher warning level to ensure the stability and quality of network services; when the network resources are tight, you can choose a lower warning level to balance network performance and resource utilization.

[0034] 3. It can reduce management complexity. Although multiple levels of warning thresholds are set, the system can automatically select the appropriate level for adjustment according to the current network environment, thereby reducing the complexity and workload of administrators manually adjusting warning conditions.

[0035] Preferably, when the multicast member management submodule adjusts the warning threshold, a progressive adjustment strategy is adopted, and the warning threshold is adjusted by one level each time according to the network environment.

[0036] Such a setting can,1.,reduce network fluctuations. The gradual adjustment strategy avoids sudden changes in the warning threshold, thereby reducing drastic fluctuations in network status. This smooth transition helps maintain the continuity and stability of network services and avoids network interruptions or performance degradation caused by drastic adjustments to the warning threshold.

[0037] 2. It can improve the accuracy of adjustment. By gradually adjusting the warning threshold, the system can more accurately assess changes in the network environment and make corresponding adjustments. This gradual approach helps the system to more accurately find the warning threshold suitable for the current network environment, thereby improving the accuracy and effectiveness of the warning signal. And enhance the flexibility of the system. The progressive adjustment strategy enables the system to respond to changes in the network environment more flexibly. When the network environment changes drastically, the system can adapt to such changes by gradually adjusting the warning threshold, thereby maintaining the stability and reliability of the network.

[0038] 3. It can reduce management risks. The gradual adjustment strategy reduces the management risks caused by improper adjustment of the warning threshold. By adjusting only one level of warning threshold each time, the system can gradually adapt to changes in the network environment and avoid potential problems caused by excessive one-time adjustments.

[0039] Preferably, the multicast member management submodule also dynamically adjusts the threshold adjustment period according to the changing speed of the network environment and the stability of the member status; when the stability of the network environment reaches a preset stability level, the adjustment period is extended to reduce computing overhead; when the variability of the network environment exceeds a preset frequency, the adjustment period is shortened to quickly adapt to the new environment.

[0040] Such a setting can, 1. optimize resource utilization. By dynamically adjusting the threshold adjustment period, the system can extend the adjustment period when the network environment is stable, reducing unnecessary computing overhead and resource waste. This helps the system to use computing resources more efficiently and improve overall performance.

[0041] 2. It can improve the system response speed. When the network environment changes frequently, the system can shorten the adjustment cycle and quickly adapt to the new network environment. This rapid response capability helps the system take timely measures when the network condition deteriorates, avoid network interruption or service degradation, and improve the reliability and stability of the system.

[0042] 3. It can enhance system flexibility. The function of dynamically adjusting the cycle enables the system to respond to changes in the network environment more flexibly. Whether the network environment is stable or changes frequently, the system can maintain the optimal warning threshold setting by adjusting the cycle, thereby ensuring the continuity and stability of network services.

[0043] 4. It can enhance the robustness of the system. The function of dynamically adjusting the cycle enables the system to better adapt to various complex network environments. Whether it is a stable network environment or a frequently changing environment, the system can maintain the accuracy and effectiveness of the warning threshold by adjusting the cycle, thereby enhancing the robustness and stability of the system.

[0044] Preferably, the multicast member management submodule monitors the status of the multicast member through the basic heartbeat packet periodically sent by the multicast member; the basic heartbeat packet contains a network quality indicator, and the network quality indicator includes the current delay and packet loss rate.

[0045] This setting has high real-time performance. The basic heartbeat packets sent regularly enable the system to monitor the status of multicast members in real time. Since the heartbeat packets are sent regularly, the system can obtain the latest status information of the multicast members in a timely manner, thereby ensuring a rapid response to changes in the network environment. And the network quality visibility is good. The network quality indicators (such as latency and packet loss rate) contained in the heartbeat packets provide the system with direct feedback on the network quality. These indicators help the system more accurately evaluate the stability and reliability of the network environment, so as to take appropriate measures to optimize network performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which: Figure 1 Flowchart of this method. DETAILED DESCRIPTION

[0047] The following is a further detailed description through specific implementation methods: Embodiment 1 like Figure 1 As shown, this embodiment discloses a method for switching between on-demand communication and multicast communication under the same port number of a microcontroller, comprising the following steps: S1. Configure three sockets on the FPGA side, namely socket1, socket2 and socket3; socket1 is used to receive external information; socket2 and socket3 share the same port number, where socket2 is used for multicast data transmission and socket3 is used for on-demand data transmission.

[0048] In specific implementation, UDP / IP protocol can be used for communication because it has good performance in multicast and on-demand scenarios.

[0049] S2. Set the default communication mode to multicast mode and use Socket2 for data transmission.

[0050] S3, using the built-in instruction parsing module of FPGA to parse the external information received by socket1 in real time; if the on-demand instruction is parsed, the target device is determined and go to S4; S4, execute mode switching through the internal state machine of FPGA, switching from multicast mode to on-demand mode; update the base address of the send register, switch from socket 2 to socket 3, and point to the target device determined in S3, and send data to the target device through socket 3; S5. After the on-demand communication is completed, the internal state machine of the communication FPGA automatically switches back to the multicast mode and restores the sending register base address to the multicast address of socket2; and returns to S3 to continue monitoring external information.

[0051] During specific implementation, a confirmation message is received or a timeout mechanism is used to confirm whether the on-demand communication is completed.

[0052] Receive confirmation message: During the on-demand communication process, after successfully receiving the data, the target device can send a confirmation message (ACK, Acknowledgment) to the sender (i.e., FPGA end). After receiving this confirmation message, the FPGA end can determine that the on-demand communication has been completed.

[0053] Timeout mechanism: If the FPGA does not receive a confirmation message from the target device within the set time range (i.e., the timeout period), it can be considered that the on-demand communication has failed or is not completed. At this time, the FPGA can take corresponding measures, such as resending data or switching to other communication modes.

[0054] This method can switch the communication mode quickly and accurately. This method realizes the fast switching from multicast mode to on-demand mode by configuring three sockets on the FPGA side and using the internal state machine of the FPGA to perform mode switching. The design of the state machine enables the switching process to respond to on-demand instructions quickly without additional processing time. In this way, the switching process is fast and accurate, and can meet the high real-time requirements of the naval gun weapon system without introducing additional delays. In addition, this method ensures data integrity and consistency. During the switching process, this method ensures that the data transmission channel smoothly transitions from socket2 to socket3 by updating the base address of the transmission register, while maintaining the continuity and integrity of the data. In addition, the instruction parsing module inside the FPGA can parse external information in real time to ensure the accuracy of the data before and after the switching. In this way, the data can maintain integrity and consistency during the switching process, avoiding the problem of data loss or erroneous transmission. In addition, this method can realize efficient resource allocation and utilization. This method uses the characteristics of socket2 and socket3 sharing the same port number to realize the effective utilization of network resources. In multicast mode, socket2 is used for data transmission; in on-demand mode, it is switched to socket3. This design avoids the occupation of extra port resources and improves resource utilization. In the case of limited network resources, this method can efficiently allocate and utilize resources and reduce the complexity and cost of the system.

[0055] This method also improves the flexibility and scalability of the system. By configuring multiple sockets on the FPGA side and using the internal state machine to switch modes, this method enables the system to flexibly respond to different communication needs. In the future, if new communication modes or functions need to be added, only the corresponding configuration and modification need to be made on the FPGA side. In addition, this method also enhances the stability and reliability of the system. The hardware characteristics of the FPGA enable the system to run stably and have high reliability. At the same time, this method further enhances the stability and reliability of the system by real-time parsing of external information and updating the base address of the send register.

[0056] This method can efficiently realize the switching between multicast communication and on-demand communication without introducing additional delay, while meeting the requirements of the naval gun weapon system on volume, power consumption and real-time performance.

[0057] Embodiment 2 Different from the first embodiment, in S1 of this embodiment, a multicast member management submodule is also configured to maintain the multicast member list in multicast mode; the maintenance includes adding new multicast members and deleting multicast members; the multicast member list includes the communication information of all current multicast members; the communication information includes IP addresses and MAC addresses.

[0058] With this setting, not only the IP addresses of all current multicast members are recorded in the multicast member list, but also the MAC addresses. This detailed communication information record facilitates accurate data transmission and routing at the network layer and data link layer, improving the reliability and efficiency of data transmission. By accurately managing multicast members, the system can avoid sending data to non-existent members, thereby reducing unnecessary network traffic and bandwidth usage. This is particularly important in environments with limited network resources, and can effectively improve the overall performance and efficiency of the network. In addition, the introduction of the multicast member management submodule enables the system to easily expand the number of multicast members and adapt to network environments of different sizes and complexities. At the same time, it also provides greater flexibility, allowing the system to dynamically adjust the composition of multicast members according to actual needs.

[0059] In specific implementation, the process of adding a new multicast member includes: the multicast member management submodule receives an add request sent by the administrator through an external interface, the add request includes the communication information of the specified new member; then, the multicast member management submodule adds the information of the new member to the multicast member list, and updates the relevant routing table and MAC address table. The process of deleting a multicast member includes: the multicast member management submodule receives a delete request sent by the administrator through an external interface, the delete request includes the communication information of the member to be deleted; then, the multicast member management submodule deletes the information of the specified member from the multicast member list, and updates the relevant routing table and MAC address table.

[0060] In this way, through the add and delete requests sent by the administrator, the multicast member management submodule can accurately control the joining and exit of multicast members. This precise management ensures the real-time and accuracy of the multicast member list, avoiding data transmission problems caused by incorrect or outdated member information. In addition, network performance can be optimized. Accurate multicast member management and automated routing and MAC address table updates help optimize network performance. The system can more accurately determine the path and destination of data transmission, reducing unnecessary network traffic and bandwidth usage. This is crucial to improving the overall throughput of the network and reducing latency. It can also improve the scalability and flexibility of the system. Receiving administrator requests through external interfaces to add or delete multicast members allows the system to easily adapt to network environments of different sizes and complexities. This design improves the scalability and flexibility of the system, allowing the system to dynamically adjust the composition of multicast members according to actual needs to meet changing business needs.

[0061] Embodiment 3 Different from the second embodiment, in this embodiment, the multicast member management submodule is also used to monitor the status of each member in real time, and when it is monitored that the status of the member reaches the warning state, a corresponding warning signal is generated and sent to the management end; the status includes online, offline, delay, and packet loss; the warning state includes offline duration, delay and / or packet loss rate exceeding the corresponding warning threshold.

[0062] In this way, network stability can be enhanced. By real-time monitoring of member status, the system can promptly detect and resolve potential network problems. For example, when a member is offline for too long or the delay or packet loss rate exceeds the warning threshold, the system will immediately generate a warning signal to remind the administrator to take corresponding measures. This real-time monitoring and warning mechanism helps prevent network failures and enhance network stability and reliability. It can also enhance troubleshooting capabilities. The warning signal contains the specific status and warning status information of the member, such as offline duration, delay, and packet loss rate. This information provides administrators with detailed troubleshooting basis, helps to quickly locate the root cause of the problem, and take effective solutions. And it can optimize network performance. Real-time monitoring of member status helps the system evaluate network performance more accurately. By monitoring key indicators such as delay and packet loss rate, the system can promptly detect network bottlenecks or performance degradation trends, and take optimization measures, such as adjusting routing strategies, increasing bandwidth, etc., to improve the overall performance of the network.

[0063] During specific implementation, the multicast member management submodule monitors the status of the multicast members through the basic heartbeat packets sent regularly by the multicast members; the basic heartbeat packets contain network quality indicators, including the current delay and packet loss rate. In this way, the real-time performance is high, and the regularly sent basic heartbeat packets enable the system to monitor the status of multicast members in real time. Since the heartbeat packets are sent regularly, the system can obtain the latest status information of the multicast members in a timely manner, thereby ensuring a rapid response to changes in the network environment. And the network quality visibility is good. The network quality indicators (such as delay and packet loss rate) contained in the heartbeat packets provide the system with direct feedback on the network quality. These indicators help the system to more accurately evaluate the stability and reliability of the network environment, so as to take appropriate measures to optimize network performance.

[0064] The multicast member management submodule also dynamically adjusts the warning threshold of the status evaluation according to historical data and the current network environment.

[0065] In this way, resource utilization can be optimized. Dynamic adjustment of the warning threshold helps the system allocate and utilize network resources more reasonably. When the network environment is good, the system can set more stringent warning conditions to ensure the stability and quality of network services; when network resources are tight, the conditions can be appropriately relaxed to balance network performance and resource utilization. It can also reduce false alarms and missed alarms. Traditional static warning threshold settings are often difficult to adapt to dynamic changes in the network environment, and are prone to false alarms (i.e., false alarms are sent when the network conditions are good) or missed alarms (i.e., failure to send warning signals in time when the network conditions deteriorate). Dynamic adjustment of the warning threshold can more accurately reflect the network conditions, reduce the occurrence of false alarms and missed alarms, and improve the accuracy and reliability of warning signals.

[0066] In specific implementation, multiple levels of warning thresholds are set in the multicast member management submodule, and the corresponding level of warning thresholds are selected for adjustment according to the current network environment. In this way, refined network management can be achieved. Multiple levels of warning thresholds make network management more refined. The system can select the most appropriate warning level according to the real-time changes in the network environment, so as to more accurately reflect the network status and avoid excessive or insufficient warning reactions. By setting warning thresholds of different levels, the system can more accurately determine the severity of network problems. This helps administrators to quickly locate problems and take appropriate measures, thereby improving the accuracy and effectiveness of warning signals. Resource allocation can also be optimized. Selecting the warning level according to the network environment helps the system to allocate network resources more reasonably. When the network condition is good, a higher warning level can be selected to ensure the stability and quality of network services; when network resources are tight, a lower warning level can be selected to balance network performance and resource utilization. And management complexity can be reduced. Although multiple levels of warning thresholds are set, the system can automatically select the appropriate level for adjustment according to the current network environment, thereby reducing the complexity and workload of administrators manually adjusting warning conditions.

[0067] When the multicast member management submodule adjusts the warning threshold, it adopts a gradual adjustment strategy, adjusting the warning threshold by one level each time according to the network environment. In this way, network fluctuations can be reduced. The gradual adjustment strategy avoids sudden changes in the warning threshold, thereby reducing drastic fluctuations in network status. This smooth transition helps maintain the continuity and stability of network services and avoids network interruptions or performance degradation caused by drastic adjustments to the warning threshold. It can also improve the accuracy of adjustments. By gradually adjusting the warning threshold, the system can more accurately assess changes in the network environment and make corresponding adjustments. This step-by-step approach helps the system to more accurately find the warning threshold suitable for the current network environment, thereby improving the accuracy and effectiveness of the warning signal. And enhance system flexibility. The gradual adjustment strategy enables the system to respond to changes in the network environment more flexibly. When the network environment changes drastically, the system can adapt to such changes by gradually adjusting the warning threshold, thereby maintaining the stability and reliability of the network. It can also reduce management risks. The gradual adjustment strategy reduces the management risks caused by improper adjustment of the warning threshold. By adjusting only one level of the warning threshold each time, the system can gradually adapt to changes in the network environment and avoid potential problems caused by excessive one-time adjustments.

[0068] The multicast member management submodule also dynamically adjusts the threshold adjustment period according to the speed of change of the network environment and the stability of the member status; when the stability of the network environment reaches the preset stability level, the adjustment period is extended to reduce the computing overhead; when the variability of the network environment exceeds the preset frequency, the adjustment period is shortened to quickly adapt to the new environment.

[0069] In this way, resource utilization can be optimized. By dynamically adjusting the threshold adjustment cycle, the system can extend the adjustment cycle when the network environment is stable, reducing unnecessary computing overhead and resource waste. This helps the system use computing resources more efficiently and improves overall performance. In addition, the system response speed can be improved. When the network environment changes frequently, the system can shorten the adjustment cycle and quickly adapt to the new network environment. This rapid response capability helps the system take timely measures when the network condition deteriorates, avoid network interruption or service degradation, and improve the reliability and stability of the system.

[0070] It can also enhance system flexibility. The function of dynamically adjusting the cycle enables the system to respond to changes in the network environment more flexibly. Whether the network environment is stable or changes frequently, the system can maintain the best warning threshold setting by adjusting the cycle, thereby ensuring the continuity and stability of network services. In addition, it can enhance system robustness. The function of dynamically adjusting the cycle enables the system to better adapt to various complex network environments. Whether the network environment is stable or changes frequently, the system can maintain the accuracy and effectiveness of the warning threshold by adjusting the cycle, thereby enhancing the robustness and stability of the system.

[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.

Claims

1. A method for switching between on-demand communication and multicast communication under the same port number of a microcontroller, characterized in that: The following steps are involved: S1. Configure three sockets on the FPGA side, namely socket1, socket2 and socket3; socket1 is used to receive external information; socket2 and socket3 share the same port number, where socket2 is used for multicast data transmission and socket3 is used for on-demand data transmission; S2, set the default communication mode to multicast mode and use Socket2 for data transmission; S3, using the built-in instruction parsing module of FPGA to parse the external information received by socket1 in real time; if the on-demand instruction is parsed, the target device is determined and go to S4; S4, execute mode switching through the internal state machine of FPGA, switching from multicast mode to on-demand mode; update the base address of the send register, switch from socket 2 to socket 3, and point to the target device determined in S3, and send data to the target device through socket 3; S5. After the on-demand communication is completed, the internal state machine of the communication FPGA automatically switches back to the multicast mode and restores the sending register base address to the multicast address of socket2; and returns to S3 to continue monitoring external information.

2. The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller as claimed in claim 1, characterized in that: In S1, a multicast member management submodule is also configured to maintain a multicast member list in multicast mode; the maintenance includes adding new multicast members and deleting multicast members; the multicast member list includes communication information of all current multicast members; The communication information includes an IP address and a MAC address.

3. The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller as claimed in claim 2, characterized in that: The process of adding a new multicast member includes: the multicast member management submodule receives an adding request sent by an administrator through an external interface, the adding request includes the communication information of the specified new member; then, the multicast member management submodule adds the information of the new member to the multicast member list, and updates the relevant routing table and MAC address table.

4. The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller as claimed in claim 3, characterized in that: The process of deleting multicast members includes: the multicast member management submodule receives a deletion request sent by an administrator through an external interface, the deletion request includes communication information of the member to be deleted; then, the multicast member management submodule deletes the information of the specified member from the multicast member list and updates the relevant routing table and MAC address table.

5. The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller as claimed in claim 2, characterized in that: The multicast member management submodule is also used to monitor the status of each member in real time, and when it is detected that the status of a member reaches a warning state, a corresponding warning signal is generated and sent to the management end; the status includes online, offline, delay, and packet loss; the warning state includes offline duration, delay and / or packet loss rate exceeding the corresponding warning threshold.

6. The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller as claimed in claim 5, characterized in that: The multicast member management submodule also dynamically adjusts the warning threshold of the status evaluation according to historical data and the current network environment.

7. The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller as claimed in claim 6, characterized in that: Multiple levels of warning thresholds are set in the multicast member management submodule, and the corresponding level of warning threshold is selected for adjustment according to the current network environment.

8. The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller as claimed in claim 7, characterized in that: When the multicast member management submodule adjusts the warning threshold, a progressive adjustment strategy is adopted, and the warning threshold is adjusted by one level each time according to the network environment.

9. The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller as claimed in claim 5, characterized in that: The multicast member management submodule also dynamically adjusts the threshold adjustment period according to the speed of change of the network environment and the stability of the member status; when the stability of the network environment reaches the preset stability level, the adjustment period is extended to reduce the computing overhead; when the variability of the network environment exceeds the preset frequency, the adjustment period is shortened to quickly adapt to the new environment.

10. The method for switching between on-demand communication and multicast communication under the same port number of a microcontroller as claimed in claim 5, characterized in that: The multicast member management submodule monitors the status of multicast members through the basic heartbeat packets sent periodically; The basic heartbeat packet contains network quality indicators, which include current delay and packet loss rate.