Network topology detection method and device of simulation equipment, electronic equipment and medium
The network topology detection method implemented through FPGA solves the problem that multiple simulation devices cannot be directly connected, and realizes network topology detection without intermediate devices, saving costs and improving user experience.
Patent Information
- Application Number
- CN202411568864.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-11-05
AI Technical Summary
In the prior art, multiple simulation devices cannot be directly connected through the network port during joint simulation, and switches or routers need to be added, resulting in increased costs and inconvenient use.
The network topology detection method based on FPGA is adopted. By selecting a simulation device as the initial device, the optical port working status of other simulation devices is verified one by one, and local connection is established, and the network topology of multiple devices is generated and saved for real-time communication.
Network topology detection of simulated devices can be realized without additional intermediate devices, saving costs, simplifying routing configuration, and improving user experience.
Smart Images

Figure CN119254687A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electromagnetic transient simulation, and in particular to a network topology detection method, device, electronic equipment and medium for simulation equipment. Background Art
[0002] The electromagnetic transient real-time simulation computing platform is a simulation software widely used in the field of power systems. It is mainly used to evaluate the impact of transient phenomena in power systems on the system. With the increasing complexity and large-scale of power simulation models, it is impossible to complete the simulation calculation within the corresponding simulation step if only a single simulation computing device is used. In order to complete the simulation calculation within the corresponding simulation step, multiple simulation devices are required for joint simulation.
[0003] During joint simulation, it is necessary to actively detect the network topology of the simulation device so that multiple simulation devices can communicate in real time according to the network topology during simulation calculation. Currently, most automatic detection of network topology is mainly based on network ports. In addition, multiple simulation devices cannot be directly connected through network ports, and switches or routers need to be added in the middle. This not only increases the cost of the equipment, but also requires the configuration of complex routing information, which makes it inconvenient for users to use. Summary of the invention
[0004] The present invention provides a network topology detection method, device, electronic device and medium for a simulation device, which are used to solve or partially solve the technical problems existing in the existing related network topology autonomous detection methods, that is, since multiple simulation devices cannot be directly connected through network ports, switches or routers need to be added in the middle, which increases costs and is inconvenient to use.
[0005] The present invention provides a network topology detection method for a simulation device, which is applied to multiple simulation devices for joint simulation; the method comprises:
[0006] Step 101: selecting a first simulation device from the plurality of simulation devices, and using simulation devices other than the first simulation device as second simulation devices;
[0007] Step 102: After the FPGA is successfully initialized, the first simulation device verifies the working status of the optical ports of each of the second simulation devices one by one;
[0008] Step 103: For the target second simulation device whose optical port working state is UP, the first simulation device establishes a local connection with the target second simulation device through a detection message;
[0009] Step 104: Repeat steps 101 to 103 until all simulation devices have performed network topology detection as the first simulation device;
[0010] Step 105: Generate and save the network topology of the multiple simulation devices; the network topology represents the network connection relationship of each of the simulation devices; the network topology is used for the FPGA to perform real-time communication according to the network topology when the multiple simulation devices are jointly simulated.
[0011] Optionally, the first simulation device verifies the working status of the optical ports of each of the second simulation devices one by one, including:
[0012] The first simulation device obtains the working status of the optical ports of each of the second simulation devices one by one;
[0013] If the working state of the optical port of the current second simulation device is DOWN, skip the current second simulation device and obtain the working state of the optical port of the next second simulation device;
[0014] If the working state of the optical port of the current second simulation device is UP, the current second simulation device is used as the target second simulation device that needs to establish a local connection with the first simulation device.
[0015] Optionally, the first simulation device establishes a local connection with the target second simulation device through a detection message, including:
[0016] The first simulation device sends a detection message to the target second simulation device;
[0017] After receiving the detection message, the target second simulation device sends device information to the first simulation device;
[0018] The first simulation device receives the device information and saves the device information locally.
[0019] Optionally, the method further comprises:
[0020] The first simulation device verifies the working status of the optical ports of each of the second simulation devices one by one:
[0021] If the current second simulation device is the target second simulation device, and there is still a second simulation device whose optical port working status has not been verified, the first simulation device will verify the optical port working status of the next second simulation device after establishing a local connection with the target second simulation device;
[0022] If the current second simulation device is the target second simulation device, and there is no second simulation device that has not performed the optical port working state verification, then after the first simulation device establishes a local connection with the target second simulation device, the optical port working state verification action is suspended to perform the network topology detection step of the next first simulation device;
[0023] If the current second simulation device is not the target second simulation device, and there is no second simulation device that has not performed optical port working status verification, the first simulation device suspends the optical port working status verification action to perform the network topology detection step of the next first simulation device.
[0024] Optionally, the method further comprises:
[0025] During the joint simulation process of the multiple simulation devices, if it is detected that the working state of the optical port of the simulation device changes, the network topology is updated in real time based on the result of the change of the working state of the optical port.
[0026] Optionally, if it is detected that the working state of the optical port of the simulation device changes, updating the network topology in real time based on the result of the change of the working state of the optical port includes:
[0027] If a third simulation device is detected whose optical port working state changes from DOWN to UP, or the number of times the optical port state changes, the third simulation device verifies the optical port working state of the fourth simulation device except the third simulation device one by one, and determines whether to establish a local connection with the fourth simulation device based on the optical port working state verification result;
[0028] Based on the local connection establishment result of the third simulation device, updating the network topology in real time;
[0029] The number of changes in the optical port status indicates that the working state of the optical port of the third simulation device changes from UP to DOWN and then from DOWN to UP within a preset time threshold.
[0030] Optionally, if it is detected that the working state of the optical port of the simulation device changes, updating the network topology in real time based on the result of the change of the working state of the optical port includes:
[0031] If a fifth simulation device whose optical port working state changes from UP to DOWN is detected, all sixth simulation devices that currently establish a local connection with the fifth simulation device are determined;
[0032] Disconnecting the local connection between the fifth simulation device and each of the sixth simulation devices, and clearing the device information of all the sixth simulation devices stored locally by the fifth simulation device;
[0033] Based on the device information clearing result of the fifth simulation device, the network topology is updated in real time.
[0034] The present invention also provides a network topology detection device for a simulation device, which is applied to multiple simulation devices for joint simulation; the device comprises:
[0035] A first simulation device selection module, configured to execute step 101: selecting a first simulation device from the plurality of simulation devices, and using simulation devices other than the first simulation device as second simulation devices;
[0036] The optical port working state verification module is used to execute step 102: after the FPGA is successfully initialized, the first simulation device verifies the optical port working state of each of the second simulation devices one by one;
[0037] The local connection establishing module is used to execute step 103: for a target second simulation device whose optical port working state is UP, the first simulation device establishes a local connection with the target second simulation device through a detection message;
[0038] The network topology detection repetition execution module is used to execute step 104: repeatedly execute steps 101 to 103 until all simulation devices have performed network topology detection as the first simulation device;
[0039] The network topology generation module is used to execute step 105: generate and save the network topology of the multiple simulation devices; the network topology represents the network connection relationship of each of the simulation devices; the network topology is used for the FPGA to perform real-time communication when the multiple simulation devices are jointly simulated.
[0040] The present invention also provides an electronic device, the device comprising a processor and a memory:
[0041] The memory is used to store program code and transmit the program code to the processor;
[0042] The processor is used to execute the network topology detection method of the simulation device as described in any one of the above items according to the instructions in the program code.
[0043] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program codes, and the program codes are used to execute the network topology detection method of the simulation device as described in any one of the above items.
[0044] It can be seen from the above technical solutions that the present invention has the following advantages:
[0045] A method for network topology detection of simulation devices based on FPGA is provided. For multiple simulation devices participating in joint simulation, a first simulation device is selected from the multiple simulation devices, and the other simulation devices are used as second simulation devices; after the FPGA is successfully initialized, the first simulation device verifies the optical port working status of each second simulation device one by one; for the target second simulation device whose optical port working status is UP, the first simulation device establishes a local connection with it through a detection message; repeat the above steps until all simulation devices have performed network topology detection as the first simulation device; generate and save the network topology of multiple simulation devices; when multiple simulation devices are jointly simulated, the FPGA communicates in real time according to the network topology. Therefore, for the scenario where multiple simulation devices participate in joint simulation, the network topology detection of the simulation device can be realized without adding additional intermediate devices, thereby saving costs and no need to configure complex routing information. It is convenient for users to use and can further enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A flowchart of the steps of a network topology detection method for a simulation device;
[0048] Figure 2 It is a flow chart of realizing network topology detection based on FPGA;
[0049] Figure 3 A schematic diagram of a network topology structure of a joint simulation device;
[0050] Figure 4 A schematic diagram of a process for real-time updating of network topology detection;
[0051] Figure 5 The present invention is a structural block diagram of a network topology detection device for a simulation device. DETAILED DESCRIPTION
[0052] The embodiments of the present invention provide a network topology detection method, device, electronic device and medium for a simulation device, which are used to solve or partially solve the technical problems existing in the existing related network topology autonomous detection methods, that is, since multiple simulation devices cannot be directly connected through network ports, switches or routers need to be added in the middle, which increases costs and is inconvenient to use.
[0053] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] As an example, when performing joint simulation based on multiple simulation devices, it is necessary to actively detect the network topology of the simulation devices so that multiple simulation devices can communicate in real time according to the network topology during simulation calculation. Currently, most automatic detection of network topologies is mainly based on network ports. In addition, multiple simulation devices cannot be directly connected through network ports, and switches or routers need to be added in the middle. This not only increases the cost of the equipment, but also requires the configuration of complex routing information, which makes it inconvenient for users to use.
[0055] Through further analysis, the present invention finds that since the simulation device is based on FPGA (Field-Programmable Gate Array) for real-time communication, it means that the simulation device uses FPGA as its core hardware platform. And the simulation device can realize real-time data communication function. Based on this characteristic of FPGA, when performing joint simulation, by using FPGA, the data processing speed can be greatly improved to meet the requirements of real-time communication. However, the current network port detection network topology method, because the simulation device will involve connection with third-party equipment, and the third-party equipment cannot be connected through the network port, the current network topology detected by the network port cannot be directly used for FPGA communication.
[0056] Therefore, one of the core inventive points of the embodiment of the present invention is: in view of the deficiencies in the prior art, a method for realizing network topology detection based on FPGA is proposed to adapt to the real-time joint simulation of multiple simulation devices. A first simulation device is selected from multiple simulation devices, and other simulation devices are used as second simulation devices; after the FPGA is successfully initialized, the first simulation device verifies the optical port working status of each second simulation device one by one; for the target second simulation device whose optical port working status is UP, the first simulation device establishes a local connection with it through a detection message; repeat the above steps until all simulation devices have performed network topology detection as the first simulation device; generate and save the network topology of multiple simulation devices; when multiple simulation devices are jointly simulated, the FPGA performs real-time communication according to the network topology.
[0057] Therefore, for the scenario where multiple simulation devices participate in joint simulation, by adopting the method of realizing network topology detection based on FPGA proposed in the technical solution of the present invention, network topology detection of simulation devices can be realized without adding additional intermediate devices, thereby saving costs and eliminating the need to configure complex routing information. It is convenient for users to use and can further enhance the user experience.
[0058] In addition, during the joint simulation of multiple simulation devices, when the working status of the optical port of the simulation device is detected to have changed, the network topology can be updated in real time based on the result of the change in the working status of the optical port. Therefore, by setting up a real-time update mechanism for the network topology structure, the topology structure of the local device can be updated in real time based on the change in the working status of the optical port of each simulation device on the basis of the autonomous detection of the network topology during the joint simulation of multiple simulation devices, and further realize the real-time update of the overall network topology structure to adapt to the changing dynamic simulation needs.
[0059] Reference Figure 1 , shows a flowchart of a method for detecting network topology of a simulation device provided by an embodiment of the present invention, which is applied to multiple simulation devices for joint simulation; the method may specifically include the following steps:
[0060] Step 101, selecting a first simulation device from the plurality of simulation devices, and using simulation devices other than the first simulation device as second simulation devices;
[0061] For example, it is assumed that the simulation devices participating in the joint simulation are device A, device B, device C, and device D. Device A can be selected from device A, device B, device C, and device D as the first simulation device, and device B, device C, and device D can be selected as the second simulation device. Device B can also be selected as the first simulation device, and device A, device C, and device D can be selected as the second simulation device. It is understood that the present invention is not limited to this.
[0062] Step 102, after the FPGA is successfully initialized, the first simulation device verifies the working status of the optical ports of each of the second simulation devices one by one;
[0063] In network equipment, an optical port refers to a network interface that uses optical fiber as a transmission medium. Since an optical port is an interface for optical fiber communication, it has a higher transmission rate and a longer transmission distance, and is usually used for long-distance transmission or high-speed data communication.
[0064] The UP and DOWN of the optical port indicate the working status of the optical port. When the working status of the optical port is UP, it means that the optical port is working normally and can transmit data. When the working status of the optical port is DOWN, it means that the optical port cannot work normally and cannot transmit data.
[0065] In a specific implementation, the first simulation device verifies the working status of the optical port of each second simulation device one by one, which can be: the first simulation device obtains the working status of the optical port of each second simulation device one by one. If the working status of the optical port of the current second simulation device is DOWN, the current second simulation device is skipped and the working status of the optical port of the next second simulation device is obtained. If the working status of the optical port of the current second simulation device is UP, the current second simulation device is used as the target second simulation device that needs to establish a local connection with the first simulation device.
[0066] Still taking the above example, assuming that device A is the first simulated device, it is necessary to verify the optical port working status of device B, device C, and device D one by one. You can first obtain and verify the optical port working status of device B (or you can verify device C first, or you can verify device D first). Assuming that the optical port working status of device B is DOWN, skip device B and obtain the optical port working status of device C or device D. Assuming that the optical port working status of device B is UP, use device B as the target second simulated device that needs to establish a local connection with device A, and enter the local connection establishment process.
[0067] Step 103, for the target second simulation device whose optical port working state is UP, the first simulation device establishes a local connection with the target second simulation device through a detection message;
[0068] For the target second simulation device whose optical port working status is UP, in a specific implementation, the process of the first simulation device establishing a local connection with the target second simulation device through a detection message can be: the first simulation device sends a detection message to the target second simulation device; after receiving the detection message, the target second simulation device sends device information to the first simulation device; the first simulation device receives the device information and saves the device information locally.
[0069] For example, assuming that the first simulated device is still device A, and the target second simulated device whose current optical port working status is UP is device B, device A sends a detection message to device B. After device B receives the detection message, it sends the device information to device A. After device A receives the device information, it saves the device information of device B locally, so that in subsequent joint simulation, it can identify the opposite device based on the saved device information and communicate in real time.
[0070] Furthermore, in the process of the first simulation device verifying the working status of the optical ports of each second simulation device one by one, there may be, but not limited to, the following situations:
[0071] Case 1: The current second simulation device is the target second simulation device, and there is still a second simulation device whose optical port working status verification has not been performed.
[0072] At this time, after establishing a local connection with the target second simulation device, the first simulation device verifies the working state of the optical port of the next second simulation device.
[0073] For example, assume that device A is the first simulated device, the currently verified optical port working status of device B is UP, and there are still devices C and D that have not yet undergone optical port working status verification. At this time, after device A completes the process of establishing a local connection with device B, it performs an optical port working status verification action on the next simulated device (device C or device D).
[0074] Case 2: the current second simulation device is the target second simulation device, and there is currently no second simulation device for which the optical port working status verification has not been performed.
[0075] At this time, after establishing a local connection with the target second simulation device, the first simulation device suspends the optical port working state verification action to perform the network topology detection step of the next first simulation device.
[0076] For example, assume that device A is the first simulated device, the currently verified optical port working status of device B is UP, and there is currently no simulated device that has not yet performed optical port working status verification (that is, device C and device D have completed the optical port working status verification process). At this time, after completing the process of establishing a local connection with device B, device A suspends the optical port working status verification action for other simulated devices to perform the network topology detection step of the next first simulated device. If the network topology detection process has not yet been executed for device B, device C, and device D, the network topology detection process of device B, device C, or device D can be entered.
[0077] Case 3: The current second simulation device is not the target second simulation device, and there is no second simulation device for which the optical port working status verification has not been performed.
[0078] At this time, the first simulation device suspends the optical port working state verification action to perform the network topology detection step of the next first simulation device.
[0079] For example, assume that device A is the first simulated device, the optical port working state of the currently verified device B is DOWN, and there is no simulated device that has not yet performed the optical port working state verification (that is, device C and device D have completed the optical port working state verification process). At this time, device A directly suspends the optical port working state verification action for other simulated devices to perform the network topology detection step of the next first simulated device. If device B and device D have not yet performed the network topology detection process, the network topology detection process of device B or device D can be entered.
[0080] Step 104, repeating steps 101 to 103 until all simulation devices have performed network topology detection as first simulation devices;
[0081] After the network topology detection process of the current first simulation device is completed, refer to the implementation process of steps 101 to 103 to detect other simulation devices that have not yet performed network topology detection. For example, after the network topology detection of device A is completed, device B (or device C or device D) is selected from devices B, device C, and device D that have not yet performed the network topology detection process to perform the above process until all simulation devices (devices AD) have performed network topology detection as the first simulation device.
[0082] Step 105, generate and save the network topology of the multiple simulation devices; the network topology represents the network connection relationship of each of the simulation devices; the network topology is used for the FPGA to perform real-time communication according to the network topology when the multiple simulation devices are jointly simulated.
[0083] Combined with the above content, take device A as the first simulation device, device B, device C and device D as the second simulation device, and perform network topology detection on device A as an example. Figure 2 , shows a schematic diagram of a process of implementing network topology detection based on FPGA provided by an embodiment of the present invention.
[0084] Step S01: Start the network topology detection of device A, initialize the FPGA first, and after detecting that the FPGA is initialized successfully, device A verifies the working status of the optical ports of device B, device C, and device D one by one;
[0085] Step S02: During the optical port working state verification process, if the optical port working state of the current second simulation device (such as device B) is DOWN, then obtain the optical port working state of the next second simulation device (such as device C or device D) until the optical port working state of the second simulation device is UP;
[0086] Step S03: If the current working state of the optical port of the second simulation device (such as device B) is UP, then enter the process of establishing a local connection, that is, device A sends a detection message to device B; after receiving the detection message, the opposite device B based on the optical fiber connection sends the device information of device B to the opposite device A; after receiving the device information of device B, device A saves it locally;
[0087] Step S04: Device A repeats the above optical port working status verification and local connection establishment process until it obtains the device information of all peer connection simulation devices that meet the optical port working status of UP, and ends the network topology detection of device A.
[0088] The remaining devices B, C, and D that have not yet performed the network topology detection process can refer to the aforementioned steps S01 to S04 to perform related detection processes, which will not be described in detail here.
[0089] Therefore, when multiple simulation devices perform joint simulation, for device AD, FPGA can realize real-time communication between each simulation device and other peer-connected simulation devices based on the network topology according to the information stored locally in each simulation device.
[0090] In order to enable those skilled in the art to better understand the technical solution of the present invention, refer to Figure 3 , showing a schematic diagram of the network topology structure of a joint simulation device constructed based on the previous process.
[0091] Combination Figure 3 ,There are four simulation devices A, B, C, and D participating in the joint simulation.
[0092] Among them, device A has established local connections with devices B, C, and D. Then device A can obtain information about the three simulated devices B, C, and D.
[0093] Similarly, if device B establishes a local connection with device A, device B can also obtain the information of device A. However, device B does not directly establish a local connection with devices C and D, so device B cannot obtain and save the information of devices C and D.
[0094] Device C establishes local connections with devices A and D respectively, so device C can obtain information about devices A and D.
[0095] Device D has established local connections with devices A and C respectively, so device D can also obtain information about devices A and C.
[0096] Furthermore, during the joint simulation process of multiple simulation devices, when it is detected that the working state of the optical port of the simulation device changes, the network topology can be updated in real time based on the result of the change in the working state of the optical port.
[0097] In a specific implementation, if it is detected that the working state of the optical port of the simulated device has changed, the network topology is updated in real time based on the result of the change in the working state of the optical port. It can be: if it is detected that the working state of the optical port has changed from DOWN to UP, or the number of times the optical port state of a third simulated device has changed, the third simulated device verifies the working state of the optical port of the fourth simulated device except the third simulated device one by one, and determines whether to establish a local connection with the fourth simulated device based on the verification result of the optical port working state; based on the result of the local connection establishment of the third simulated device, the network topology is updated in real time.
[0098] The number of times the optical port status changes indicates that the working status of the optical port of the third simulation device changes from UP to DOWN and then from DOWN to UP within a preset time threshold. In other words, when the optical port status changes from "UP->DOWN->UP", the status change is counted once.
[0099] In combination with the above network topology, relevant content is updated in real time. For example, Figure 4 A schematic diagram of a process of real-time updating of network topology detection is shown.
[0100] Combination Figure 4 , it is assumed that the working state of the optical port of device A, which is the local device, was originally DOWN, and changed from DOWN to UP during the joint simulation process (that is, the optical port state changed from DOWN->UP); or, the working state of the optical port of device A was originally UP, and changed from UP to DOWN and then from DOWN to UP in a very short time (such as a few milliseconds) during the joint simulation process (that is, the working state of the optical port changed from UP->DOWN->UP, and the number of optical port states changed from 0->1).
[0101] At this time, device A re-verifies the working status of the optical ports of other end devices (i.e., devices B, C, and D) except device A one by one, and determines whether to establish local connections with these simulated devices based on the results of the optical port working status verification. If the working status of the optical port of the opposite device B is UP, at this time, the local device A sends a detection message to the opposite device B based on the UP optical port. After receiving the detection message, the opposite device B returns the local device information to the local device A. After receiving the information of the opposite device B, the local device A saves it locally.
[0102] Similarly, after the local device A completes the network topology detection for the remaining peer devices C and D, the overall network topology is updated in real time based on the local connection establishment result (topology update) of the local device A.
[0103] Therefore, in the joint simulation process of multiple simulation devices, the topology of the simulation device that is currently changing can be rebuilt through the change of the working state of the optical port (from DOWN to UP) or the change of the state number of the optical port (the working state of the optical port changes in a very short time, from UP to DOWN, and then from DOWN to UP), so as to update the overall network topology in real time, and thus update the communication status between each simulation device in real time.
[0104] It is understandable that for a certain simulation device, such as device A, assuming that the current working state of the optical port of device A is UP, device A can obtain the information of the opposite simulation device (such as device B) directly connected to the optical port, and when the working state of the optical port of device A changes from UP to DOWN, the retained information of the opposite device (such as device B) will be cleared. Only when the working state of the optical port of device A changes from DOWN to UP, will the network topology detection be re-performed and the information of the newly connected opposite device be updated and saved.
[0105] In another case, if it is detected that the working state of the optical port of the simulated device has changed, the network topology is updated in real time based on the result of the change in the working state of the optical port. It can also be: if it is detected that the working state of the optical port of a fifth simulated device has changed from UP to DOWN, all sixth simulated devices that have currently established a local connection with the fifth simulated device are determined; the local connection between the fifth simulated device and each sixth simulated device is disconnected, and the device information of all sixth simulated devices stored locally by the fifth simulated device is cleared; based on the result of clearing the device information of the fifth simulated device, the network topology is updated in real time.
[0106] For example, during the joint simulation process, when it is detected that the working state of the optical port of device A changes from UP to DOWN, all simulated devices (such as devices B and C) that have established local connections with device A are determined; the local connection between device A and devices B and C is disconnected, and the device information of devices B and C stored locally by device A is cleared; based on the device information clearing result of device A, the network topology is updated in real time. Only when the working state of the optical port of device A changes from DOWN to UP, the network topology detection is performed again, and the information of the opposite device that saves the new connection is updated.
[0107] It should be noted that, in order to enable those skilled in the art to better distinguish data of the same type but with different actual meanings, the embodiments of the present invention use terms such as first and second to distinguish and explain some technical features. The terms such as first and second are only used to distinguish data and have no other special meanings. It can be understood that the present invention is not limited to this.
[0108] In an embodiment of the present invention, a method for realizing network topology detection based on FPGA is provided for the scenario where multiple simulation devices participate in joint simulation. By adopting the technical solution of the present invention, the network topology detection of the simulation device can be realized without adding additional intermediate devices, thereby saving costs, and there is no need to configure complex routing information. It is convenient for users to use and can further enhance the user experience. On this basis, the embodiment of the present invention also provides a real-time update mechanism for the network topology structure, so that on the basis of the autonomous detection of the network topology when realizing the joint simulation of multiple simulation devices, the topology structure of the local device can be updated in real time based on the changes in the working status of the optical ports of each simulation device, and further realize the real-time update of the overall network topology structure to adapt to the changing dynamic simulation needs.
[0109] Reference Figure 5 , shows a structural block diagram of a network topology detection device for a simulation device provided by an embodiment of the present invention, which is applied to multiple simulation devices for joint simulation; the device may specifically include:
[0110] The first simulation device selection module 501 is used to execute step 101: select a first simulation device from the plurality of simulation devices, and use simulation devices other than the first simulation device as second simulation devices;
[0111] The optical port working state verification module 502 is used to execute step 102: after the FPGA is successfully initialized, the first simulation device verifies the optical port working state of each of the second simulation devices one by one;
[0112] The local connection establishing module 503 is used to execute step 103: for the target second simulation device whose optical port working state is UP, the first simulation device establishes a local connection with the target second simulation device through a detection message;
[0113] The network topology detection repetition execution module 504 is used to execute step 104: repeatedly execute steps 101 to 103 until all simulation devices have performed network topology detection as the first simulation device;
[0114] The network topology generation module 505 is used to execute step 105: generate and save the network topology of the multiple simulation devices; the network topology represents the network connection relationship of each of the simulation devices; the network topology is used for the FPGA to perform real-time communication when the multiple simulation devices are jointly simulated.
[0115] In an optional embodiment, the optical port working status verification module 502 includes:
[0116] An optical port working state acquisition module, used for the first simulation device to acquire the optical port working state of each of the second simulation devices one by one;
[0117] The first optical port working state judgment module is used to skip the current second simulation device and obtain the optical port working state of the next second simulation device when the optical port working state of the current second simulation device is DOWN;
[0118] The optical port working state second judgment module is used for, when the optical port working state of the current second simulation device is UP, taking the current second simulation device as the target second simulation device that needs to establish a local connection with the first simulation device.
[0119] In an optional embodiment, the local connection establishing module 503 includes:
[0120] A detection message sending module, used for the first simulation device to send a detection message to the target second simulation device;
[0121] A device information sending module, configured to send device information to the first simulation device after the target second simulation device receives the detection message;
[0122] The device information saving module is used for the first simulation device to receive the device information and save the device information locally.
[0123] In an optional embodiment, the optical port working state verification module 502 is further specifically used for:
[0124] The first simulation device verifies the working status of the optical ports of each of the second simulation devices one by one:
[0125] If the current second simulation device is the target second simulation device, and there is still a second simulation device whose optical port working status has not been verified, the first simulation device will verify the optical port working status of the next second simulation device after establishing a local connection with the target second simulation device;
[0126] If the current second simulation device is the target second simulation device, and there is no second simulation device that has not performed the optical port working state verification, then after the first simulation device establishes a local connection with the target second simulation device, the optical port working state verification action is suspended to perform the network topology detection step of the next first simulation device;
[0127] If the current second simulation device is not the target second simulation device, and there is no second simulation device that has not performed optical port working status verification, the first simulation device suspends the optical port working status verification action to perform the network topology detection step of the next first simulation device.
[0128] In an optional embodiment, the device further includes:
[0129] The network topology updating module is used to update the network topology in real time based on the result of the optical port working state change if it is detected that the optical port working state of the simulation device changes during the joint simulation process of the multiple simulation devices.
[0130] In an optional embodiment, the network topology updating module includes:
[0131] A third simulation device update module is used for, when detecting that the working state of the optical port changes from DOWN to UP, or the number of times the optical port state changes, the third simulation device verifies the working state of the optical port of the fourth simulation device other than the third simulation device one by one, and determines whether to establish a local connection with the fourth simulation device based on the verification result of the working state of the optical port;
[0132] A first network topology updating submodule, configured to update the network topology in real time based on the local connection establishment result of the third simulation device;
[0133] The number of changes in the optical port status indicates that the working state of the optical port of the third simulation device changes from UP to DOWN and then from DOWN to UP within a preset time threshold.
[0134] In an optional embodiment, the network topology updating module includes:
[0135] A fifth simulation device determining module, configured to determine all sixth simulation devices that have currently established a local connection with the fifth simulation device when detecting that the fifth simulation device whose optical port working state changes from UP to DOWN;
[0136] A fifth simulation device processing module, used for disconnecting the local connection between the fifth simulation device and each of the sixth simulation devices, and clearing the device information of all the sixth simulation devices stored locally by the fifth simulation device;
[0137] The second network topology updating submodule is used to update the network topology in real time based on the device information clearing result of the fifth simulation device.
[0138] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the aforementioned method embodiment.
[0139] An embodiment of the present invention further provides an electronic device, the device comprising a processor and a memory:
[0140] The memory is used to store the program code and transmit the program code to the processor;
[0141] The processor is used to execute the network topology detection method of the simulation device of any embodiment of the present invention according to the instructions in the program code.
[0142] An embodiment of the present invention further provides a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the network topology detection method of the simulation device of any embodiment of the present invention.
[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0144] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0146] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0147] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0148] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A network topology detection method for a simulation device, characterized in that: Multiple simulation devices applied to joint simulation; the method comprises: Step 101: selecting a first simulation device from the plurality of simulation devices, and using simulation devices other than the first simulation device as second simulation devices; Step 102: After the FPGA is successfully initialized, the first simulation device verifies the working status of the optical ports of each of the second simulation devices one by one; Step 103: For the target second simulation device whose optical port working state is UP, the first simulation device establishes a local connection with the target second simulation device through a detection message; Step 104: Repeat steps 101 to 103 until all simulation devices have performed network topology detection as the first simulation device; Step 105: Generate and save the network topology of the multiple simulation devices; the network topology represents the network connection relationship of each of the simulation devices; the network topology is used for the FPGA to perform real-time communication according to the network topology when the multiple simulation devices are jointly simulated.
2. The network topology detection method of the simulation device according to claim 1, characterized in that: The first simulation device verifies the working status of the optical ports of each of the second simulation devices one by one, including: The first simulation device obtains the working status of the optical ports of each of the second simulation devices one by one; If the working state of the optical port of the current second simulation device is DOWN, skip the current second simulation device and obtain the working state of the optical port of the next second simulation device; If the working state of the optical port of the current second simulation device is UP, the current second simulation device is used as the target second simulation device that needs to establish a local connection with the first simulation device.
3. The network topology detection method of the simulation device according to claim 2, characterized in that: The first simulation device establishes a local connection with the target second simulation device through a detection message, including: The first simulation device sends a detection message to the target second simulation device; After receiving the detection message, the target second simulation device sends device information to the first simulation device; The first simulation device receives the device information and saves the device information locally.
4. The network topology detection method of the simulation device according to claim 3, characterized in that: Also includes: The first simulation device verifies the working status of the optical ports of each of the second simulation devices one by one: If the current second simulation device is the target second simulation device, and there is still a second simulation device whose optical port working status has not been verified, the first simulation device will verify the optical port working status of the next second simulation device after establishing a local connection with the target second simulation device; If the current second simulation device is the target second simulation device, and there is no second simulation device that has not performed the optical port working state verification, then after the first simulation device establishes a local connection with the target second simulation device, the optical port working state verification action is suspended to perform the network topology detection step of the next first simulation device; If the current second simulation device is not the target second simulation device, and there is no second simulation device that has not performed optical port working status verification, the first simulation device suspends the optical port working status verification action to perform the network topology detection step of the next first simulation device.
5. The network topology detection method for a simulation device according to any one of claims 1 to 4, characterized in that: Also includes: During the joint simulation process of the multiple simulation devices, if it is detected that the working state of the optical port of the simulation device changes, the network topology is updated in real time based on the result of the change of the working state of the optical port.
6. The network topology detection method of the simulation device according to claim 5, characterized in that: If it is detected that the working state of the optical port of the simulation device changes, the network topology is updated in real time based on the result of the change of the working state of the optical port, including: If a third simulation device is detected whose optical port working state changes from DOWN to UP, or the number of times the optical port state changes, the third simulation device verifies the optical port working state of the fourth simulation device except the third simulation device one by one, and determines whether to establish a local connection with the fourth simulation device based on the optical port working state verification result; Based on the local connection establishment result of the third simulation device, updating the network topology in real time; The number of changes in the optical port status indicates that the working state of the optical port of the third simulation device changes from UP to DOWN and then from DOWN to UP within a preset time threshold.
7. The network topology detection method of the simulation device according to claim 5, characterized in that: If it is detected that the working state of the optical port of the simulation device changes, the network topology is updated in real time based on the result of the change of the working state of the optical port, including: If a fifth simulation device whose optical port working state changes from UP to DOWN is detected, all sixth simulation devices that currently establish a local connection with the fifth simulation device are determined; Disconnecting the local connection between the fifth simulation device and each of the sixth simulation devices, and clearing the device information of all the sixth simulation devices stored locally by the fifth simulation device; Based on the device information clearing result of the fifth simulation device, the network topology is updated in real time.
8. A network topology detection device for a simulation device, characterized in that: Multiple simulation devices used for joint simulation; the device comprises: A first simulation device selection module, configured to execute step 101: selecting a first simulation device from the plurality of simulation devices, and using simulation devices other than the first simulation device as second simulation devices; The optical port working state verification module is used to execute step 102: after the FPGA is successfully initialized, the first simulation device verifies the optical port working state of each of the second simulation devices one by one; The local connection establishing module is used to execute step 103: for a target second simulation device whose optical port working state is UP, the first simulation device establishes a local connection with the target second simulation device through a detection message; The network topology detection repetition execution module is used to execute step 104: repeatedly execute steps 101 to 103 until all simulation devices have performed network topology detection as the first simulation device; The network topology generation module is used to execute step 105: generate and save the network topology of the multiple simulation devices; the network topology represents the network connection relationship of each of the simulation devices; the network topology is used for the FPGA to perform real-time communication when the multiple simulation devices are jointly simulated.
9. An electronic device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the network topology detection method of the simulation device according to any one of claims 1 to 7 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the network topology detection method of the simulation device according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for determining a physical connection topology of a test device with real-time capability
CN110543652A
Optical fiber topology automatic discovery and maintenance method
CN114244721A
Method for automatically generating topology of optical fiber repeater system
CN116582778A
Large network simulator for device characterization
US20190007277A1
