A global flow level network simulation method, system and device

Through the global streaming network simulation method, the global simulation network topology architecture is constructed and optimized the processing of streaming events, solving excessive problems and time consumption of large -scale network simulation in existing technologies, and achieved fast and accurate simulation tests.

CN114492052BActive Publication Date: 2025-01-28GUANGZHOU LANTSI TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210110770.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-29
Publication Date
2025-01-28
Estimated Expiration
2042-01-29

AI Technical Summary

Technical Problem

When existing network simulation technologies perform large-scale multi-node and multi-stream simulation, they consume too much resources and time, and it is difficult to accurately approximate the singularity of network structure and the suddenness of traffic.

Method used

The global streaming network simulation method is adopted, the global simulation network topology architecture is constructed, the streaming path is obtained, and the global refresh strategy and global control strategy are optimized to trigger and handle the streaming events to reduce the time of resource consumption and calculation.

Benefits of technology

While reducing resource consumption and calculation time, ensuring the correctness of the simulation scheme test, the simulation environment that can quickly build any simulation requirements, and improve the controllability and efficiency of the simulation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114492052B_ABST
    Figure CN114492052B_ABST
Patent Text Reader

Abstract

The present invention discloses a global flow-level network simulation method, system and device, comprising: after constructing a global simulation network topology architecture to form a simulation environment, generating simulation tasks through a task generator, dividing the simulation tasks into multiple stages, storing each stage of the simulation tasks in a global variable for global call; continuously updating the time information of flow object transmission in the global simulation network topology architecture through a global refresh strategy, determining the flow event with the shortest time for each global flow object, and after the current flow object completes the flow event, calculating the expected value of the completion time of the flow event of other flow objects through refresh; obtaining global stage information through a global control strategy, detecting whether all flow objects in a certain stage have completed the flow event, thereby predicting the end of the stage of the simulation task, and obtaining the test result of the simulation task. The network simulation scheme provided by the present invention ensures the correctness of the simulation while shortening resource consumption and computing time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of simulation technology, and in particular to a global flow level network simulation method, system and device. Background Art

[0002] The research and development of data center networks, World Wide Web communications, and wireless communication technologies rely heavily on simulation technology, including link simulation, system simulation, and network simulation. Network simulation is large-scale, usually involving tens of thousands of nodes. The existing network architecture is mainly composed of servers, switches, and links. In order to cope with the increasing traffic and increasingly complex application requirements in the future, simulation verification and analysis are often required before deploying or upgrading the real network architecture.

[0003] The inventor of the present application has found that the existing network simulation technology has the following defects:

[0004] (1) Packet-level discrete event network simulation, represented by NS3 and OMNeT++, is suitable for fine-grained simulation of hierarchical protocols. However, due to its reliance on packet-level and event-driven frameworks, it consumes too many resources and time when conducting large-scale multi-node and multi-flow simulations. Even if the distributed simulation function is turned on, it takes days or even months. Based on this, machine learning has been derived to replace the simulation of some similar network structures. For example, MimicNet (Sigcomm 2021) only allows OMNeT++ to simulate the network structure of a specified unit, and puts the network structure of the remaining units into the Mimic approximation module for calculation, thereby achieving a certain degree of speed improvement. However, this method cannot accurately approximate the singularity of the network structure and the burstiness of the traffic. At present, some methods have simplified part of the protocol stack, such as Netbench, but they are still limited by the packet level and event-driven framework.

[0005] (2) Using kernel-isolated virtualized network emulators, such as Mininet, IM∪NES, and CORE, is only suitable for small-scale simulations that can control each node in real time. However, the resources of a single machine are limited and it is impossible to simulate large-scale networks.

[0006] (3) Using simulators combined with real switches, such as TurboNet, which can virtually simulate a switch into an 8-node fat tree structure, but it still cannot perform large-scale simulation in the true sense. Summary of the invention

[0007] To solve the above problems, the embodiments of the present application provide a global flow-level network simulation method, system and device, which reduce resource consumption and computing time while ensuring the correctness of the simulation scheme test.

[0008] In a first aspect, an embodiment of the present application provides a global flow level network simulation method, including:

[0009] In response to a first target event triggered by the simulation platform, receiving a configuration file required by the simulation environment through the first target event;

[0010] Parsing the configuration file to construct a global simulation network topology architecture to form a simulation environment, so as to obtain a flow path in a flow object through the global simulation network topology architecture, thereby determining a flow event according to the flow path;

[0011] In response to a second target event triggered by the simulation platform, a global event queue scheduler is loaded through the second target event to form a task generator, a simulation task is generated through the task generator, the simulation task is divided into a plurality of stages, and each stage of the simulation task is stored in a global variable for global call; a plurality of stream objects are configured in the simulation task;

[0012] The time information of the flow object transmission in the global simulation network topology architecture is continuously updated through the global refresh strategy, and the flow path with the shortest time of each flow object in the global simulation network topology architecture is obtained. After the flow event of the current flow object is completed by using the flow path, the relative simulation time is stopped by refreshing the global simulation network topology architecture, and the flow path time of the next flow object is calculated. When the flow event of the next flow object is triggered, the relative simulation time is restored;

[0013] The global control strategy is used to obtain the stage information of the global real-time flow event progress. According to the simulation status of the global simulation network topology architecture and the task scheduling results, the flow event triggering of the next flow object is controlled to predict the end of the simulation task stage and obtain the test results of the simulation task.

[0014] Furthermore, the configuration file is provided with network topology information and graph information, and a global simulation network topology architecture required for the simulation environment is constructed through the network topology information and the graph information, and is stored for global call;

[0015] The graph information is configured with simulation nodes, link relationships between nodes, and node weights. Each simulation node is configured with a unique ID number, and each simulation node is associated with the ID numbers of other simulation nodes connected to it, which are reflected in the graph information.

[0016] Furthermore, in the global refresh strategy, the flow events that may be triggered according to the flow path in the flow information associated with each of the flow objects are analyzed, and the flow events to be activated are determined according to the expected completion time of each of the flow paths, and are marked as active. When performing a global refresh, the mark of the completed flow event is changed to inactive, and all flow events marked as active are traversed at the same time.

[0017] Furthermore, in the global control strategy, multiple stages of the simulation task are controlled in a distributed manner, and stage information of real-time flow progress is globally recorded through different communication strategies, communication objects, and the number of flow tasks.

[0018] Furthermore, the task generator uses the initialization function of the event base class to control the relative time and absolute time of the simulation process, and sets the activation state variable to be called during acceleration.

[0019] Furthermore, after the task generator generates the simulation task, the process running of the simulation task is sorted by heap sorting, and is re-sorted according to the overloaded operation logic in the event base class.

[0020] Furthermore, each simulation task derives three event subclasses acting on the stream object through the event base class: task start event, transmission event, and completion event;

[0021] Presetting simulation task parameters through the task start event, generating multiple stream objects, and receiving the modified configuration of the current simulation task while detecting whether the simulation platform triggers the second target event;

[0022] By controlling the simulation process to advance to a certain moment through the transmission event, a flow object that actually acts on the network is generated;

[0023] After executing the flow event of the flow object through the completion event, the flow object in the global simulation network topology architecture is deleted.

[0024] In a second aspect, an embodiment of the present application provides a global flow-level network simulation system, using any one of the methods described in the first aspect, including:

[0025] A file receiving module, configured to respond to a first target event triggered by the simulation platform and receive a configuration file required by the simulation environment through the first target event;

[0026] A topology construction module is configured to parse the configuration file to construct a global simulation network topology architecture to form a simulation environment, so as to obtain a flow path in a flow object through the global simulation network topology architecture, thereby determining a flow event according to the flow path;

[0027] A task configuration module is configured to respond to a second target event triggered by the simulation platform, load a global event queue scheduler through the second target event, form a task generator, generate a simulation task through the task generator, divide the simulation task into multiple stages, and store each stage of the simulation task in a global variable for global call; a plurality of stream objects are configured in the simulation task;

[0028] A global refresh module is configured to continuously update the time information of the flow object transmission in the global simulation network topology architecture through a global refresh strategy, obtain the flow path with the shortest time for each flow object in the global simulation network topology architecture, complete the flow event of the current flow object by using the flow path, refresh the global simulation network topology architecture to stop the relative simulation time, calculate the flow path time of the next flow object, and restore the relative simulation time when the flow event of the next flow object is triggered;

[0029] The global control module is configured to obtain the stage information of the global real-time flow event progress through the global control strategy, and control the triggering of the flow event of the next flow object according to the simulation state of the global simulation network topology architecture and the task scheduling results, so as to predict the end of the stage of the simulation task and obtain the test results of the simulation task.

[0030] In a third aspect, an embodiment of the present application provides a global flow level network simulation device, which is configured with the global flow level network simulation system described in the second aspect.

[0031] In a fourth aspect, an embodiment of the present application provides an electronic device, including:

[0032] one or more processors;

[0033] A memory for storing one or more programs;

[0034] When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement any one of the first methods.

[0035] In a fifth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method described in any one of the first aspects is implemented.

[0036] The technical solution provided in the embodiments of the present application has at least the following technical effects:

[0037] 1. Since the simulation platform is built in advance, the configuration files of the simulation requirements are received on the simulation platform, so as to construct a global simulation network topology architecture that meets the requirements. It can be known that the simulation platform can be used to build a simulation environment for any simulation requirements, and the simulation platform has the beneficial effect of simulation versatility.

[0038] 2. Since a flow-level simulation environment is adopted, users only need to configure the simulation task and obtain the flow objects in the simulation task. Each simulation task is completed through flow events triggered by several flow objects. Therefore, the entire simulation process can be controlled by controlling the flow events, thereby limiting the reliability of the simulation task.

[0039] 3. Since the triggering start and completion of the flow event are determined by the global refresh strategy, this scheme does not need to consider all the flow events that may occur in all the flow objects of the simulation task. The expected value of the possible completion time of the flow event associated with the flow path is used. In order to speed up the simulation operation, this scheme determines the flow path with the shortest completion time through the flow event, thereby determining the flow event to be activated. Before determining the flow event, the flow event is first pushed into the right event queue, and the global refresh is triggered according to the completion of the previous flow event. Then the next flow event triggers the start event. It can be seen that the event-driven simulation system needs to maintain a unique global event queue globally, and control the occurrence and end of all flow events according to the global event queue. At the same time, the occurrence of flow events also advances the global simulation time (relative simulation time), thereby ensuring the controllability of the simulation time. Refresh operations are used to continuously add and delete events to continuously update flow information.

[0040] 4. Since an activation flag variable is added to the stream event associated with the stream object, only the stream events with active marks need to be traversed during global refresh. After the corresponding stream event is activated, the occurrence and completion of the stream event are controlled, which effectively reduces the number of event traversal and modification times.

[0041] 5. The method first analyzes the flow events that may be triggered by the flow objects according to the flow paths, and then determines a flow path for these flow events using the expected values ​​of the completion time required for each flow path, thereby determining the flow events associated with the flow objects. That is to say, after a global refresh, the remaining flow size of the flow object and the calculated completion time (expected value) variable are obtained, thereby reducing some unnecessary calculations of the completion time of the flow events, so as to achieve real-time updates when new flow events are generated and old flow events are completed to ensure the effectiveness and timeliness of flow transmission during the simulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is a flow chart of the global flow level network simulation method in Embodiment 1 of the present application;

[0043] Figure 2 This is a global flow level network simulation framework diagram in Example 1 of the present application;

[0044] Figure 3 This is a module diagram of the global flow-level network simulation system in Example 2 of the present application. DETAILED DESCRIPTION

[0045] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0046] Embodiment 1

[0047] Reference Figure 1-2 As shown, the embodiment of the present application provides a global flow level network simulation method, including:

[0048] Step S101 , in response to a first target event triggered by a simulation platform, receiving a configuration file required by a simulation environment through the first target event.

[0049] The simulation platform in this embodiment can be understood as an underlying simulation framework. The configuration files required for the simulation environment are obtained through visual interface operations. Operators do not need to have advanced technical backgrounds, but only need to have the operating skills of the visual interface. This reduces the development workload for users with a wide range of simulation needs. The simulation platform provided by this embodiment can be used to configure any simulation environment, greatly reducing a large amount of development resources and time. In addition, the technical solution provided in this application has undergone countless practical verifications and can achieve ultra-fast network simulation speed effects. It can also provide certain technical references for the rapid development of subsequent related fields.

[0050] Further explanation, the simulation platform in this embodiment adopts the underlying logic framework written in Python language, which can distinguish between absolute simulation time and relative simulation time. Among them, absolute simulation time can be understood as real time, and relative simulation time can be understood as the relevant process time required in the simulation environment, and in the simulation environment, when the time variable is needed in the execution process calculation, the relative simulation time is used, and when the time variable is not considered, it is understood as the relevant process of the simulation environment, and the corresponding action is performed in the static relative simulation time.

[0051] Step S102, parsing the configuration file to construct a global simulation network topology architecture to form a simulation environment, so as to obtain a flow path in a flow object through the global simulation network topology architecture, thereby determining a flow event according to the flow path.

[0052] The configuration file in this embodiment is provided with network topology information and graph information, and the global simulation network topology architecture required for the simulation environment is constructed through the network topology information and the graph information, and stored for global call; wherein the graph information is configured with simulation nodes, link relationships between nodes, and node weights, each of the simulation nodes is configured with a unique ID number, and each of the simulation nodes is associated with the ID numbers of other simulation nodes connected to it, and reflected in the graph information. In this embodiment, the real-time link occupancy of the network is obtained through the node weight; the actual flow information of the network is stored in real time through the network topology information.

[0053] The global simulation network topology architecture includes several simulation nodes, each of which can be a server, an electric / optical switch, that is, a large-scale simulation network required by a server, an electric switch or an optical switch. Existing large-scale networks can have static Al clusters, optoelectronic hybrid Al clusters, or other custom network clusters composed of pure electric switches. A global simulation network topology architecture is constructed based on a pre-configured simulation platform, and the global simulation network topology architecture diagram is displayed to the operator through a visual interface. Further explanation, all simulation nodes can be considered as devices in the simulation environment, and all code information given in this embodiment can be understood as the underlying simulation framework of the Python language. In the configuration file, device.py is used to represent all simulation nodes in the network, whether it is a server or a switch, it represents a simulation node, and each simulation node is configured with a unique ID number as an identification number, and each simulation node stores the numbers of other simulation nodes connected to it, and is reflected in the graph information.

[0054] Further explanation, based on the underlying simulation framework written in Python, the configuration file in this embodiment represents the network topology information through infra_base.py, represents the graph information through graph.py, and constructs the physical network topology architecture in the simulation environment through infra_base.py and graph.py, and stores the constructed global simulation network topology architecture in the simulator Simulator for global call. Among them, the simulator Simulator is used to create a simulation environment containing the variables and configurations of the application in the real environment. The software environment created by the simulator Simulator in this embodiment is also the simulation environment mentioned in this embodiment. By storing the global simulation network topology architecture in the simulator Simulator, the simulator Simulator is run. When the judgment result that the execution result during the simulation interaction is consistent with the expected result is obtained, it is the final requirement of the simulation test. It does not need to consider the underlying hardware configuration. Only one terminal host or terminal server is needed to complete the simulation test, which greatly reduces the operating cost of the simulation environment.

[0055] In the graph information in this embodiment, vertex is used to represent the simulation node in the global simulation network topology architecture, such as a vertex in a geometric shape; edge is used to represent the link relationship between nodes, that is, the line or edge between the simulation nodes, and the node weight is represented by the number of topological connections between the simulation nodes. In the graph information, the real-time link occupancy of the network can be calculated by the node weight, and the network topology information in this embodiment stores the actual flow information of the network in real time.

[0056] The global simulation network topology architecture in this embodiment is used to transmit flow objects. Since the flow object has a predetermined transmission start point and end point, several flow paths for the transmission flow object can be generated. In this embodiment, the simulation process uses a serial method to execute the transmission actions of each flow object in the task. Considering that the simulation purpose in this embodiment is the speed requirement, this embodiment determines the start of the subsequent transmission action by finding a flow path with the shortest time, which is a flow event. It can be seen that this embodiment determines the flow path by the length of time taken for traffic transmission, triggers the flow event of the transmission flow object, and after determining the flow path, executes the flow start event of the current flow object, and executes the flow completion event after the flow object reaches the end point.

[0057] Further explanation, the flow object can be defined as a directed transmission object, that is, the global simulation network topology architecture in this embodiment gives a directed graph, the size / dimension of the flow object is represented by the flow, and the process of executing the flow object transmission from the start to the completion of the flow event. In this embodiment, the transmission object defined between the simulation nodes is a flow object, and its associated flow information includes a determined starting point (source point) and an end point. The action that triggers the flow object to start transmission is called a flow start event, and the action of the flow object from the starting point to the end point is called a flow completion event. In this embodiment, the time taken by the current flow object is obtained by the time from the flow start event to the flow completion event.

[0058] Further explanation, the relevant information in the flow object is called flow information, and the flow information includes the starting point, terminal, flow size (flow), flow path (routing information in the global simulation network topology architecture) and flow time (the time when the flow event is completed in the flow path). A flow start event is generated in the action of controlling the triggering flow object to transmit. Before the flow start event is generated, the time consumed is not considered until the previous flow object completes the flow completion event, which is equivalent to setting the relative simulation time to a static state. During the static time period of the simulation time, all flow paths of the current flow object in the global simulation network topology architecture are obtained. If the time requirement is not considered, then several flow events can be formed according to several flow paths in the network topology diagram. However, in this embodiment, in order to achieve ultra-fast flow-level network simulation, preferably, a flow path with the shortest time is selected to execute the flow event of the current flow object.

[0059] Further explanation, in the flow path of the obtained flow object, all the shortest paths between the nodes of the entire network are provided by routing / ecmp / bfs_ecmp_routing_static.py. Since each simulation node in the global network is configured with a unique ID number, the connection relationship between the simulation nodes can be expressed by a 3-tuple [src, dst, number of connections]. Since the global simulation network topology is stored in the simulator's Simulator.infra_base, it can be obtained by Simulator.get_infrastructure(). In this embodiment, when the global refresh strategy is executed, all the shortest paths between all simulation nodes are called. According to this method, the path of the corresponding requirement can be selected according to different configuration requirements. However, when the network scale is too large, the global search for all the shortest paths between all simulation nodes may take too long. In this embodiment, the optimization method of combining the breadth-first search algorithm is further described.

[0060] Step S103, in response to a second target event triggered by the simulation platform, load the global event queue scheduler through the second target event to form a task generator, generate a simulation task through the task generator, divide the simulation task into multiple stages, and store each stage of the simulation task in a global variable for global call; a number of stream object sequences are configured in the simulation task, and the stream objects are executed in sequence order.

[0061] Among them, based on the underlying simulation framework written in Python language, the task generator in this embodiment can be represented by task generator.py, and the corresponding communication strategy is selected according to the simulation configuration requirements. For example, a variety of communication algorithms including butterfly optimization algorithm, ring algorithm, and all-to-all algorithm are configured in the communication strategy file to design and generate corresponding multiple flow objects. In this embodiment, new communication strategies can be added based on the underlying simulation framework rules of the simulation platform.

[0062] Several flow objects can be configured based on each simulation task, and each flow object is associated with corresponding flow information. The flow information may include the id number of the source simulation node, the id number of the destination simulation node, the start time of the flow event, the real-time remaining flow size after the flow event is triggered, the simulation task to which the current flow event belongs, the stage information to which the current flow event belongs, the expected completion time of the flow event, the flow path of the flow event, the actual completion time of the flow event, etc. In particular, considering that in order to speed up the running speed of the simulation process in this embodiment, all possible shortest path information between simulation nodes is called, but in different simulation requirements, different flow paths can be selected according to requirements, such as static routing and ECMP routing under a pure point-to-point network architecture, and congestion-free routing under an optoelectronic hybrid network architecture.

[0063] In this embodiment, loading the global event queue scheduler can be understood as the operator setting the simulation task in advance through the visual interface (window). Of course, the simulation task can also be set in the configuration file for building the simulation environment. This embodiment does not limit this. The global event queue scheduler in this embodiment uses the relevant scheduling algorithm to determine the task that needs to be executed at present. It can first obtain all simulation tasks, and then suspend the simulation task. If a simulation task is to be executed, it is activated by selecting a simulation task in the ready state and then executing the simulation task. Further explanation, when loading the global event queue scheduler, it is necessary to determine whether the new simulation task can be executed now based on the network status of the current global simulation network topology and the new simulation task, and return the current scheduling information to the main framework. When executing the global control strategy, the scheduling information is used to make corresponding judgments. For example, locality affinity scheduling under a pure electric network and congestion-free scheduling under an optoelectronic hybrid network. The simulation platform in this embodiment is based on the underlying simulation framework. Under the premise of following the main event-driven rules, new scheduling strategies can be added.

[0064] In this embodiment, after loading the global event queue scheduler, a task generator is formed, and a task start event is generated. After the task generator in this embodiment generates a simulation task, the process operation of the simulation task is sorted by heap sorting, and reordered according to the overloaded operation logic in the event base class.

[0065] In this embodiment, each simulation task is derived from the event base class to have three event subclasses acting on the flow object: task start event, transmission event, and completion event. The simulation task parameters are preset through the task start event to generate multiple flow objects. While detecting whether the simulation platform triggers the second target event, the modified configuration of the current simulation task is received. The simulation process is controlled to advance to a certain moment through the transmission event, and a flow object that truly acts on the network is generated. After the flow event of the flow object is executed through the completion event, this flow object in the global simulation network topology architecture is deleted.

[0066] Further explanation, based on the underlying simulation framework written in Python language, the event base class is represented by Event, and three event subclasses are derived: Task start event, Transmit event, and Completion event. The three event subclasses each have their own responsibilities, but are closely connected with the global refresh strategy and the global control strategy, following the design concept of high cohesion and low coupling. In the task start event, the rapidnetsim / core / event / task_start_event.py in the code TaskStartEvent class indicates that according to the preset simulation task parameters, multiple stream objects are generated, and while detecting whether the simulation platform triggers the second target event, the modified configuration of the current simulation task is received, so as to achieve the ability of flexible and dynamic adjustment. Among them, detecting whether the simulation platform triggers the second target event can be understood as detecting whether a new simulation task is added to the current task queue. Receiving the modified configuration of the current simulation task can be understood as receiving the type of modified task in the configuration file. Therefore, it can be seen that the placement of obtaining the simulation task given in this embodiment is to obtain the configuration file. It can be obtained when executing the simulation task after the simulation environment is built, or it can be pre-set in the configuration file of the pre-built simulation environment. In the transmission event Transmitevent, the code rapidnetsim / corel / eVent / flow_transmit_eventpy in the Flow Transmit Event class indicates that its purpose is to generate a flow entity that actually acts on the network when the relative simulation time advances to a certain moment. In the completion event Completion event, the code rapid net sim / corelevent / flow completion event.py in the Flow Completion Event class indicates that after obtaining the flow event determined by the flow object according to the global refresh strategy and controlling the flow event of the completion flow object according to the global control strategy, the flow object in the global simulation network topology architecture is deleted.

[0067] Step S104, continuously update the time information of the flow object transmission in the global simulation network topology architecture through the global refresh strategy, obtain the flow path with the shortest time for each flow object in the global simulation network topology architecture, and after using the flow path to complete the flow event of the current flow object, refresh the global simulation network topology architecture to stop the relative simulation time, calculate the flow path time of the next flow object, and restore the relative simulation time when the flow event of the next flow object is triggered.

[0068] In the global refresh strategy described in this embodiment, the flow events that may be triggered according to the flow path in the flow information associated with each of the flow objects are analyzed, and the flow events to be activated are determined according to the expected completion time of each of the flow paths, and are marked as active. When performing a global refresh, the mark of the completed flow event is changed to inactive, and all flow events marked as active are traversed at the same time.

[0069] Further explanation, based on the underlying simulation framework written in Python, the global refresh strategy is represented by rapidnetsim / core / network_refresh.py in the code Refresh flow info. In the process of the main thread of the simulation environment looping to execute the flow event of the simulation task, the flow information of the entire network is continuously refreshed, and the flow object that needs to be completed earliest is detected and updated. In the process of looping the flow event of the simulation task in this embodiment, each flow event represents a different flow object. Since several flow objects can be configured in the simulation task, it is necessary to understand the flow information in the current network when controlling the flow object transmission to trigger the flow event. In this embodiment, the code refresh completion event() is used to detect and obtain the earliest completed flow information, and the global record flag is refreshed. The earliest completed flow information can be understood as the flow object in the simulation task in the normal current network, and the transmission time of each flow object is obtained. When the time is the shortest, the earliest completed flow path can be determined. In this embodiment, the code calculate and modify finish_time() is used to indicate that the time required to complete the execution flow event is calculated according to the flow size of the next flow object, so as to calculate and obtain the flow event with the shortest time for each global flow object.

[0070] Further explanation, the task generator in this embodiment uses the initialization function of the event base class to control the relative time and absolute time of the simulation process, and sets the activation state variable for acceleration. It can be understood that the life cycle of the task generator is equivalent to the life cycle of the simulation program executed by the currently acquired simulation task, starting from the first simulation task generated by the task generator, and triggering the execution of the first stream event, to the completion of all simulation tasks and their stream events, or directly receiving the relevant simulation end instruction to end the simulation program. It can be seen that this process is equivalent to the brain and heart of the simulation process, constantly updating the stream event, and then executing the stream event. In this embodiment, the constructed global simulation network topology architecture is stored in the main core Simulator.py of the simulator, that is, the main core stores the basic configuration information of the simulation environment, the global simulation network topology architecture, the scheduling new, the log information and other global call information, and maintains this global simulation time, that is, the relative simulation time. In this embodiment, the code core_run is used to control the time relationship with the Event event. The relationship between the relative simulation time and the absolute time of the simulator is controlled by the initialization function of the Event event class, and the activation state variable is set to provide it for program acceleration. When heap sorting is performed through core_run, it will be reordered according to the overloaded _It_ operation logic in the Event base class.

[0071] In this embodiment, the flow information associated with each flow object can trigger different flow events according to the flow path, and each possible flow event is configured with an active state mark and a dynamically changing expected completion time value (since the expected completion time value is a dynamic variable, -1 can be set to indicate that the expected completion time value has not been calculated yet). It can be seen that in the main event-driven logic of the simulation process, each flow path of the flow object is obtained in advance, and the transmission time of the flow object on the flow path is calculated. In this embodiment, the flow path with the shortest time for the flow object is selected, and the associated flow event is configured as an active state. Therefore, the flow event required by the flow object can be determined. When the global event queue scheduler is used to perform flow event scheduling again, the flow event marked as inactive in the flow object can be directly skipped, thereby eliminating the need to screen the flow event again and avoiding repetitive errors.

[0072] In this embodiment, when the global simulation network topology architecture is refreshed, it can be understood as traversing all possible flow events recorded globally (each flow path may trigger a flow event). Before calculating the expected value of the flow event completion time based on the flow path, it is detected whether the flow path in the flow object has calculated the expected value of the flow event completion time. If not, it is calculated first and then updated to the associated information of the flow path corresponding to the flow information associated with the flow object. Therefore, it can be known that the flow events with active marks in the current flow object are determined according to the flow path and the expected value of the flow event completion time. Therefore, it is only necessary to traverse the flow events associated with the flow path with active marks, thereby saving the resources and time consumption generated by traversing the path in calculating the completion time. After traversing the expected completion time of all actively marked flow events, since the flow events before the refresh have been completed, the actively marked flow events in the flow information of the global minimum expected completion value recorded in the previous refresh record are set to inactive, and the flow events in the flow information of the minimum expected completion time in the current flow event are recorded globally and added to the global event-driven queue to ensure that there is only one executable flow completion event in the global event-driven queue, so as to achieve the correctness of the simulation process while reducing resource consumption and computing time, thereby achieving the optimization of global drive and network refresh.

[0073] Step S105, obtain the stage information of the global real-time flow event progress through the global control strategy, and control the triggering of the flow event of the next flow object according to the simulation status of the global simulation network topology architecture and the task scheduling result, so as to predict the end of the stage of the simulation task and obtain the test result of the simulation task.

[0074] In the global control strategy, multiple stages of the simulation task are controlled in a distributed manner, and stage information of real-time flow progress is globally recorded through different communication strategies, communication objects, and the number of flow tasks.

[0075] Based on the underlying simulation framework written in Python, the global control strategy is represented by rapidnetsim / core / stage_controller.py in the code Stagecontroller, which effectively controls multiple stages of distributed simulation tasks. Since different communication strategies will generate different rounds, different communication objects, and different numbers of flow tasks, this embodiment globally records the stage information of real-time flow progress, and combines the network occupancy status and GP∪ allocation status in the stage control module, as well as the scheduling results of the scheduler, to comprehensively control the new flow objects to be generated in the next stage and accurately judge the end of the stage, and the running results of each simulation task, such as the network status of the simulation environment after the simulation task ends.

[0076] Compared with the existing packet-level simulation process, the refresh number of flow events in this embodiment is reduced (the flow path is pre-selected and then the flow event is determined in this embodiment), so as to reduce the global event queue. In particular, for the flow objects generated by the distributed training tasks involving tens of thousands of nodes, expensive computing resources and time are still required for processing. By dividing the simulation task into multiple stages, the flow events triggered by the flow objects in each stage are configured with the expected completion time value and the active status mark. In this embodiment, it is only necessary to pre-mark the possible flow events as active according to the expected completion time value, and traverse all the flow events with active marks filtered out, so as to greatly reduce the number of traversals and computing overhead of global network refresh.

[0077] When the network scale in the global simulation network topology is large, it will take a long time to globally search for all shortest paths. In this embodiment, the shortest path is used to optimize the search time.

[0078] Each simulation node in the global simulation network topology is configured with a unique ID number. The connection relationship between simulation nodes is represented by a triple. The network topology is stored in Simulator._infra_base and obtained through Simulator.get_infrastructure(). Based on the directedness of the global simulation network topology, the shortest step matrix is ​​calculated using the idea of ​​breadth-first search before searching for the shortest path. The rows represent the ID number of the starting simulation node, and the columns represent the ID number of the destination simulation node. Each element of the shortest step matrix is ​​initialized to infinity. A breadth-first search is performed on each simulation node to update the shortest step matrix. In the breadth-first search concept, a simulation node is pushed into the BFS queue from a certain starting point. The number of layers is recorded first, and a current simulation node is pushed out and recorded as a temporary simulation node. At the same time, the nodes that have been visited are recorded, and other simulation nodes connected to the current simulation node are traversed. If they have not been visited, the element values ​​of the temporary simulation node corresponding to the current simulation node and other connected simulation nodes in the shortest step matrix are set to 1, and the element values ​​of the shortest step matrix from the current simulation node to other connected nodes are set to the number of layers + 1, and other connected simulation nodes and the number of layers + 1 are pushed into the BFS queue. The operation is repeated until the BFS queue is empty.

[0079] As can be seen from steps S101-S105, the event-driven simulation system in this embodiment needs to maintain a unique global event queue in the global world, and control the occurrence and end of all flow events according to the global event queue. At the same time, the occurrence of flow events also advances the global simulation time (relative simulation time), thereby ensuring the controllability of simulation time. By using the refresh operation, events are continuously added and deleted to continuously update flow information. If this queue is traversed directly, it will bring high resource and time overhead. The existing development ideas use parallel mode, multi-threaded mode or multi-instance acceleration mode, but they cannot solve the problem of long simulation time. Considering the need to accelerate the simulation process, in this embodiment, the flow events that may be triggered by the flow object are first analyzed according to the flow path, and then a flow path is determined for these flow events using the expected value of the completion time required for each flow path, thereby determining the flow event associated with the flow object. That is to say, after the global refresh, the remaining flow size of the flow object and the calculated completion time (expected value) variable are obtained to reduce the calculation of a part of the unnecessary flow event completion time, so as to achieve real-time updates when new flow events are generated and old flow events are completed to ensure the effectiveness and timeliness of flow transmission during the simulation process. At the same time, in this embodiment, an activation flag variable is added to the flow event associated with the flow object. During the global refresh, only the flow events with active marks need to be traversed. After the corresponding flow event is activated, the occurrence and completion processing of the flow event are controlled, which effectively reduces the number of event traversal and modification.

[0080] Embodiment 2

[0081] Reference Figure 3 As shown, the embodiment of the present application provides a global flow level network simulation system, using any one of the methods described in Embodiment 1, including:

[0082] The file receiving module 101 is configured to respond to a first target event triggered by the simulation platform and receive a configuration file required by the simulation environment through the first target event.

[0083] The topology construction module 102 is configured to parse the configuration file to construct a global simulation network topology architecture to form a simulation environment, so as to obtain the flow path in the flow object through the global simulation network topology architecture, thereby determining the flow event according to the flow path.

[0084] The task configuration module 103 is configured to respond to a second target event triggered by the simulation platform, load the global event queue scheduler through the second target event, form a task generator, generate a simulation task through the task generator, divide the simulation task into multiple stages, and store each stage of the simulation task in a global variable for global call; a number of stream objects are configured in the simulation task.

[0085] The global refresh module 104 is configured to continuously update the time information of the flow object transmission in the global simulation network topology architecture through the global refresh strategy, obtain the flow path with the shortest time for each flow object in the global simulation network topology architecture, and after completing the flow event of the current flow object using the flow path, refresh the global simulation network topology architecture to stop the relative simulation time, calculate the flow path of the next flow object, and restore the relative simulation time when the flow event of the next flow object is triggered.

[0086] The global control module 105 is configured to obtain the stage information of the global real-time flow event progress through the global control strategy, and control the triggering of the flow event of the next flow object according to the simulation state of the global simulation network topology architecture and the task scheduling result, so as to predict the end of the stage of the simulation task and obtain the test result of the simulation task.

[0087] Embodiment 3

[0088] The embodiment of the present application provides a global flow level network simulation device, which is configured with the global flow level network simulation system described in claim 11. The device in this embodiment can be a server or terminal device with simulation services.

[0089] Embodiment 4

[0090] An embodiment of the present application provides an electronic device, including:

[0091] one or more processors;

[0092] A memory for storing one or more programs;

[0093] When the one or more programs are executed by the one or more processors, the one or more processors implement any method described in Embodiment 1.

[0094] The embodiment of the present application also provides a computer-readable medium on which a computer program is stored. When the computer program is executed by a processor, any method described in the first embodiment is implemented.

[0095] Step S101, in response to a first target event triggered by a simulation platform, receiving a configuration file required for a simulation environment through the first target event; Step S101, parsing the configuration file to construct a global simulation network topology architecture to form a simulation environment, so as to obtain a flow path in a flow object through the global simulation network topology architecture, thereby determining a flow event according to the flow path; Step S101, in response to a second target event triggered by a simulation platform, loading a global event queue scheduler through the second target event to form a task generator, generating a simulation task through the task generator, dividing the simulation task into a plurality of stages, and storing each stage of the simulation task in a global variable for global call; a plurality of flow objects are configured in the simulation task; Step S101, continuously update the time information of the flow object transmission in the global simulation network topology architecture through the global refresh strategy, obtain the flow path with the shortest time for each flow object in the global simulation network topology architecture, and after completing the flow event of the current flow object using the flow path, refresh the global simulation network topology architecture to stop the relative simulation time, calculate the flow path of the next flow object, and restore the relative simulation time when the flow event of the next flow object is triggered; Step S101, obtain the stage information of the global real-time flow event progress through the global control strategy, control the triggering of the flow event of the next flow object according to the simulation state of the global simulation network topology architecture and the task scheduling result, so as to predict the end of the stage of the simulation task and obtain the test result of the simulation task.

[0096] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0097] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0098] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0099] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0100] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0101] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A global flow level network simulation method, characterized in that: include: In response to a first target event triggered by the simulation platform, receiving a configuration file required by the simulation environment through the first target event; Parsing the configuration file to construct a global simulation network topology architecture to form a simulation environment, so as to obtain a flow path in a flow object through the global simulation network topology architecture, thereby determining a flow event according to the flow path; In response to a second target event triggered by the simulation platform, a global event queue scheduler is loaded through the second target event to form a task generator, a simulation task is generated through the task generator, the simulation task is divided into a plurality of stages, and each stage of the simulation task is stored in a global variable for global call; a plurality of stream objects are configured in the simulation task; The time information of the flow object transmission in the global simulation network topology architecture is continuously updated through the global refresh strategy, and the flow path with the shortest time of each flow object in the global simulation network topology architecture is obtained. After the flow event of the current flow object is completed by using the flow path, the relative simulation time is stopped by refreshing the global simulation network topology architecture, and the flow path time of the next flow object is calculated. When the flow event of the next flow object is triggered, the relative simulation time is restored; The global control strategy is used to obtain the stage information of the global real-time flow event progress. According to the simulation status of the global simulation network topology and the task scheduling results, the flow event triggering of the next flow object is controlled to predict the end of the simulation task stage and obtain the test results of the simulation task. In the global refresh strategy, the flow events that may be triggered according to the flow path in the flow information associated with each of the flow objects are analyzed, and the flow events to be activated are determined according to the expected completion time values ​​of each of the flow paths, and are marked as active. When performing a global refresh, the mark of the completed flow event is changed to inactive, and all flow events marked as active are traversed at the same time; In the global control strategy, multiple stages of the simulation task are controlled in a distributed manner, and stage information of real-time flow progress is globally recorded through different communication strategies, communication objects, and the number of flow tasks.

2. The global flow level network simulation method according to claim 1, characterized in that: The configuration file is provided with network topology information and graph information, and a global simulation network topology architecture required for the simulation environment is constructed through the network topology information and the graph information, and is stored for global call; The graph information is configured with simulation nodes, link relationships between nodes, and node weights. Each simulation node is configured with a unique ID number, and each simulation node is associated with the ID numbers of other simulation nodes connected to it, which are reflected in the graph information.

3. The global flow level network simulation method according to claim 1, characterized in that: The task generator uses the initialization function of the event base class to control the relative time and absolute time of the simulation process, and sets the activation state variable to be called during acceleration.

4. The global flow level network simulation method according to claim 1, characterized in that: After the task generator generates the simulation task, the process running of the simulation task is sorted by heap sorting, and is re-sorted according to the overloaded operation logic in the event base class.

5. The global flow level network simulation method according to claim 3, characterized in that: Each simulation task derives three event subclasses acting on the stream object through the event base class: task start event, transmission event, and completion event; Presetting simulation task parameters through the task start event, generating multiple stream objects, and receiving the modified configuration of the current simulation task while detecting whether the simulation platform triggers the second target event; By controlling the simulation process to advance to a certain moment through the transmission event, a flow object that actually acts on the network is generated; After executing the flow event of the flow object through the completion event, the flow object in the global simulation network topology architecture is deleted.

6. A global flow-level network simulation system, using the method according to any one of claims 1 to 5, characterized in that: include: A file receiving module, configured to respond to a first target event triggered by the simulation platform and receive a configuration file required by the simulation environment through the first target event; A topology construction module is configured to parse the configuration file to construct a global simulation network topology architecture to form a simulation environment, so as to obtain a flow path in a flow object through the global simulation network topology architecture, thereby determining a flow event according to the flow path; A task configuration module is configured to respond to a second target event triggered by the simulation platform, load a global event queue scheduler through the second target event, form a task generator, generate a simulation task through the task generator, divide the simulation task into multiple stages, and store each stage of the simulation task in a global variable for global call; a plurality of stream objects are configured in the simulation task; A global refresh module is configured to continuously update the time information of the flow object transmission in the global simulation network topology architecture through a global refresh strategy, obtain the flow path with the shortest time for each flow object in the global simulation network topology architecture, complete the flow event of the current flow object by using the flow path, refresh the global simulation network topology architecture to stop the relative simulation time, calculate the flow path time of the next flow object, and restore the relative simulation time when the flow event of the next flow object is triggered; The global control module is configured to obtain the stage information of the global real-time flow event progress through the global control strategy, and control the triggering of the flow event of the next flow object according to the simulation state of the global simulation network topology architecture and the task scheduling results, so as to predict the end of the stage of the simulation task and obtain the test results of the simulation task.

7. A global flow level network simulation device, characterized in that: The invention is provided with the global flow level network simulation system as claimed in claim 6.

8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5.

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

Citation Information

Patent Citations

  • C-RAN system simulation platform

    CN104053179A

  • Network simulation topology construction method and system applied to cyber range

    CN109802852A