CN116011257B - Flow simulation method and device for multi-level task - Google Patents

Flow simulation method and device for multi-level task Download PDF

Info

Publication number
CN116011257B
CN116011257B CN202310210343.XA CN202310210343A CN116011257B CN 116011257 B CN116011257 B CN 116011257B CN 202310210343 A CN202310210343 A CN 202310210343A CN 116011257 B CN116011257 B CN 116011257B
Authority
CN
China
Prior art keywords
task
simulation
tasks
level
combined
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310210343.XA
Other languages
Chinese (zh)
Other versions
CN116011257A (en
Inventor
肖路昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chuangqi Vision Technology Co ltd
Original Assignee
Beijing Chuangqi Vision Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Chuangqi Vision Technology Co ltd filed Critical Beijing Chuangqi Vision Technology Co ltd
Priority to CN202310210343.XA priority Critical patent/CN116011257B/en
Publication of CN116011257A publication Critical patent/CN116011257A/en
Application granted granted Critical
Publication of CN116011257B publication Critical patent/CN116011257B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a flow simulation method and device for multi-level tasks, wherein combined tasks in simulation design are converted into a combined task state table, the multi-level tasks are converted into single-level tasks, a global flow chart composed of atomic tasks is formed, a solid model in simulation design is loaded for instantiation, then the simulation is started to be executed according to the global flow chart, tasks meeting activation conditions are executed in sequence, after calculation of all tasks in a current time frame is completed, the states of the combined tasks are updated according to task calculation results, single-step calculation is carried out on entities acting on the tasks, and the steps are executed circularly according to simulation step sizes until the simulation is finished. Through the scheme, the problem that a multi-level task simulation scheme is not flexibly and efficiently realized in the related technology is solved, simulation deduction of task flows with any number of levels is supported, system simulation requirements with complex combat flows are met, and flexibility and universality of task flow simulation are improved.

Description

Flow simulation method and device for multi-level task
Technical Field
The application relates to the field of system simulation, in particular to a flow simulation method and device for multi-level tasks
Background
In the related art, in the field of system simulation, the timing of participation of an entity in simulation planning in simulation operation is constrained by a preset task flow. For example, simulation contemplates defining a process of detecting an object as a detection phase, defining a process of performing an eviction task after finding the object as an eviction phase, and during the detection phase, a fighter entity will stand by at an airport until the detection phase is completed, and not take off to perform the specified tasks of fighting, eviction, etc. In the detection phase, the fighter entity does not perform simulation solution until the moment of entering the expelling phase, the fighter entity is activated, and simulation solution starts.
The task flow in simulation design is generally divided into stages in time sequence, each stage containing a number of tasks, each task being responsible for implementation by one or more solid models. Generally, the relationships between tasks in a task flow are described in a flow chart mode, and there are various modes of sequential execution, parallel execution, execution based on condition judgment, and the like of execution sequences between tasks. When the simulation deduction enters a new stage, the tasks in the stage are activated in turn according to the execution sequence in the flow chart, and the related entity model is driven to execute the tasks after the activation.
For complex architectural simulation systems with multiple levels of multiple granularity solid model participation, the hierarchy of task flows tends to be very complex. In this task flow, the underlying task is responsible for manipulating one or a few entities to execute a task, and multiple underlying tasks are combined in the form of a flow chart, so as to form an upper combined task. The upper layer combined tasks can be combined in the form of a flow chart, and a higher-level combined task is formed. Finally, all tasks under the same camping jointly form the task flow of the camping.
The number of layers of task flows varies for different architectural simulation requirements. For example, for small scale countermeasure simulations, a two-layer or three-layer task flow is sufficient to describe the task in the simulation project. For large-scale combined combat simulation, more than three layers of structures may be needed for the task flow to be clear.
However, the conventional task flow simulation method generally only supports simulation deduction on a single-layer task flow, or only supports task modeling and simulation deduction on the premise of a given task flow hierarchical structure. When the task flow is more hierarchical or a given hierarchical structure fails to describe multi-hierarchical, multi-granularity tasks in the task flow, this approach fails to meet the requirements.
The above information disclosed in the background section is only for enhancement of understanding of the background art from the technology described herein and, therefore, may contain some information that does not form the prior art that is already known in the country to a person of ordinary skill in the art.
Aiming at the problem that a multi-level task simulation scheme is not flexibly and efficiently realized in the related technology, no effective solution exists at present.
Disclosure of Invention
The main purpose of the application is to provide a flow simulation method and device for multi-level tasks, so as to solve the problem that the prior art lacks flexibility and high efficiency for realizing multi-level task simulation.
According to an aspect of the embodiments of the present application, there is provided a flow simulation method for a multi-level task, including: s1, creating a combined task state table according to combined tasks in a multi-level task flow in simulation design, setting the combined tasks to be in an inactive state, converting the multi-level tasks into a single-level structure, forming a global flow chart composed of atomic tasks, carrying out initialization setting according to a simulation design loading entity model and instantiation as an entity, creating an initial task in the global flow chart, executing the initial task, and setting simulation time as simulation initial time; s2, adding the tasks meeting the activation conditions in the global flow chart into a task list to be changed, executing each task according to the task list to be changed, controlling an entity to execute an activity by each task, completing the calculation of a current time frame, and recording the task calculation result and the entity acted by the task; and S3, updating the states of the combined tasks of the multi-level task flow according to the task calculation result in a bottom-up sequence, completing single-step calculation of the entities in the current time frame according to the task calculation result, and using the single-step calculation as input data of other entities in the next time frame, advancing a simulation process according to a simulation step length, and jumping to the S2 for repeated execution until the simulation is finished.
According to another aspect of the embodiments of the present application, there is provided a flow simulation apparatus for a multi-level task, including: the creation module creates a combined task state table according to combined tasks in a simulation-planning multi-level task flow, sets the combined tasks in an inactive state, converts the multi-level tasks into a single-level structure, forms a global flow chart composed of atomic tasks, carries out initialization setting according to a simulation-planning loading entity model and instantiation as an entity, creates and executes an initial task in the global flow chart, and sets simulation time as simulation initial time; the execution module adds the tasks meeting the activation conditions in the global flow chart into a task list to be changed, executes each task according to the task list to be changed, controls the entity to execute the activity, completes the calculation of the current time frame, and records the task calculation result and the entity of the task action; and the calculation module is used for updating the states of the combined tasks of the multi-level task flow according to the task calculation result in a bottom-up sequence, completing single-step calculation of the entities in the current time frame according to the task calculation result, and taking the single-step calculation as input data of other entities in the next time frame, advancing a simulation process according to a simulation step length, and jumping to the execution module to continue simulation until the simulation is finished.
In the embodiment of the application, a combined task in simulation design is converted into a combined task state table, a multi-level task is converted into a single-level task, a global flow chart composed of atomic tasks is formed, a solid model in simulation design is loaded for instantiation, then the simulation is started to be executed according to the global flow chart, tasks meeting activation conditions are executed in sequence, after calculation of all tasks in a current time frame is completed, the state of the combined task is updated according to task calculation results, single-step calculation is performed on an entity acted by the task, and the steps are executed in a circulating mode according to simulation step sizes until the simulation is finished. Through the scheme, the multi-level task can be flexibly converted into the single-level task for simulation, the combined task with complex logic is efficiently processed, the problem that a multi-level task simulation scheme is not flexibly and efficiently realized in the related technology is solved, the simulation deduction of the task flow with any number of levels is supported, the system simulation requirement with complex combat flow is met, and the flexibility and the universality of the task flow simulation are improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a flow chart of a flow simulation method of a multi-level task according to an embodiment of the present application;
FIG. 2 is a schematic diagram of generating a global flow chart according to an embodiment of the present application;
FIG. 3 is a detailed flow chart of a multi-level task simulation method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a flow simulation apparatus for a multi-level task according to an embodiment of the present application.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the present application described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of description, the following will describe some terms or terms related to the embodiments of the present application:
the simulation scenario is a scenario file for simulation deduction, and is generally referred to as a scenario file for simply describing the type, number, initial configuration, and task flow information for controlling the activity of the solid model, which are included in the one-time simulation test.
The solid model refers to a simulation model used in simulation planning to simulate a subject, such as a scout solid model, or an aircraft carrier platoon solid model. In the simulation process, the entity model needs to be instantiated into an entity object, and the entity object is generally called an entity for short. In simulation thinking, the entities need to subscribe to each other to obtain the real-time state of other entities, so as to change the state, action and other attributes of the entities in time.
The task flow is an activity flow of an entity described in the form of a flow chart and the like in simulation design, and is used for describing a process that the entity changes along with simulation deduction in a simulation test, wherein the activity specifically executed by the entity is represented by a task. In the application, a task flow takes a unified modeling language (unified modeling language, abbreviated as UML) flow chart as a specific description method, and nodes in the flow chart comprise task nodes and functional nodes, wherein the task nodes record tasks, and the functional nodes are preset nodes for executing specific functions in the flow chart and comprise a start node, an end node, a conditional branch node and the like.
A task refers to an object in a task flow that describes an activity that an entity in a simulation is supposed to perform, and generally, a task describes an activity of one entity or a plurality of entities, such as a scout performed by a scout or a patrol performed by an aircraft carrier. Tasks are embodied in the flow chart as task nodes. In this application, a task has two states, specifically an active state and an inactive state. The active state represents that a task is in progress and the inactive state represents that the task is not started or completed. In the present application, a task may control an associated entity to perform an activity, and the calculation result data embodied as the task is used as input data of the associated entity, thereby affecting the calculation of the entity.
The combined task refers to a composite task formed by combining a group of tasks in a task flow, wherein the tasks are combined in a flow chart form. An atomic task refers to a task that does not include sub-level tasks.
The condition refers to an object describing an execution order relationship between tasks in a task flow. In the present application, the condition is represented by a connection with an arrow in the flowchart, the start end of the connection represents a preceding node, and the end pointed by the arrow represents a subsequent node. If the condition is satisfied, the task corresponding to the preceding node is completed, and then the task corresponding to the following node is activated.
The simulation step length refers to the minimum time unit of the simulation time advance in the simulation test. In the simulation running process, the simulation time starts to be calculated at the moment of 0, and a simulation step length is overlapped on the basis of the existing moment after the calculation of one time frame is completed, so that the specific moment of the next time frame is obtained.
In the related art, two types of task flow simulation methods exist, one of which only supports simulation deduction of a single-level task flow, and the other of which defines a description level of the task flow.
The first method requires that all tasks are required to be put into a flow chart of a large task flow, the method cannot keep the hierarchical information of the tasks when describing a complex multi-level task flow, elements in the flow chart span multiple task flow layers, the flow chart becomes very complex, the hierarchical relationship is disordered, and the state check, the data collection and the data analysis of the simulation deduction process are not facilitated.
The second method avoids the disadvantages of the first method, and distinguishes tasks of different levels in a definite hierarchy, but at the same time, the task flow hierarchy is limited by the system, and task flows with the number of levels exceeding the preset maximum level cannot be described. In addition, the method requires that the description of the task flow must cover all preset layers from bottom to top, and when the task flow cannot be split into a plurality of preset layers, simulation deduction cannot be performed, which further limits the flexibility of task flow simulation. For example, the hierarchy of the task flow originally only needs to be described clearly by using one hierarchy, but is limited by the system, the task flow must be forcedly split according to a specified hierarchy structure, which results in redundancy of the hierarchy and inconvenience of task flow design work.
The task flow simulation method provided by the application describes multi-level tasks by using a unified interface specification, assembles lower-level tasks into upper-level tasks in a combined mode, builds task flows one by one in a level manner, converts the multi-level task flows into a single-level task flow before simulation deduction starts, and develops simulation deduction based on the single-level task flow. On one hand, the design and simulation of task flows with any level number are realized, and the flexibility of task flow simulation is improved; on the other hand, the task flow does not need to cover all levels, the definition of the task is not limited by a preset level structure, redundant levels are avoided, and the efficiency of task flow design is improved.
According to an embodiment of the present application, a flow simulation method of a multi-level task is provided, and fig. 1 is a flowchart of the flow simulation method of the multi-level task according to an embodiment of the present application. As shown in fig. 1, the method comprises the following three steps:
step S1, creating a combined task state table according to combined tasks in a multi-level task flow in simulation design, setting the combined tasks to be in an inactive state, converting the multi-level tasks into a single-level structure, forming a global flow chart composed of atomic tasks, carrying out initialization setting according to a simulation design loading entity model and instantiation entity, creating an initial task in the global flow chart, executing the initial task, and setting simulation time as simulation initial time;
Optionally, the S1 further includes: after creating and executing the initial task in the global flow chart, writing the initial task into an active task list; the creating a combined task state table according to the combined task in the simulation contemplating multi-level task flow in the S1 further includes: the method is characterized in that the method is stored in the combined task state table in a key value of 'combined task ID' and 'combined task state'.
Optionally, the multi-level task in S1 is converted into a single-level structure by the following manner, so as to form a global flowchart composed of atomic tasks: traversing from the bottom to the top layer 2 of the multi-level task flow, traversing each combined task of each level, deleting a starting node and an ending node in the combined task, changing the condition of initially pointing to the combined task to point to a first node after the starting node, and pointing the condition of pointing to the ending node in the combined task to a subsequent node of the combined task; after the combination processing of all the layers in the multi-level task flow is completed, a global flow chart composed of atomic tasks is formed.
Optionally, the global flow chart and the combined task state table are generated by: and creating a combined task state table according to all combined tasks contained in the multi-level task flow in simulation design, setting the states of all combined tasks into an inactive state, and converting the task flow into a single-level structure to form a global flow chart composed of atomic tasks.
Optionally, for the combined task in the multi-level task flow in simulation design, a combined task state table is created to record the real-time state of the combined task. In addition, the multi-level task flow is converted into a single-level structure, so that a global flow chart is formed. The global flow chart is composed of atomic tasks and does not contain combined tasks, and the function is to facilitate the simulation calculation of the task flow and avoid calculating the states of the combined tasks layer by layer.
Optionally, the following three steps are performed to generate a global flowchart:
and (111) creating a combined task state table S aiming at combined tasks of all levels in the n-level task flow in simulation design, wherein the real-time state of each combined task is recorded in the table in a mode of key value pairs of 'combined task ID-combined task state'. After creating the combined task state table, the states of all the combined tasks are set to be inactive states, which means that all the combined tasks are not activated currently.
Step (112) of traversing each level of the n-level task flow from the bottom up layer 2, and traversing the combined task list T in the i (2. Ltoreq.i. Ltoreq.n) th layer i Traversing, deleting a starting node and an ending node in each combined task, changing the condition pointing to the current combined task in the task flow to point to the first node after the current combined task starts to point to the node, and changing the condition pointing to the ending node in the current combined task to point to the subsequent node of the current combined task. After all the combined tasks in the ith layer are processed, entering the (i+1) th layer, and processing the combined tasks in the layer by the same operation method.
In step (113), after the combined task processing of all the levels in the n-level task flows is completed, a global flow chart formed by atomic tasks is formed, denoted as F, as shown in fig. 2, fig. 2 is a schematic diagram of generating a global flow chart according to an embodiment of the present application, and a task flow having a four-level structure is formed, where the combined tasks are respectively converted into a single-level structure, so that the whole multi-level task flow is converted into a single-level task flow.
Optionally, the specific step of simulation initialization is to load a solid model according to simulation design, perform initialization setting, create an initial task of a global flow chart, write the initial task into an active task list, and set the simulation time as the simulation initial time.
Optionally, the simulation initialization is achieved by:
and step (121), loading the entity model according to the entity information recorded in the simulation design, and initializing the entity.
Step (122), two empty task lists are created, namely an activated task list L1 and a task list L2 in a state to be changed, wherein the activated task list L1 is used for recording tasks in an activated state in the simulation process, and the task list L2 in the state to be changed is used for recording tasks in a state to be changed in a next time frame.
Step (123), according to the global flow chart F, creating a starting task, and writing the starting task into the active task list L1.
Step (124) of simulating time t sim Setting the simulation initial time.
Step S2, adding the tasks meeting the activation conditions in the global flow chart into a task list to be changed, executing each task according to the task list to be changed, controlling an entity to execute an activity by each task, completing the calculation of a current time frame, and recording the task calculation result and the entity acted by the task;
optionally, adding the task meeting the activation condition in the global flowchart to the task list to be changed in S2 includes: and receiving a simulation start signal, searching conditions led out from the rear of the task in the activated state in the activated task list in the global flow chart, judging the conditions one by one, and writing the subsequent task with the established conditions into the task list in the state to be changed.
Optionally, the updating of the list of states to be changed is done by two steps:
step (211), after the simulation is started, traversing the active task list L1, and for the task t in the L1 list, searching all conditions led out by the task t from the global flow chart F, and recording the conditions as a condition list C of the task t t
Step (212), traversing the condition list C of task t t For list C t Whether the conditions in the list are met or not is judged one by one, and if the conditions are met, the task pointed by the conditions c is written into the task list L2 in the state to be changed.
Optionally, in S2, each task is executed according to the task list to be changed, and each task controls the entity to execute the activity, completes the calculation of the current time frame, and records the task calculation result and the task action, including: when a task is changed from an unactivated state to an activated state, writing the task into an activated task list, calling the task to complete the calculation of a current time frame, and simultaneously recording a task calculation result and an entity acted by the task; and removing the task from the active task list when the task is changed from the active state to the inactive state.
Optionally, the tasks in the to-be-changed state list are performed by:
Step (221), traversing the task list L2 to be changed, and for the task t in the L2, searching the task t from the global flow chart F.
Step (222), if the task t is currently in an inactive state, changing to an active state, calling the task to complete the calculation of the current time frame, recording the calculation result of the task in the form of key value pair of the ID of the entity acted by the task-the result data obtained by the task calculation, and writing the result into the set R T The result data is transmitted to the corresponding entity to realize the control of the task on the entity; if the task t is currently in an activated state, changing to an inactivated state, and selecting any oneThe task t is removed from the active task list L1.
Step (223), all tasks in list L2 are emptied.
And step S3, updating the states of the combined tasks of the multi-level task flow according to the task calculation result in a bottom-up sequence, completing single-step calculation of the entities in the current time frame according to the task calculation result, and using the single-step calculation as input data of other entities in the next time frame, advancing a simulation process according to a simulation step length, and jumping to the step S2 for repeated execution until the simulation is finished.
Optionally, the updating the state of the combined task of the multi-level task flow according to the task calculation result in the order from bottom to top in S3 includes: and traversing the tasks of each level from the second layer from the bottom to the top in the multi-level task flow in the simulation design, receiving the states of the lower-level tasks contained in the combined tasks in each level, and summarizing to obtain the states of the combined tasks.
Optionally, the status of the combined task is updated by:
step (311) of starting from the bottom-up layer 2 for the n-level task flow in simulation design for the combined task list T in the i (2. Ltoreq.i. Ltoreq.n) th layer i Traversing, for combined task t in list j Find t j The state of the next task is known as t if the next task is not activated j And is in an inactive state, otherwise, is in an active state. If i=2, the state of the next layer task is searched from the global flow chart F; if i is more than 2 and less than or equal to n, the state of the next layer task is searched from the combined task state table S.
And (312) updating the state of the corresponding combined task in the S according to the calculation result of the step (311).
Optionally, the step S3 of completing the single step calculation of the entity in the current time frame according to the task calculation result, as input data of other entities in the next time frame, includes: and for each entity, acquiring the task calculation result and output data of other entities subscribed by the entity in the previous time frame, forming input data of the entity in the current time frame, transmitting the input data into the entity, executing single-step calculation, and subscribing the calculation result as input data of other entities subscribed by the entity in the next time frame.
Optionally, a single step calculation of the entity is accomplished by:
step (321), traversing the entity list, and for the kth entity, obtaining a result set R from the step (222) T Extracting task result data corresponding to the entity, and writing the task result data into the set I k ,I k Is the input data that entity k needs to receive in the current time frame.
Step (322), outputting the data set R from the entity of the last time frame E Output data of other entities subscribed by the searching entity k are written into the set I k
Step (323), step I k The data in the time frame is transmitted to the entity k as input data, the entity k is called to finish the single-step calculation of the current time frame, and the result data obtained by calculation is written into R E As input data for other entities in the next time frame.
Step (324), after completing step (321), step (322) and step (323) for all entities in the entity list, respectively, clearing I of each entity k And empty R E
Optionally, if the simulation is not finished, the simulation time advances by one simulation step based on the current time, i.e., t sim =t sim +t step And returning to the step (211), and stopping the loop if the simulation is finished, and ending the task flow simulation deduction.
In summary, the present application uses fig. 3 as a schematic diagram, and the flow simulation method of the multi-level task is summarized as follows:
Step one, generating a global flow chart and a combined task state table. And creating a combined task state table according to all combined tasks contained in the multi-level task flow in simulation design, setting the states of all combined tasks into an inactive state, and converting the task flow into a single-level structure to form a global flow chart composed of atomic tasks.
Step two, simulation initialization. And loading the entity model according to simulation design, carrying out initialization setting, creating an initial task of the global flow chart, writing the initial task into an activated task list, and setting the simulation time as the simulation initial time. If the simulation is not started, the simulation is waited for to start, and if the simulation is started, the step III is shifted to.
And thirdly, judging the conditions of the global flow chart. After the simulation starts, according to the activated task list, the conditions led out from the rear of the tasks in the activated state are searched in the global flow chart, judgment is carried out one by one, and the subsequent tasks pointed to by the established conditions are written into the task list in the state to be changed.
And step four, updating the task state of the global flow chart. Traversing a task list in a state to be changed, carrying out state change on each task, writing the task into an active task list if the task is changed from an inactive state to an active state, calling the task to complete calculation of a current time frame, recording a task calculation result and an entity acted by the task, removing the task from the active task list if the task is changed from the active state to the inactive state, and clearing after traversing the task list in the state to be changed is completed.
And fifthly, calculating and updating the state of the upper layer task. And traversing each level of the task flow from the second layer from the bottom to the top in the multi-level task flow in simulation design, collecting the states of the lower-level tasks contained in the combined tasks in each level, calculating the states of the combined tasks, and updating the corresponding information in the combined task state table.
Step six, calculating the entity in a single step. And step four, collecting and arranging the task calculation result data in the step two and the output data of other entities subscribed by the entity in the previous time frame to form the input data of the entity in the current time frame, transmitting the input data to the entity, calling the entity to execute single-step calculation, and collecting the calculation result data as the input data of other entities in the next time frame.
Step seven, if the simulation is not finished, the simulation time advances by one simulation step length on the basis of the current time, and returns to the step three, and if the simulation is finished, the circulation is stopped, and the task flow simulation deduction is finished.
In the embodiment of the application, a combined task in simulation design is converted into a combined task state table, a multi-level task is converted into a single-level task, a global flow chart composed of atomic tasks is formed, a solid model in simulation design is loaded for instantiation, then the simulation is started to be executed according to the global flow chart, tasks meeting activation conditions are executed in sequence, after calculation of all tasks in a current time frame is completed, the state of the combined task is updated according to task calculation results, single-step calculation is performed on an entity acted by the task, and the steps are executed in a circulating mode according to simulation step sizes until the simulation is finished. Through the scheme, the multi-level task can be flexibly converted into the single-level task to simulate, the combined task with complex logic is efficiently processed, the problem that a multi-level task simulation scheme is not flexibly and efficiently realized in the related technology is solved, the simulation deduction of the task flow with any number of levels is supported, the system simulation requirement with complex combat flow is met, and the flexibility and the universality of the task flow simulation are improved.
According to another embodiment of the present application, there is further provided a flow simulation device for a multi-level task, as shown in fig. 4, and fig. 4 is a schematic diagram of the flow simulation device for the multi-level task according to an embodiment of the present application, including:
the creation module 42 creates a combined task state table according to combined tasks in a multi-level task flow in simulation design, sets the combined tasks in an inactive state, converts the multi-level tasks into a single-level structure, forms a global flow chart composed of atomic tasks, performs initialization setting according to the simulation design loading entity model and instantiation entity, creates and executes an initial task in the global flow chart, and sets simulation time as simulation initial time;
the execution module 44 adds the tasks meeting the activation conditions in the global flow chart into a task list to be changed, executes each task according to the task list to be changed, controls the entity to execute the activity, completes the calculation of the current time frame, and records the task calculation result and the entity acted by the task;
the calculation module 46 updates the states of the combined tasks of the multi-level task flows according to the task calculation results from bottom to top, completes single-step calculation of the entities in the current time frame according to the task calculation results, and pushes the simulation process according to the simulation step length as input data of other entities of the next time frame, and jumps to the execution module to continue simulation until the simulation is finished.
Optionally, the creating module 42 is further configured to write the initial task in the active task list after creating and executing the initial task in the global flowchart; the creation module 42 is further configured to store the method in the combined task state table as a key value of "combined task ID" and "combined task state".
Optionally, the creation module 42 converts the multi-level tasks into a single-level structure by forming a global flowchart of atomic tasks: traversing from the bottom to the top layer 2 of the multi-level task flow, traversing each combined task of each level, deleting a starting node and an ending node in the combined task, changing the condition of initially pointing to the combined task to point to a first node after the starting node, and pointing the condition of pointing to the ending node in the combined task to a subsequent node of the combined task; after the combination processing of all the layers in the multi-level task flow is completed, a global flow chart composed of atomic tasks is formed.
Optionally, the executing module 44 adds the task meeting the activation condition in the global flowchart to the task list to be changed, including: and receiving a simulation start signal, searching conditions led out from the rear of the task in the activated state in the activated task list in the global flow chart, judging the conditions one by one, and writing the subsequent task with the established conditions into the task list in the state to be changed.
Optionally, the execution module 44 is further configured to write the task into an active task list when the task is changed from an inactive state to an active state, and call the task to complete the calculation of the current time frame, and record the calculation result of the task and the entity acted by the task; and removing the task from the active task list when the task is changed from the active state to the inactive state.
Optionally, the computing module 46 is further configured to traverse the task of each level from the second level of the multi-level task flow in the simulation design from the bottom to the top, receive the status of the lower-level task included in the combined task in each level, and aggregate the status of the combined task.
Optionally, the calculating module 46 is further configured to obtain, for each entity, the task calculation result and output data of other entities subscribed to by the entity in a previous time frame, form input data of the entity in a current time frame, input the entity, and perform single-step calculation, and subscribe the calculation result as input data of other entities subscribed to by the entity in a next time frame.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The flow simulation device for the multi-level task includes a processor and a memory, where the creation module 42, the execution module 44, the calculation module 46, and the like are stored as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one kernel, the problem that a multi-level task simulation scheme is not flexibly and efficiently realized in the related technology is solved by adjusting kernel parameters, the simulation deduction of the task flow with any number of levels is supported, the system simulation requirement with complex operational flows is met, and the flexibility and the universality of the task flow simulation are improved.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
Embodiments of the present application provide a computer-readable storage medium having stored thereon a program that, when executed by a processor, implements a flow simulation method for the multi-level task.
The embodiment of the application provides a processor which is used for running a program, wherein the program runs a flow simulation method for executing the multi-level tasks.
The embodiment of the application provides equipment, which comprises a processor, a memory and a program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize at least the following steps: s1, creating a combined task state table according to combined tasks in a multi-level task flow in simulation design, setting the combined tasks to be in an inactive state, converting the multi-level tasks into a single-level structure, forming a global flow chart composed of atomic tasks, carrying out initialization setting according to a simulation design loading entity model and instantiation as an entity, creating an initial task in the global flow chart, executing the initial task, and setting simulation time as simulation initial time; s2, adding the tasks meeting the activation conditions in the global flow chart into a task list to be changed, executing each task according to the task list to be changed, controlling an entity to execute an activity by each task, completing the calculation of a current time frame, and recording the task calculation result and the entity acted by the task; and S3, updating the states of the combined tasks of the multi-level task flow according to the task calculation result in a bottom-up sequence, completing single-step calculation of the entities in the current time frame according to the task calculation result, and using the single-step calculation as input data of other entities in the next time frame, advancing a simulation process according to a simulation step length, and jumping to the S2 for repeated execution until the simulation is finished. The device herein may be a server, PC, PAD, cell phone, etc.
The present application also provides a computer program product adapted to perform a program initialized with at least the following method steps when executed on a data processing device: s1, creating a combined task state table according to combined tasks in a multi-level task flow in simulation design, setting the combined tasks to be in an inactive state, converting the multi-level tasks into a single-level structure, forming a global flow chart composed of atomic tasks, carrying out initialization setting according to a simulation design loading entity model and instantiation as an entity, creating an initial task in the global flow chart, executing the initial task, and setting simulation time as simulation initial time; s2, adding the tasks meeting the activation conditions in the global flow chart into a task list to be changed, executing each task according to the task list to be changed, controlling an entity to execute an activity by each task, completing the calculation of a current time frame, and recording the task calculation result and the entity acted by the task; and S3, updating the states of the combined tasks of the multi-level task flow according to the task calculation result in a bottom-up sequence, completing single-step calculation of the entities in the current time frame according to the task calculation result, and using the single-step calculation as input data of other entities in the next time frame, advancing a simulation process according to a simulation step length, and jumping to the S2 for repeated execution until the simulation is finished.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, randomAccess Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (9)

1. The flow simulation method of the multi-level task is characterized by comprising the following steps of:
s1, creating a combined task state table according to combined tasks in a multi-level task flow in simulation design, setting the combined tasks to be in an inactive state, converting the multi-level tasks into a single-level structure, forming a global flow chart composed of atomic tasks, carrying out initialization setting according to a simulation design loading entity model and instantiation as an entity, creating an initial task in the global flow chart, executing the initial task, and setting simulation time as simulation initial time;
s2, adding the tasks meeting the activation conditions in the global flow chart into a task list to be changed, executing each task according to the task list to be changed, controlling an entity to execute an activity by each task, completing the calculation of a current time frame, and recording the task calculation result and the entity acted by the task;
S3, updating the states of the combined tasks of the multi-level task flow according to the task calculation results in a bottom-up sequence, completing single-step calculation of entities in a current time frame according to the task calculation results, and using the single-step calculation as input data of other entities in a next time frame, pushing a simulation process according to a simulation step length, and jumping to the S2 for repeated execution until the simulation is finished;
the multi-level task in the S1 is converted into a single-level structure in the following way, so that a global flow chart consisting of atomic tasks is formed:
traversing from the bottom to the top layer 2 of the multi-level task flow, traversing each combined task of each level, deleting a starting node and an ending node in the combined task, changing the condition of initially pointing to the combined task to point to a first node after the starting node, and pointing the condition of pointing to the ending node in the combined task to a subsequent node of the combined task;
after the combination processing of all the layers in the multi-level task flow is completed, a global flow chart composed of atomic tasks is formed.
2. The method of claim 1, wherein S1 further comprises: after creating and executing the initial task in the global flow chart, writing the initial task into an active task list;
The creating a combined task state table according to the combined task in the simulation contemplating multi-level task flow in the S1 further includes: the method is characterized in that the method is stored in the combined task state table in a key value of 'combined task ID' and 'combined task state'.
3. The method according to claim 1, wherein adding the task meeting the activation condition in the global flowchart to the task list to be changed in S2 includes:
and receiving a simulation start signal, searching conditions led out from the rear of the task in the activated state in the activated task list in the global flow chart, judging the conditions one by one, and writing the subsequent task with the established conditions into the task list in the state to be changed.
4. The method according to claim 1, wherein the step S2 of executing each task according to the task list to be changed, each task controlling an entity to execute an activity, completing the calculation of the current time frame, and recording the task calculation result and the task action includes:
when a task is changed from an unactivated state to an activated state, writing the task into an activated task list, calling the task to complete the calculation of a current time frame, and simultaneously recording a task calculation result and an entity acted by the task;
And removing the task from the active task list when the task is changed from the active state to the inactive state.
5. The method according to claim 1, wherein updating the state of the combined task of the multi-level task flow in the order from bottom to top according to the task calculation result in S3 includes:
and traversing the tasks of each level from the second layer from the bottom to the top in the multi-level task flow in the simulation design, receiving the states of the lower-level tasks contained in the combined tasks in each level, and summarizing to obtain the states of the combined tasks.
6. The method according to claim 1, wherein the step S3 of completing the single step calculation of the entity in the current time frame according to the task calculation result as the input data of the other entity in the next time frame includes:
and for each entity, acquiring the task calculation result and output data of other entities subscribed by the entity in the previous time frame, forming input data of the entity in the current time frame, transmitting the input data into the entity, executing single-step calculation, and subscribing the calculation result as input data of other entities subscribed by the entity in the next time frame.
7. A process simulation device for a multi-level task, comprising:
the creation module creates a combined task state table according to combined tasks in a simulation-planning multi-level task flow, sets the combined tasks in an inactive state, converts the multi-level tasks into a single-level structure, forms a global flow chart composed of atomic tasks, carries out initialization setting according to a simulation-planning loading entity model and instantiation as an entity, creates and executes an initial task in the global flow chart, and sets simulation time as simulation initial time;
converting the multi-level task into a single-level structure to form a global flow chart consisting of atomic tasks:
traversing from the bottom to the top layer 2 of the multi-level task flow, traversing each combined task of each level, deleting a starting node and an ending node in the combined task, changing the condition of initially pointing to the combined task to point to a first node after the starting node, and pointing the condition of pointing to the ending node in the combined task to a subsequent node of the combined task;
after the combination processing of all the layers in the multi-level task flow is completed, forming a global flow chart composed of atomic tasks;
The execution module adds the tasks meeting the activation conditions in the global flow chart into a task list to be changed, executes each task according to the task list to be changed, controls the entity to execute the activity, completes the calculation of the current time frame, and records the task calculation result and the entity of the task action;
and the calculation module is used for updating the states of the combined tasks of the multi-level task flow according to the task calculation result in a bottom-up sequence, completing single-step calculation of the entities in the current time frame according to the task calculation result, and taking the single-step calculation as input data of other entities in the next time frame, advancing a simulation process according to a simulation step length, and jumping to the execution module to continue simulation until the simulation is finished.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored program, wherein the program performs the flow simulation method of the multi-level task of any one of claims 1 to 6.
9. A processor, wherein the processor is configured to run a program, wherein the program runs to perform the flow simulation method of the multi-level task of any one of claims 1 to 6.
CN202310210343.XA 2023-03-07 2023-03-07 Flow simulation method and device for multi-level task Active CN116011257B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310210343.XA CN116011257B (en) 2023-03-07 2023-03-07 Flow simulation method and device for multi-level task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310210343.XA CN116011257B (en) 2023-03-07 2023-03-07 Flow simulation method and device for multi-level task

Publications (2)

Publication Number Publication Date
CN116011257A CN116011257A (en) 2023-04-25
CN116011257B true CN116011257B (en) 2023-07-18

Family

ID=86027104

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310210343.XA Active CN116011257B (en) 2023-03-07 2023-03-07 Flow simulation method and device for multi-level task

Country Status (1)

Country Link
CN (1) CN116011257B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021186685A1 (en) * 2020-03-19 2021-09-23 三菱電機株式会社 Simulation execution system, simulation execution method, and simulation execution program
CN111624897B (en) * 2020-06-23 2024-07-26 上海航天控制技术研究所 Full-service-life-oriented satellite formation and orbit control full-flow simulation verification method
CN112541280A (en) * 2020-12-28 2021-03-23 上海机电工程研究所 Agent system and method for multi-level, multi-granularity and cross-domain combined simulation test
CN113239592B (en) * 2021-05-19 2022-07-01 北京航空航天大学 Hierarchical load decomposition method for simulation application of complex multi-layer structure product
CN114528666A (en) * 2022-02-24 2022-05-24 北京航空航天大学 Complex structure system reliability method based on multi-level distributed cooperative agent model
CN114611401A (en) * 2022-03-18 2022-06-10 中国人民解放军战略支援部队信息工程大学 Multi-level complex service intelligent simulation method and system

Also Published As

Publication number Publication date
CN116011257A (en) 2023-04-25

Similar Documents

Publication Publication Date Title
CN107391653B (en) Distributed NewSQL database system and picture data storage method
CN110166285B (en) Network security experiment platform building method based on Docker
CN109445802B (en) Privatized Paas platform based on container and method for publishing application thereof
US8990141B2 (en) Method and system for performing root cause analysis
CN108491333A (en) Method for writing data, device, equipment and the medium of buffer circle
CN107870845A (en) Towards the management method and system of micro services framework applications
US20060156157A1 (en) Checkpoint restart system and method
JP2019518257A (en) State control method and apparatus
CN103823680B (en) Development method and device of game business logic engine
US11218386B2 (en) Service ticket escalation based on interaction patterns
CN107665154A (en) Authentic data analysis method based on RDMA and message transmission
CN110427258B (en) Resource scheduling control method and device based on cloud platform
CN105354239A (en) Configuration data processing model based processing center data stream processing method
CN107656864A (en) A kind of Mobile solution automated testing method based on probabilistic model
CN109240666B (en) Function calling code generation method and system based on call stack and dependent path
CN109871290B (en) Call stack tracking method and device applied to Java and storage medium
CN106550014A (en) Node upgrade method and device in server cluster
CN113835685A (en) Network operating system design method based on mimicry database
CN109634714B (en) Intelligent scheduling method and device
CN109582382B (en) Loading method and device of configuration information, storage medium and terminal equipment
CN107992354A (en) For reducing the method and device of memory load
CN116011257B (en) Flow simulation method and device for multi-level task
Bauer et al. Reusing system states by active learning algorithms
CN109324867A (en) A kind of virtual machine temporary storage method, restoration methods and device
CN109976905B (en) Memory management method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant