Network topology detection method, device, electronic device and medium for simulation equipment

The network topology detection method for simulation devices implemented through FPGA solves the problem of multiple simulation devices being unable to connect directly, realizes real-time communication and topology updates without the need for additional equipment, and improves the user experience.

CN119254687BActive Publication Date: 2025-10-03ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411568864.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-10-03
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

In the existing technology, multiple simulation devices cannot be directly connected through network ports, and switches or routers need to be added, which increases costs and is inconvenient to use.

Method used

The network topology detection method is implemented using FPGA. A first simulation device is selected from multiple simulation devices, the working status of the optical ports of other devices is verified one by one, a local connection is established, and the network topology is generated and saved. The FPGA performs real-time communication according to the topology.

Benefits of technology

No additional intermediate devices are required, which saves costs, simplifies routing configuration, improves user experience, and enables real-time communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254687B_ABST
    Figure CN119254687B_ABST
Patent Text Reader

Abstract

The present invention discloses a network topology detection method, device, electronic device, and medium for emulation devices, which are used to solve the problem in existing related methods that multiple emulation devices cannot be directly connected through network ports, requiring the addition of switches or routers in the middle, resulting in increased costs and inconvenience in use. The method comprises: selecting a first emulation device from multiple emulation devices, and using the other emulation devices as second emulation devices; after successfully initializing the FPGA, the first emulation device verifies the optical port working status of each second emulation device one by one; for the target second emulation device whose optical port working status is UP, the first emulation device establishes a local connection with it through a detection message; repeating the above steps until all emulation devices have performed network topology detection as the first emulation device; generating and saving the network topology of multiple emulation devices; and when multiple emulation devices are jointly simulated, the FPGA performs real-time communication according to the network topology.
Need to check novelty before this filing date? Find Prior Art

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 widely used simulation software in the power system field. It is primarily used to assess the impact of transient phenomena in power systems. As power simulation models become increasingly complex and large-scale, using only a single simulation computing device is unable to complete the simulation within the corresponding simulation step size. To achieve this, multiple simulation devices are required to perform joint simulations.

[0003] During co-simulation, it's necessary to proactively detect the network topology of the simulated devices so that multiple simulated devices can communicate in real time based on this topology during simulation calculations. Currently, most automatic network topology detection methods rely on network ports. Furthermore, multiple simulated devices cannot be directly connected via network ports; switches or routers are required in between. This not only increases equipment costs but also requires complex routing configuration, making it inconvenient for users. Summary of the Invention

[0004] The present invention provides a network topology detection method, device, electronic device and medium for simulation equipment, which are used to solve or partially solve the technical problems existing in existing related network topology autonomous detection methods, that is, multiple simulation equipment cannot be directly connected through network ports, and 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 the 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 port of each of the second simulation devices one by one;

[0008] Step 103: For the target second simulation device whose optical port working status 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 simulation device; 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 port of each of the second simulation devices one by one, including:

[0012] The first simulation device obtains the working status of the optical port of each second simulation device 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 establishing a local connection with the target second simulation device through a detection message includes:

[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 includes:

[0020] During the process of verifying the working status of the optical ports of the second simulation devices one by one, the first simulation device:

[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 yet performed optical port working status verification, then after the first simulation device establishes a local connection with the target second simulation device, it suspends the optical port working status verification action 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 includes:

[0025] During the joint simulation process of the multiple simulation devices, if it is detected that the working status of the optical port of the simulation device changes, the network topology is updated in real time based on the result of the change in the working status of the optical port.

[0026] Optionally, if a change in the working state of the optical port of the emulated device is detected, updating the network topology in real time based on the result of the change in the working state of the optical port includes:

[0027] If a third emulation 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 emulation device verifies the optical port working state of each fourth emulation device other than the third emulation device one by one, and determines whether to establish a local connection with the fourth emulation 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 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.

[0030] Optionally, if a change in the working state of the optical port of the emulated device is detected, updating the network topology in real time based on the result of the change in the working state of the optical port includes:

[0031] If a fifth emulation device is detected whose optical port working state changes from UP to DOWN, all sixth emulation devices that currently have established local connections with the fifth emulation 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 is configured 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;

[0036] The optical port working state verification module is configured 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 configured 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 configured to execute step 104: repeatedly execute steps 101 to 103 until all simulation devices have performed network topology detection as first simulation devices;

[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 simulation device; 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.

[0040] The present invention further provides an electronic 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 configured to execute the network topology detection method for a simulation device as described above according to 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 code, and the program code is 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 successfully initializing the FPGA, 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 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. 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 following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.

[0047] Figure 1 A flowchart of the steps of a method for detecting network topology of a simulation device;

[0048] Figure 2 This is a flowchart of implementing 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 flowchart of a real-time update of network topology detection is shown;

[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 existing related network topology autonomous detection methods, such as the fact that multiple simulation devices cannot be directly connected through network ports, and switches or routers need to be added in the middle, resulting in increased costs and inconvenience in 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 making creative work are within the scope of protection of the present invention.

[0054] For example, when performing joint simulations across multiple devices, it's necessary to proactively detect the network topology of the devices so that they can communicate in real time based on this topology during simulation calculations. Currently, most automatic network topology detection methods rely on network ports. Furthermore, multiple devices cannot be directly connected via network ports; a switch or router is required in between. This not only increases device costs but also requires complex routing configuration, making it inconvenient for users.

[0055] Further analysis by the present invention reveals that since the simulation device is based on an FPGA (Field-Programmable Gate Array) for real-time communication, it uses an FPGA as its core hardware platform. Furthermore, the simulation device is capable of implementing real-time data communication capabilities. Based on this characteristic of FPGAs, the use of FPGAs during co-simulation can significantly increase data processing speeds, meeting the requirements of real-time communication. However, the current method of using network ports to detect network topology cannot be directly used for FPGA communication, as the simulation device involves connecting to third-party devices, which cannot be connected via network ports.

[0056] Therefore, one of the core inventions of the embodiment of the present invention is that: in response to the deficiencies in the existing technology, 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 the other simulation devices are used as second simulation devices; after successfully initializing the FPGA, 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 network topology detection based on FPGA proposed in the technical solution of the present invention, network topology detection of simulation devices can be achieved 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] Furthermore, during the joint simulation of multiple simulated devices, if changes in the operating status of the simulated device's optical port are detected, the network topology can be updated in real time based on these changes. By establishing a real-time network topology update mechanism, the topology of the local device can be updated in real time based on changes in the operating status of each simulated device's optical port, building on the autonomous detection of the network topology during joint simulation of multiple simulated devices. This further enables real-time updates of the overall network topology to accommodate changing dynamic simulation requirements.

[0059] Reference Figure 1 , shows a flowchart of the steps of a network topology detection method for 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 the simulation devices other than the first simulation device as second simulation devices;

[0061] For example, assume that the simulated devices participating in the joint simulation are device A, device B, device C, and device D. Device A can be selected from devices A, B, C, and D as the first simulated device, and devices B, C, and D as the second simulated devices. Alternatively, device B can be selected as the first simulated device, and devices A, C, and D can be selected as the second simulated devices. It should be 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 port 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 the transmission medium. Because optical ports are used for fiber-optic communications, they offer high transmission rates and long transmission distances, making them commonly used for long-distance or high-speed data communications.

[0064] The UP and DOWN statuses of an optical port indicate its working status. When the working status of an optical port is UP, it indicates that the optical port is working normally and can transmit data. When the working status of an optical port is DOWN, it indicates that the optical port is not working properly and cannot transmit data.

[0065] In a specific implementation, the first simulation device verifies the optical port operating status of each second simulation device one by one. This can be done as follows: the first simulation device obtains the optical port operating status of each second simulation device one by one. If the current optical port operating status of the second simulation device is DOWN, the current second simulation device is skipped and the optical port operating status of the next second simulation device is obtained. If the current optical port operating status of the 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] Continuing with the previous example, assume that device A is the first simulated device. The optical port operating status of devices B, C, and D needs to be verified one by one. The optical port operating status of device B (or device C or D) can be obtained and verified first. If the optical port operating status of device B is DOWN, device B is skipped and the optical port operating status of device C or D is obtained. If the optical port operating status of device B is UP, device B is selected as the second simulated device to establish a local connection with device A, and the local connection establishment process begins.

[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 the target second simulation device receives the detection message, it 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 probe message to device B. After device B receives the probe 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 simulations, it can identify the opposite device based on the saved device information and communicate in real time.

[0070] Furthermore, during the process of the first simulation device verifying the working status of the optical ports of each second simulation device one by one, the following situations may occur, including but not limited to:

[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 performs optical port working status verification on the next second simulation device.

[0073] For example, assume that device A is the first simulated device. The currently verified optical port operating status of device B is UP, and there are devices C and D whose optical port operating status has not yet been verified. In this case, after completing the process of establishing a local connection with device B, device A will perform the optical port operating 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 no second simulation device whose optical port working status has not been verified.

[0075] At this time, after establishing a local connection with the target second simulation device, 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.

[0076] For example, assume that device A is the first simulated device, the currently verified optical port operating status of device B is UP, and no simulated devices have yet to undergo optical port operating status verification (i.e., devices C and D have already completed the optical port operating status verification process). In this case, after completing the process of establishing a local connection with device B, device A suspends the optical port operating status verification process for the other simulated devices to proceed with the network topology detection step for the next first simulated device. If the network topology detection process has not yet been executed for devices B, C, or D, the network topology detection process for device B, C, or D can be initiated.

[0077] Case 3: The current second simulation device is not the target second simulation device, and there is no second simulation device whose optical port working status has not been verified.

[0078] At this time, 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.

[0079] For example, assume that device A is the first simulated device, the currently verified optical port operating status of device B is DOWN, and no simulated devices have yet to undergo optical port operating status verification (i.e., devices C and D have already completed the optical port operating status verification process). In this case, device A simply suspends the optical port operating status verification process for the other simulated devices to proceed with the network topology detection step for the next first simulated device. If the network topology detection process has not yet been executed for devices B and D, the network topology detection process for either device B or D can be initiated.

[0080] Step 104, repeating steps 101 to 103 until all simulation devices have performed network topology detection as the first simulation device;

[0081] After the network topology detection process for the current first simulated device is complete, refer to the implementation process of steps 101 to 103 to detect other simulated devices that have not yet performed network topology detection. For example, after the network topology detection process for device A is completed, device B (or device C or device D) is selected from devices B, C, and D that have not yet performed the network topology detection process to perform the aforementioned process until all simulated devices (devices A to D) have performed network topology detection as the first simulated 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 simulation device; 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 flow chart of implementing network topology detection based on FPGA provided by an embodiment of the present invention.

[0084] Step S01: Device A starts network topology detection by initializing the FPGA. After detecting that the FPGA initialization is successful, device A verifies the working status of the optical ports of devices B, C, and D one by one.

[0085] Step S02: During the optical port working status verification process, if the optical port working status of the current second emulated device (such as device B) is DOWN, the optical port working status of the next second emulated device (such as device C or device D) is obtained until the optical port working status of the second emulated device is UP;

[0086] Step S03: If the optical port of the second simulated device (e.g., device B) is currently in the UP state, a local connection establishment process is initiated. Specifically, device A sends a detection message to device B. Device B, which is connected to the other end via the optical fiber, receives the detection message and sends device B's device information to device A. Device A, upon receiving device B's device information, 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 perform related detection processes with reference to the aforementioned steps S01 to S04, 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 by 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 , which shows a schematic diagram of the network topology of the joint simulation device constructed based on the previous process.

[0091] Combine Figure 3 , there are four simulation devices A, B, C, and D participating in the joint simulation.

[0092] Device A has established local connections with devices B, C, and D. Therefore, 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 information about device A. However, device B does not directly establish a local connection with devices C and D, so device B cannot obtain and save information about 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 establishes 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 a change in the working status of an optical port of a simulation device is detected, the network topology can be updated in real time based on the result of the change in the working status of the optical port.

[0097] In a specific implementation, if a change is detected in the working status of the optical port of the simulated device, the network topology is updated in real time based on the result of the change in the working status of the optical port. It can be: if a third simulated device is detected whose working status changes from DOWN to UP, or the number of times the optical port status changes, the third simulated device verifies the working status of the optical ports of the fourth simulated device other than 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 status; and updates the network topology in real time based on the result of establishing the local connection of the third simulated device.

[0098] The number of optical port status changes indicates that the working state of the optical port of the third emulated device changes from UP to DOWN and then from DOWN to UP within a preset time threshold. In other words, each time the optical port status changes from UP to DOWN to 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 for real-time updating of network topology detection is shown.

[0100] Combine Figure 4 Suppose that the working status of the optical port of device A, which is the local device, was originally DOWN and then changed from DOWN to UP during the co-simulation process (i.e., the optical port status changed from DOWN to UP). Alternatively, the working status of the optical port of device A was originally UP and then changed from UP to DOWN and then from DOWN to UP again within a very short time (e.g., a few milliseconds) during the co-simulation process (i.e., the optical port working status changed from UP to DOWN to UP, and the optical port status count changed from 0 to 1).

[0101] Device A then re-verifies the operating status of the optical ports of all other devices (i.e., devices B, C, and D) one by one. Based on the verification results, it determines whether to establish local connections with these emulated devices. If the operating status of the optical port on device B is up, device A sends a probe message to device B using the up optical port. After receiving the probe message, device B returns its own information to device A. After receiving the information from device B, 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, during the joint simulation process of multiple simulation devices, the topology of the simulation device that has changed can be rebuilt through the change of the optical port working status (from DOWN to UP) or the change of the optical port status frequency (the optical port working status 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's understandable that for a simulated device, such as device A, if its optical port is currently in the UP state, device A can obtain information about the simulated device (such as device B) directly connected to it. However, when the optical port status of device A changes from UP to DOWN, the retained information about the remote device (such as device B) is cleared. Only after the optical port status of device A changes from DOWN to UP does it re-detect the network topology and update the saved information about the newly connected remote device.

[0105] In another case, if it is detected that the working status 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 status of the optical port. It can also be: if it is detected that the working status of the optical port of the fifth simulated device has changed from UP to DOWN, all sixth simulated devices that have currently established local connections 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 a co-simulation, if the status of device A's optical port changes from UP to DOWN, the system will determine all simulated devices (such as devices B and C) that have established local connections with device A. The local connections between device A and devices B and C will be disconnected, and the device information for devices B and C stored locally on device A will be cleared. Based on the cleared information, the network topology will be updated in real time. Only after the status of device A's optical port changes from DOWN to UP will the system re-detect the network topology and update the newly connected peer device information.

[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, some technical features are distinguished and described using terms such as first and second in the embodiments of the present invention. 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 does not impose any restrictions on 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 eliminating the need to configure complex routing information. It is convenient for users to use and can further enhance the user experience. On this basis, an 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 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, further realizing real-time updates for 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 configured 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 configured 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 configured 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;

[0113] The network topology detection repetition execution module 504 is configured to execute step 104: repeatedly execute steps 101 to 103 until all simulation devices have performed network topology detection as first simulation devices;

[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 according to the network topology 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 status acquisition module, configured for the first simulation device to acquire the optical port working status of each of the second simulation devices one by one;

[0117] The optical port working state first judgment module is used to skip the current second simulation device when the optical port working state of the current second simulation device is DOWN, and obtain the optical port working state of the next second simulation device;

[0118] The optical port working state second judgment module is used to, when the optical port working state of the current second simulation device is UP, use the current second simulation device as a 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, configured 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 status verification module 502 is further specifically configured to:

[0124] During the process of verifying the working status of the optical ports of the second simulation devices one by one, the first simulation device:

[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 yet performed optical port working status verification, then after the first simulation device establishes a local connection with the target second simulation device, it suspends the optical port working status verification action 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 emulation device updating module configured to, upon detecting a third emulation device whose optical port working state changes from DOWN to UP, or whose optical port state count changes, verify the optical port working states of fourth emulation devices other than the third emulation device one by one, and determine whether to establish a local connection with the fourth emulation device based on the optical port working state verification result;

[0132] A first network topology updating submodule, configured to update the network topology in real time based on a local connection establishment result of the third simulation device;

[0133] 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.

[0134] In an optional embodiment, the network topology updating module includes:

[0135] a fifth emulation device determining module configured to, when detecting a fifth emulation device whose optical port working state changes from UP to DOWN, determine all sixth emulation devices that currently have established local connections with the fifth emulation device;

[0136] a fifth simulation device processing module, configured to disconnect the local connection between the fifth simulation device and each of the sixth simulation devices, and clear the device information of all the sixth simulation devices stored locally by the fifth simulation device;

[0137] The second network topology updating submodule is configured 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 including a processor and a memory:

[0140] The memory is used to store program codes and transmit the program codes to the processor;

[0141] The processor is configured to execute the network topology detection method for 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 code. The program code is 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 will 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 merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0145] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0146] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0147] If the integrated unit is implemented as 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, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[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 above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can 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 are used for joint simulation; the method includes: Step 101: selecting a first simulation device from the plurality of simulation devices, and using the 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 port of each of the second simulation devices one by one; Step 103: For the target second simulation device whose optical port working status 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 simulation device; 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 port of each second simulation device 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: During the process of verifying the working status of the optical ports of the second simulation devices one by one, the first simulation device: 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 yet performed optical port working status verification, then after the first simulation device establishes a local connection with the target second simulation device, it suspends the optical port working status verification action 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 status of the optical port of the simulation device changes, the network topology is updated in real time based on the result of the change in the working status of the optical port.

6. The network topology detection method for a simulation device according to claim 5, characterized in that: If a change in the working state of the optical port of the emulated device is detected, the network topology is updated in real time based on the result of the change in the working state of the optical port, including: If a third emulation 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 emulation device verifies the optical port working state of each fourth emulation device other than the third emulation device one by one, and determines whether to establish a local connection with the fourth emulation 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 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.

7. The network topology detection method of the simulation device according to claim 5, characterized in that: If a change in the working state of the optical port of the emulated device is detected, the network topology is updated in real time based on the result of the change in the working state of the optical port, including: If a fifth emulation device is detected whose optical port working state changes from UP to DOWN, all sixth emulation devices that currently have established local connections with the fifth emulation 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 includes: A first simulation device selection module is configured 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; The optical port working state verification module is configured 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 configured 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 configured to execute step 104: repeatedly execute steps 101 to 103 until all simulation devices have performed network topology detection as first simulation devices; 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 simulation device; 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.

9. An electronic device, characterized in that: The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the network topology detection method for a simulation device according to any one of claims 1 to 7 according to 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 for a 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