Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a communication simulation interrupt control method and a communication simulation interrupt control system.
The invention provides a communication simulation interrupt control method, which comprises the following steps:
step S1: carrying out initial parameter configuration on the simulation model and storing the simulation model in a simulation kernel;
step S2: the simulation kernel builds an initial simulation parameter system according to the parameter setting of the simulation and the structure of the simulation model;
step S3: initializing a simulation program by the simulation model;
step S4: in the simulation process, parameter values stored in the simulation kernel are modified, the modified parameters are transmitted into the simulation program, and corresponding program operation is executed in real time according to the modified values, so that the interaction between the parameters and the simulation program is realized.
Preferably, the step S1 adopts: the initial parameter configuration of the simulation model is carried out by GUI configuration, background batch configuration and/or actual measurement parameter import.
Preferably, the step S3 adopts: the initialization process of the simulation program of the simulation model is a multi-turn bidirectional process; the bidirectional process comprises the following steps: the simulation model obtains parameter values from the parameter configuration system to modify the simulation kernel data and modifies the values in the simulation kernel through the simulation program so as to change the parameters of the simulation model.
Preferably, the step S3 adopts:
step S3.1: the simulation program sets the initialization round required by the simulation model;
step S3.2: the simulation program carries out self simulation initial operation and determines parameters needing to be read or modified;
step S3.3: calling a parameter acquisition interface provided by a simulation kernel by a simulation program, and reading a specified parameter value; or calling a parameter modification interface provided by the simulation kernel to modify the specific parameter.
Preferably, the step S4 adopts: in the simulation process, parameter values stored in the simulation kernel are modified, the modified parameters are transmitted into the simulation program through an asynchronous mechanism and/or a synchronous mechanism, and corresponding program operation is executed in real time according to the modified values, so that the interaction between the parameters and the simulation program is realized.
Preferably, the asynchronous mechanism employs: and modifying the parameter values stored in the simulation kernel, and updating the parameters when the simulation program runs after the parameters are modified.
Preferably, the synchronization mechanism employs: and modifying the parameter values stored in the simulation kernel, sending a signal to the simulation program associated with the currently modified parameters by the simulation kernel, carrying out parameter modification notification, and immediately updating the parameter values cached by the simulation program after the simulation program receives the signal.
Preferably, in the simulation process, a dynamic add-delete functional entity command is transmitted to the simulation kernel, and the add-delete operation of the functional entity is performed based on a dynamic parameter modification mechanism;
the add/delete function entity command comprises: link addition, link deletion, node or network addition, and node or network deletion;
after the nodes or the network are established, adding a connection relation; and after the node or the network is deleted, deleting the connection relation between the current node or the network and the surrounding nodes.
The invention provides a communication simulation interrupt control system, which comprises:
module M1: carrying out initial parameter configuration on the simulation model and storing the simulation model in a simulation kernel;
module M2: the simulation kernel builds an initial simulation parameter system according to the parameter setting of the simulation and the structure of the simulation model;
module M3: initializing a simulation program by the simulation model;
module M4: in the simulation process, parameter values stored in the simulation kernel are modified, the modified parameters are transmitted into the simulation program, and corresponding program operation is executed in real time according to the modified values, so that the interaction between the parameters and the simulation program is realized.
Preferably, the module M1 employs: initial parameter configuration of the simulation model is carried out through GUI configuration, background batch configuration and/or actual measurement parameter import;
the module M3 employs: the initialization process of the simulation program of the simulation model is a multi-turn bidirectional process; the bidirectional process comprises the following steps: the simulation model acquires parameter values from a parameter configuration system to modify the simulation kernel data and modifies the values in the simulation kernel through a simulation program so as to change the parameters of the simulation model;
the module M4 employs: in the simulation process, parameter values stored in the simulation kernel are modified, the modified parameters are transmitted into the simulation program through an asynchronous mechanism and/or a synchronous mechanism, and corresponding program operation is executed in real time according to the modified values, so that the interaction between the parameters and the simulation program is realized.
Compared with the prior art, the invention has the following beneficial effects:
1. the VRNET realizes the control of the communication simulation interruption, makes up the defects of the current common software in the field, and supports two dynamic parameter modification mechanisms of the communication simulation interruption: the asynchronous mechanism and the synchronous mechanism facilitate a simulation user to observe real-time changes of simulation parameters during running and modify the simulation parameters in real time;
2. when a user observes an abnormal condition in the simulation operation, the simulation can be suspended, and after the simulation parameters are modified in real time, the simulation observation is continued;
3. the invention further realizes the dynamic creation and deletion of the functional entity on the basis of a dynamic parameter modification mechanism, and meets the modification requirement of a user on the simulation entity.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
Example 1
The invention provides a communication simulation interrupt control method, which comprises the following steps:
step S1: carrying out initial parameter configuration on the simulation model and storing the simulation model in a simulation kernel;
step S2: the simulation kernel builds an initial simulation parameter system according to the parameter setting of the simulation and the structure of the simulation model;
step S3: initializing a simulation program by the simulation model;
step S4: in the simulation process, parameter values stored in the simulation kernel are modified, the modified parameters are transmitted into the simulation program, and corresponding program operation is executed in real time according to the modified values, so that the interaction between the parameters and the simulation program is realized.
Specifically, the step S1 employs: the initial parameter configuration of the simulation model is carried out by GUI configuration, background batch configuration and/or actual measurement parameter import.
Specifically, the step S3 employs: the initialization process of the simulation program of the simulation model is a multi-turn bidirectional process; the bidirectional process comprises the following steps: the simulation model obtains parameter values from the parameter configuration system to modify the simulation kernel data and modifies the values in the simulation kernel through the simulation program so as to change the parameters of the simulation model.
Specifically, the step S3 employs:
step S3.1: the simulation program sets the initialization round required by the simulation model;
step S3.2: the simulation program carries out self simulation initial operation and determines parameters needing to be read or modified;
step S3.3: calling a parameter acquisition interface provided by a simulation kernel by a simulation program, and reading a specified parameter value; or calling a parameter modification interface provided by the simulation kernel to modify the specific parameter.
Specifically, the step S4 employs: in the simulation process, parameter values stored in the simulation kernel are modified, the modified parameters are transmitted into the simulation program through an asynchronous mechanism and/or a synchronous mechanism, and corresponding program operation is executed in real time according to the modified values, so that the interaction between the parameters and the simulation program is realized.
Specifically, the asynchronous mechanism employs: and modifying the parameter values stored in the simulation kernel, and updating the parameters when the simulation program runs after the parameters are modified.
Specifically, the synchronization mechanism employs: and modifying the parameter values stored in the simulation kernel, sending a signal to the simulation program associated with the currently modified parameters by the simulation kernel, carrying out parameter modification notification, and immediately updating the parameter values cached by the simulation program after the simulation program receives the signal.
Specifically, in the simulation process, a dynamic add-delete functional entity command is transmitted to a simulation kernel, and the add-delete operation of the functional entity is carried out based on a dynamic parameter modification mechanism;
the add/delete function entity command comprises: link addition, link deletion, node or network addition, and node or network deletion;
after the nodes or the network are established, adding a connection relation; and after the node or the network is deleted, deleting the connection relation between the current node or the network and the surrounding nodes.
The invention provides a communication simulation interrupt control system, which comprises:
module M1: carrying out initial parameter configuration on the simulation model and storing the simulation model in a simulation kernel;
module M2: the simulation kernel builds an initial simulation parameter system according to the parameter setting of the simulation and the structure of the simulation model;
module M3: initializing a simulation program by the simulation model;
module M4: in the simulation process, parameter values stored in the simulation kernel are modified, the modified parameters are transmitted into the simulation program, and corresponding program operation is executed in real time according to the modified values, so that the interaction between the parameters and the simulation program is realized.
Specifically, the module M1 employs: initial parameter configuration of the simulation model is carried out through GUI configuration, background batch configuration and/or actual measurement parameter import;
the module M3 employs: the initialization process of the simulation program of the simulation model is a multi-turn bidirectional process; the bidirectional process comprises the following steps: the simulation model acquires parameter values from a parameter configuration system to modify the simulation kernel data and modifies the values in the simulation kernel through a simulation program so as to change the parameters of the simulation model;
the module M4 employs: in the simulation process, parameter values stored in the simulation kernel are modified, the modified parameters are transmitted into the simulation program through an asynchronous mechanism and/or a synchronous mechanism, and corresponding program operation is executed in real time according to the modified values, so that the interaction between the parameters and the simulation program is realized.
Example 2
Example 2 is a preferred example of example 1
VRNET is used as a network simulation integrated development environment developed by Beijing Dell technology, a communication simulation interruption dynamic parameter modification mechanism is realized by utilizing a good openness and efficient modeling method, simultaneously, the excellent modeling framework of a VRNET simulation kernel is benefited, the VRNET modeling adopts an object-oriented idea, all models directly or indirectly inherit a common base class, most behavior interfaces are defined in the base class, and each model realizes the interfaces according to own characteristics to complete own specific functions.
The simulation kernel has plant functions of all models, a specific instance of a model can be created at any time by matching with a reflection mechanism, and each object is an independent entity, so that the creation of model entities can be carried out no matter in the process of simulation initialization or simulation operation, and only the interaction relationship among the entities is processed. Therefore, by means of the dynamic parameter mechanism of the VRNET, the dynamic creation and deletion of the functional entities in the simulation process, including the dynamic creation and deletion of nodes, links, networks and the like, and the function of behavior assignment and the like, can be realized. The following will give a detailed description of the two mechanisms unique to VRNET itself.
As shown in fig. 1, a basic flow of dynamic parameter management adopted by the present solution is shown. The whole process can be divided into four big stages: the method comprises an initial configuration generation stage, a simulation initialization stage, a dynamic parameter management stage and a parameter derivation stage. The four stages of initial configuration generation, simulation initialization, dynamic parameter management and parameter derivation are basic steps of simulation software to be operated, and data interaction between a model and a simulation kernel is realized through dynamic parameter management and parameter derivation in the stages, so that simulation interrupt control is realized. In the following, we will describe the detailed flow of these four stages.
Initial configuration phase
At this stage, the simulation kernel will construct an initial simulation parameter system according to the parameter settings of the primary simulation and the structure of the simulation network. The initial parameter configuration of the simulation network can be done by three means: GUI configuration, background batch configuration and actual measurement parameter import, and during actual operation, a certain mode can be independently adopted for parameter configuration, or the three modes can be combined for use. The mechanism for realizing the three means is as follows:
GUI configuration
In VRNET, when constructing simulation network and simulation model, GUI can be used to build needed model, each function model will correspond to one entity in GUI. At this time, a graphical operation can be performed on the interface to configure the parameters of each functional model.
Background batch configuration
When the simulation scale is large, the parameter configuration of each functional model on the GUI can be a very tedious task and is prone to errors. Therefore, the VRNET provides a background batch configuration method, and can set parameters of a group of models at the same time, which is an innovation of the VRNET in the field of parameter configuration of discrete event simulation. In a simulation model system, VRNET adopts a segmented hierarchical description method, for example:
simulation network A, subnet 1, node 2 and module 3
For describing a globally unique module path. At this time, we can realize batch configuration of parameters by means of generic principles in the field of computer science.
Wherein, the difference between the two is that the former can only carry out the wildcard to the characters in one section, and can not cross the sectional symbols'; the latter can be wildcarded across all characters, and can span the segmentation symbols.
Measured parameter import
Because the VRNET adopts an open parameter management system and has dynamic parameter management capability, the VRNET has the capability of importing parameters from measured data, so that the VRNET can be combined with the actual network running state to analyze problems in the actual network operation and maintenance process and provide a solution. It should be noted that the parameters collected by the actual network are usually incomplete, and only partial parameter settings of partial network elements are provided, so that the method usually needs to be used with the former two methods.
Through the three methods, the simulation kernel forms a basic parameter framework. In the initial configuration stage, the simulation kernel also needs to correspond the parameter settings to the actual model to form a specific parameter system, and the process is shown in fig. 2.
Constructing a simulation model system through network model description, namely constructing a specific simulation model entity;
reading in the parameter configuration information obtained by the three means, and corresponding to an actual simulation model entity;
judging the parameter type, and if the parameter is a constant type parameter, directly generating a parameter value; if the parameter is a random parameter, generating a numerical value through a certain random rule and filling the numerical value into the parameter; if the parameters are variable, the change rules are stored in the parameters, and the parameters are dynamically generated each time the parameters are used. The dynamic variable parameters are an original parameter system of the VRNET, and when one parameter is declared, one parameter can be defined as the dynamic variable parameter through a voltate keyword, and the dynamic variable parameters and a dynamic parameter modification mechanism which will be described below form a dynamic parameter management mechanism of the VRNET.
And carrying out unit matching. In VRNET, a unit is introduced to a parameter, that is, a unit of the parameter can be set. For example, the unit of a parameter is declared to be seconds, and milliseconds are used when setting the parameter, the simulation kernel automatically reduces the parameter value by a factor of 1000 to match the unit of the parameter.
Simulation initialization phase
And forming a parameter system matched with the simulation model through the processing of the stage one. At this point, the entire simulation may be initialized with the simulation program. The initialization process is a multi-turn bidirectional process, and from the viewpoint of parameter management, a user program can acquire parameter values from a parameter configuration system, and can also modify specific parameters through the process. The flow at this stage is as follows:
a. the user simulation program sets the required initialization round;
b. the user simulation program carries out self simulation initial operation and determines parameters needing to be read or modified;
c. calling a parameter acquisition interface provided by a simulation kernel by a user simulation program, and reading a specified parameter value; or calling a parameter modification interface provided by the simulation kernel to modify the specific parameter.
In practical applications, the execution flow of the simulation initialization stage generally depends on the execution flow of the simulation program developed by the user, and needs to be customized by the user of the simulation software.
The bidirectional process means that model parameters can be obtained from configuration files in the initialization process to modify the simulation kernel data, and values in the simulation kernel can be directly modified through a program to change the model parameters.
The multiple rounds refer to that model parameter initialization is related in the initialization process (for example, the initialization parameters of the model 1 need to call several basic parameters of the model 2 to be completely initialized), and the initialization is divided into multiple rounds based on the occurrence of the association, wherein the basic parameters of all models are initialized in the first round, the associated model parameters are initialized in the second round, and the associated model parameters are initialized in the third round. The method aims to adapt all scenes which can be built to uniformly initialize the model parameters, and can also be understood as forming a template which is adaptive to all scene model parameter initializations.
Dynamic parameter management phase
The dynamic parameter modification and management capability of the VRNET is realized through interaction between a simulation model and a simulation kernel, and between the simulation kernel and an external program. The dynamic management process of the whole parameter can be divided into two aspects: modification of the parameter storage values, interaction of the parameter modifications with the simulation program.
Modification of parameter storage values
Through the construction of the parameter storage system, a storage entity is established for each parameter of each model entity. During the simulation process, the storage entity of the parameters can store the type, the value and the like of each parameter. Thus, the modification to the parameter is actually to the value of the parameter stored in the simulation kernel.
Parameter modification and simulation program interaction
And after the parameter storage value is modified, the modified parameter storage value is transmitted into the simulation program, and corresponding program operation is executed in real time according to the modified value, so that the interaction between the parameter and the simulation program is realized.
Parameter derivation phase
Firstly, a dynamic parameter modification mechanism of VRNET is introduced, which includes two mechanisms, namely an asynchronous mechanism and a synchronous mechanism, and the following mechanisms are respectively introduced:
the first mechanism is as follows: the simulation parameter asynchronous update mechanism is shown in FIG. 3;
flow analysis:
and performing parameter configuration item by item through a GUI (graphical user interface), or performing rapid batch parameter configuration through a background configuration file to form initial simulation parameter configuration.
And forming a simulation parameter configuration system through a simulation initialization process. After the parameter configuration is read and is calculated in a predefined manner (calculation rule is determined by simulation model), the parameter system is stored in the parameter management system of the simulation kernel, and the specific flow is shown in fig. 4.
During the simulation operation, the reading and modification operations of the parameters from the GUI or an external program can be accepted. When reading or modifying parameters, the GUI or external program communicates with a parameter management entity of the simulation kernel. If the parameter modification occurs, the corresponding parameter value in the kernel parameter management entity is changed, and the specific flow is as shown in fig. 5 below.
When the simulation model runs, when a certain parameter is used each time, the value of the parameter is requested to the kernel parameter management entity, and the parameter management entity returns the latest value of the parameter to the simulation model, so that the effect of dynamically modifying the parameter is achieved.
When the mechanism is in operation, the simulation can form two operation loops: the system comprises a parameter modification loop and a simulation operation loop, wherein the two loops work independently and are overlapped at a kernel parameter management entity. The modified parameters are not necessarily used in the simulation program immediately, and the simulation program updates the parameters only when the modified parameters are used, so that the parameter updating loop and the simulation loop are in an asynchronous working state.
And a second mechanism: a simulation parameter synchronous update mechanism, as shown in fig. 6;
flow analysis:
and performing parameter configuration item by item through a GUI (graphical user interface), or performing rapid batch parameter configuration through a background configuration file to form initial simulation parameter configuration.
And forming a simulation parameter configuration system through a simulation initialization process. After the parameter configuration is read and is calculated in a predefined way (calculation rules are determined by a simulation model), the parameter system is stored in a parameter management system of the simulation kernel. Meanwhile, the simulation program obtains a copy of the parameter values through a parameter initialization process and stores the copy into a local backup.
During simulation operation, simulation calculation is performed by means of the cached parameter copy, instead of requesting a parameter value from the kernel parameter management entity every time the parameter is used, so that the simulation efficiency can be improved to a certain extent, and the initial flow of the parameter is shown in fig. 7.
During the simulation operation, the reading and modification operations of the parameters from the GUI or an external program can be accepted. When reading or modifying parameters, the GUI or external program communicates with a parameter management entity of the simulation kernel. If the parameter modification occurs, the corresponding parameter value in the kernel parameter management entity is changed. Meanwhile, an internal signal mechanism is introduced, when the value of a parameter is modified, the kernel parameter management entity sends a signal to the simulation program associated with the parameter to notify the parameter modification. After receiving the signal, the simulation program immediately updates the parameter value cached by itself, and the parameter modification flow is shown in fig. 8.
Since the simulation program does not need to request the values of the parameters from the kernel parameter management entity each time the parameters are used, the simulation run loop is narrowed down to the simulation program itself. And due to the existence of a signal mechanism, a parameter modification loop is expanded and comprises partial functions of the simulation program. The parameter modification is therefore in a synchronous operating regime.
In an actual simulation program, two parameter mechanisms can coexist, namely, a synchronous mechanism is adopted for modifying some parameters, an asynchronous mechanism is adopted for modifying some parameters, and even some parameters can refuse to be modified, which depends on the specific design and implementation of the simulation program.
Secondly, a dynamic increase and decrease function entity mechanism of the VRNET is introduced, and the mechanism can realize the dynamic creation and deletion of function entities in the simulation process, including the dynamic creation and deletion of nodes, links, networks and the like, and the functions of behavior assignment and the like.
As shown in fig. 9, in order to implement dynamic creation or deletion of a functional entity, a management module needs to be added in a simulation, and the management module may exist in a simulation scene or be hidden in a simulation background, and grasps parameters and a construction mode (which can be obtained by a simulation kernel) of the functional entity that needs to be dynamically created or modified. In the simulation process, a command of dynamically adding and deleting the functional entity can be transmitted to the simulation kernel through a GUI or an external program interface. Through a dynamic parameter modification mechanism provided by the VRNET, the command is captured by the management module, and then the addition and deletion operation of the functional entity is carried out according to the detailed content of the command.
To perform dynamic add-delete of functional entities, the commands that we need to transmit to the simulation kernel include that the instruction types can be divided into four categories, including link addition, link deletion, node or network addition, and node or network deletion, and the parameters that each category of instructions needs to provide are shown in table 1 below.
TABLE 1
After the nodes or the network are established, adding the connection relation; after the node or the network is deleted, the connection relationship with the surrounding nodes is deleted together.
The invention realizes the reading and modification operation of parameters from a GUI or an external program in the simulation running process. When the parameter is modified, the kernel parameter management entity sends a parameter modification notice to the simulation program associated with the parameter by means of an internal signal mechanism, and the simulation program updates the parameter value cached by the simulation program in time after receiving the signal. When the simulation is initialized, the parameter system is stored in the parameter management system of the simulation kernel, and the parameter management entity returns the latest value of the parameter to the simulation model when the simulation is run, so that the effect of dynamically modifying the parameter is achieved. According to the characteristics of the parameters, two parameter modification mechanisms, namely a synchronous mechanism and an asynchronous mechanism, are supported, and can coexist. In the synchronous mechanism, the simulation operation can depend on the parameter copy cached by the synchronous mechanism to carry out simulation calculation, thereby improving the simulation efficiency to a certain extent. By utilizing a dynamic parameter modification mechanism provided by VRNET and adding a management module, the operation of transmitting a dynamic addition and deletion functional entity to a simulation kernel through a GUI (graphical user interface) or an external program interface is realized.
Those skilled in the art will appreciate that, in addition to implementing the systems, apparatus, and various modules thereof provided by the present invention in purely computer readable program code, the same procedures can be implemented entirely by logically programming method steps such that the systems, apparatus, and various modules thereof are provided in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system, the device and the modules thereof provided by the present invention can be considered as a hardware component, and the modules included in the system, the device and the modules thereof for implementing various programs can also be considered as structures in the hardware component; modules for performing various functions may also be considered to be both software programs for performing the methods and structures within hardware components.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.