An adaptive modeling method and system based on simulation effectiveness
Through Euclidean distance planning and dynamic link library technology, the problem of simulation scale mismatch in three-dimensional simulation is solved, efficient simulation calculation and step size consistency at different scales are achieved, and simulation accuracy and resource utilization are improved.
Patent Information
- Application Number
- CN202311171170.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2043-09-11
AI Technical Summary
Existing 3D simulation editors have uneven distribution of computing resources in high-precision simulations, resulting in distortion of simulation results and the inability to flexibly adjust the simulation performance scale and data step size under different simulation scales.
Through simulation scale hierarchical planning based on Euclidean distance, an adaptive modeling method is constructed to obtain simulation performance scales at different simulation scale levels, and the corresponding simulation algorithms are packaged into dynamic link libraries to realize simulation calculations at different simulation scales. and parameter output.
It realizes the use of appropriate simulation performance scales under different simulation scales to ensure consistent simulation event step sizes and improves the accuracy of simulation calculations and resource utilization.
Smart Images

Figure CN117216824B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of digital simulation, and more specifically, relates to an adaptive modeling method and system based on simulation effectiveness. Background Art
[0002] With the rapid development of computational science, simulation disciplines are gradually moving towards three-dimensional simulation. By constructing scenes in three-dimensional space and simulating the entire event process, three-dimensional simulation can be performed. This can obtain more intuitive simulation visual effects and can more holistically and intuitively show problems in the simulation process, making it easier to discover and solve problems.
[0003] In the current state of the art, since the operation of the three-dimensional scene model and the simulation process itself require very huge computing resources, the existing three-dimensional editors often do not have enough computing accuracy for simulation events, especially complex simulation events, which is unacceptable for simulations that require high precision. For simulation events with specific high-precision requirements, simulation calculations can only be performed through two-dimensional curves. After obtaining the simulation results, the simulation results are three-dimensionalized in the three-dimensional editor to obtain the three-dimensional simulation results of the entire simulation process. However, this approach is extremely easy to cause data misalignment due to the unstable frame rate of the three-dimensional editor, resulting in distortion of the three-dimensional simulation results. Especially for models with complex functions, when executing simulation requirements of different scales, only the same simulation performance scale can be used, which may cause the simulation to occupy too many computing resources due to the high simulation performance scale in large scene simulations, resulting in a lack of simulation computing resources, or in small scene simulations, the simulation performance scale is insufficient to meet the usage requirements due to the need to save computing power. Summary of the invention
[0004] The technical problem to be solved by the present invention is: in a simulation model with high precision requirements, how to achieve the use of different simulation performance scales and consistency of output data step lengths when executing simulation requirements of different simulation scales.
[0005] The present invention achieves the above object through the following technical solutions:
[0006] In a first aspect, a simulation efficiency-based adaptive modeling method is provided, comprising:
[0007] Constructing a simulation model, and planning the simulation model in a simulation scale level based on Euclidean distance to obtain simulation efficiency scales at different simulation scale levels;
[0008] According to each of the simulation performance scales, the simulation algorithms corresponding to the simulation scale levels are obtained respectively, and the simulation algorithms are packaged into a dynamic link library;
[0009] The simulation events are calculated separately according to the dynamic link library, and all simulation parameters are outputted simultaneously through the dynamic link library to ensure that the step length of the simulation events is fixed and consistent.
[0010] Preferably, the construction of the simulation model includes:
[0011] Constructing the construction factors of the simulation model according to the specific problem;
[0012] According to the functional attributes of the construction factors, the task factors of the simulation model are obtained;
[0013] Dividing the task factors into different task factor sets, and designing different simulation scales for each task factor set;
[0014] A simulation model is constructed based on the construction factors, the task factor set and the simulation scale.
[0015] Preferably, the construction of the simulation model further comprises:
[0016] Analyze each of the task factor sets to obtain external conditions that affect the functional attributes of the task factor set, and use the external conditions as the influencing factors corresponding to the task factor set;
[0017] The implementation of the task factor is triggered according to the influencing factor as a decision condition, and the task factor is used to drive the construction factor.
[0018] Preferably, the construction of the simulation model, performing simulation scale level planning on the simulation model based on Euclidean distance, and obtaining simulation efficiency scales at different simulation scale levels respectively, includes:
[0019] Modeling the appearance and structure of the simulation model to obtain a standard structure of the simulation model, and designing a corresponding simulation scene according to the standard structure of the simulation model;
[0020] According to the degree of difference between the simulation scenario and the simulation model, in each simulation scenario, taking the task complexity and the task order of magnitude as the center of the circle and taking the most complex task and the task order of magnitude in the simulation scenario as the radius, calculate the Euclidean distance between the simulation model and the center of the circle;
[0021] The simulation performance scale of the task factor set corresponding to the simulation scenario and the simulation scale level is determined according to the Euclidean distance to obtain the simulation performance scale corresponding to the simulation scale level.
[0022] Preferably, the steps of obtaining the simulation algorithms corresponding to the simulation scale levels according to the simulation performance scales and packaging the simulation algorithms into a dynamic link library include:
[0023] According to the simulation performance scale, a corresponding simulation algorithm is designed for each of the task factor sets, and the influencing factors are added to the simulation algorithm as external decision conditions, and the simulation algorithm after adding the influencing factors is encapsulated into a dynamic link library.
[0024] Preferably, the method of obtaining the simulation algorithms corresponding to the simulation scale levels according to the simulation performance scales, and packaging the simulation algorithms into a dynamic link library, further includes:
[0025] According to the simulation scale level, the dynamic link library of the task factor set is logically planned, and the dynamic link library after logical planning is attached to the construction factor.
[0026] Preferably, encapsulating the simulation algorithm into a dynamic link library comprises:
[0027] Selecting a corresponding simulation algorithm according to the simulation performance scale, developing a corresponding DLL (Dynamic Link Library) module for the simulation algorithm, and implementing the main functions of the simulation algorithm in the DLL module;
[0028] Write the export function description of the DLL module, export the main function through the export function description, compile and generate the DLL file corresponding to the task factor.
[0029] Preferably, the calculating of the simulation event separately according to the dynamic link library comprises:
[0030] In the three-dimensional editor, import the dynamic link library;
[0031] According to the order of the simulation scale levels, the corresponding task factors are called, and simulation calculation processing is performed on each task factor;
[0032] A complete algorithm logic is implemented within each task factor to achieve independent calculation of the task factor.
[0033] Preferably, the step of outputting all simulation parameters simultaneously through the dynamic link library to ensure that the step length of the simulation event is fixed and consistent includes:
[0034] In the DLL file of the task factor, all parameters after calculation of the current simulation event are output;
[0035] The three-dimensional editor receives parameters and saves them in a shared memory or a file;
[0036] Directly read the parameters output by the previous task as input through the DLL file of the next task factor;
[0037] The DLL file of each task factor is executed repeatedly to complete the calculation of all simulation events.
[0038] In a second aspect, an adaptive modeling system based on a simulation effectiveness scale is provided, comprising: a building module, a packaging module and a simulation calculation module;
[0039] The construction module is used to construct a simulation model, and the simulation model is subjected to simulation scale level planning based on Euclidean distance to obtain simulation efficiency scales at different simulation scale levels;
[0040] The encapsulation module is used to obtain the simulation algorithms corresponding to the simulation scale levels according to each of the simulation performance scales, and encapsulate the simulation algorithms into a dynamic link library;
[0041] The simulation calculation module is used to calculate the simulation event separately according to the dynamic link library, and output all simulation parameters simultaneously through the dynamic link library to ensure that the step length of the simulation event is fixed and consistent.
[0042] The beneficial effects of the present invention are:
[0043] On the one hand, the present invention obtains the simulation performance scale corresponding to different simulation scale requirements by combining the simulation performance scale determination based on Euclidean distance, thereby realizing that different simulation performance scales can be used when executing simulation requirements of different simulation scales; on the other hand, the present invention encapsulates the simulation algorithm corresponding to the simulation performance scale into a dynamic link library, and simultaneously outputs all simulation parameters through the dynamic link library, thereby ensuring that the step size of the simulation event is fixed and consistent. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific implementation methods, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the drawings:
[0045] Figure 1 It is a flowchart of an adaptive modeling method based on simulation efficiency provided by an embodiment of the present invention;
[0046] Figure 2 It is a schematic diagram of a construction simulation model process of an adaptive modeling method based on simulation efficiency provided by an embodiment of the present invention;
[0047] Figure 3 It is a schematic diagram of a model factor flow of an adaptive modeling method based on simulation efficiency provided by an embodiment of the present invention;
[0048] Figure 4 It is a flowchart of a specific method for determining the simulation effectiveness scale of an adaptive modeling method based on simulation effectiveness provided by an embodiment of the present invention;
[0049] Figure 5 It is a structural schematic diagram of an adaptive modeling system based on simulation effectiveness scale provided by an embodiment of the present invention;
[0050] Figure 6 It is a flow chart of a UAV modeling method based on an adaptive modeling method of simulation efficiency provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0052] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other. The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0053] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0054] Example 1
[0055] At present, for simulation models with high precision requirements, the calculation accuracy of current 3D editors often fails to meet the requirements, which easily leads to distortion of simulation results; and when executing simulation requirements of different simulation scales, only the same simulation performance scale can be used, resulting in waste or insufficiency of computing resources. In view of the defects of the prior art, this embodiment proposes an adaptive modeling method based on simulation performance, such as Figure 1 As shown, including:
[0056] Step 101: construct a simulation model, and perform simulation scale level planning on the simulation model based on Euclidean distance to obtain simulation performance scales at different simulation scale levels.
[0057] Among them, the simulation scale refers to the complexity and accuracy level of the simulation events considered in the simulation model. Different simulation events require different simulation scales to meet the needs; the simulation scale level refers to dividing the entire simulation scale into different levels, and the scale of each level is different; the simulation efficiency scale refers to the indicator used to evaluate the simulation performance, such as simulation speed, simulation accuracy and resource utilization. The simulation efficiency scale can be used to measure the performance and efficiency of the simulation tool, as well as to evaluate the reliability of the simulation results.
[0058] In one embodiment, a construction factor of the simulation model is constructed according to a specific problem; a task factor of the simulation model is obtained according to the functional attributes of the construction factor; the task factor is divided into different task factor sets, and a different simulation scale is designed for each task factor set; and a simulation model is constructed based on the construction factor, the task factor set and the simulation scale.
[0059] The specific process is as follows Figure 2 As shown, step 101 specifically includes:
[0060] Step 1011: Establish corresponding mathematical or physical models according to the actual problems that need to be simulated and studied.
[0061] Step 1012: Analyze the various components and structures of the simulation model and extract the structural factors of the model.
[0062] Step 1013: According to the functional attributes of the construction factors, identify and extract the tasks that need to be completed by the simulation model as task factors, stratify the identified task factors according to their complexity and importance, and divide the task factors into task factor sets considering their characteristics. Design appropriate simulation resolution or precision for the task factor sets at different levels, which is the simulation scale.
[0063] According to the numerical value of each simulation scale, the corresponding simulation performance scale parameter setting is determined, wherein the simulation performance scale parameters include time step, space step, etc., and the simulation performance scale is set according to these simulation performance scale parameters.
[0064] The construction factor refers to the physical entity that constitutes the simulation model; the task factor refers to the simulation event performed by the simulation model. For example, for the simulation model of a drone, the construction factor is the physical entity of the drone, which may specifically include the shell, seeker, rudder, engine, etc.; the task factor includes the capture of the seeker image, tracking of the target, engine thrust, real-time adjustment of the rudder, the influence of the atmosphere and the earth's gravity, etc.
[0065] In a preferred embodiment, each of the task factor sets is analyzed to obtain external conditions that affect the functional attributes of the task factor set, and the external conditions are used as the influencing factors corresponding to the task factor set; based on the influencing factors as decision conditions, the implementation of the task factors is triggered, and the task factors are used to drive the construction factors.
[0066] Among them, the influencing factors refer to the decision conditions given to the simulation model by the external environment, including spatial conditions, time, geographical information, model interaction conditions, human-computer interaction, etc. For the simulation model of the UAV, the influencing factors include: the atmosphere and gravity values set in the scene, the position and change trajectory of the target, visibility, the adjustment and change of the engine thrust, the trajectory control of the flight control computer, the launch event, etc.
[0067] The confirmation of the influencing factors includes analyzing each of the task factor sets to identify external conditions that affect the functions of the task factors at this level. For example, low-level tasks may be affected by physical parameters, and high-level tasks may be affected by user behavior.
[0068] For example, temperature and pressure are influencing factors of low-level tasks, and clicks and slides are influencing factors of high-level tasks. The corresponding task factors are triggered based on the value or change of the influencing factors as decision conditions. For example, if the temperature rises above the threshold, the heat conduction calculation task will be triggered. The underlying construction factors are driven according to the task factors to realize specific functions. For example, the heat conduction task drives the heat conduction equation construction factor to calculate the temperature field distribution. By identifying and designing influencing factors, the dependencies and driving mechanisms between tasks can be scientifically described, which is helpful to build an explainable and controllable simulation model.
[0069] So far, if Figure 3As shown, a serial structure of influencing factor → task factor → construction factor is obtained, with the task factor as the core function implementation, the construction factor as the external manifestation, and the influencing factor as the decision condition. The decision condition triggers the core function implementation and then drives the external manifestation. Here, after determining the simulation scale, the serial structure is reversed to form a standard structure with the most clear construction factor, and then the task factor is designed upward, and finally the influencing factor is expanded through the guidance of the task factor.
[0070] In a preferred embodiment, the specific determination method of the simulation performance scale is as follows: Figure 4 As shown, including:
[0071] Step 1021: Modeling the appearance and structure of the simulation model to obtain a standard structure of the simulation model.
[0072] Among them, the simulation model is modeled mainly according to the appearance characteristics, internal structure and composition of the simulation model to form a standard structure of the model. At this time, no core physical information is involved. For example, a car is modeled with a standard structure and a three-dimensional model is established. It has the appearance of a car, but there is no internal drive. At this time, the car cannot be driven.
[0073] Step 1022: Design a corresponding simulation scenario according to the standard structure of the simulation model.
[0074] Then, according to the standard structure, some simulation scenarios of different degrees are designed, such as external environments of different shapes or sizes, different numbers and types of internal components, or different behavioral characteristics, and the degree of difference between each simulation scenario and the standard structure is evaluated, such as the similarity between the shape of the simulation scenario environment and the shape of the model, the consistency of the number and type of internal components, etc. For example, in the simulation model of the drone, scenario 1 is set to conduct drone training for one drone pilot; scenario 2 is set to conduct drone confrontation training for two drone pilots; scenario 3 is set to conduct confrontation training for two drone pilot teams.
[0075] Step 1023: According to the degree of difference between the simulation scenario and the simulation model, in each simulation scenario, with the task complexity and the task magnitude as the center of the circle and the most complex task and task magnitude in the simulation scenario as the radius, calculate the Euclidean distance between the simulation model and the center of the circle.
[0076] In each simulation scenario, the task complexity and task magnitude are taken as the center of the circle, and the most complex task and task magnitude in the simulation scenario are taken as the standard radius. The Euclidean distance from each task factor of the simulation model to the center of the circle is calculated. The Euclidean distance reflects the distance between the simulation model and the most complex task in the simulation scenario. In this case, the task complexity and task magnitude are taken as the coordinate axes of the Euclidean distance. The Euclidean distance between the simulation model and the center of the circle is calculated by taking the most complex task and task magnitude in the simulation scenario as the center of the circle.
[0077] Assuming that the task complexity of the task factor is X1 and the task magnitude is Y1, the Euclidean distance between the task factor and the center of the circle is Where (x0, y0) are the coordinates of the center of the circle.
[0078] Step 1024: Determine the simulation performance scale of the task factor set corresponding to the simulation scenario and the simulation scale level according to the Euclidean distance to obtain the simulation performance scale corresponding to the simulation scale level.
[0079] According to the distance of the Euclidean distance, the simulation scene is matched to the simulation efficiency scale of different task factor sets. For example, the Euclidean distance is a small distance, corresponding to the detailed simulation scale, corresponding to the high-efficiency simulation scale; the Euclidean distance is a medium distance, corresponding to the medium simulation scale, corresponding to the medium simulation efficiency scale; the Euclidean distance is a large distance, corresponding to the rough simulation scale, corresponding to the low simulation efficiency scale. Through the above quantitative method, the optimal simulation efficiency scale parameter setting under different simulation scale scenarios can be automatically matched.
[0080] Among them, a design method of the large distance, medium distance and small distance of the Euclidean distance is as follows:
[0081] To determine whether the Euclidean distance is a large distance, a medium distance or a small distance, a certain threshold is first set: including first setting a maximum value, that is, the maximum Euclidean distance of the task complexity in the simulation scenario; dividing the maximum Euclidean distance value into 3 sections, namely: less than 1 / 3 of the maximum Euclidean distance value is a small distance, in the range of 1 / 3 of the maximum Euclidean distance value to 2 / 3 of the maximum Euclidean distance value is a medium distance, and more than 2 / 3 of the maximum Euclidean distance value is a large distance.
[0082] For example, assuming that the maximum Euclidean distance in a simulation scenario is 10, the small distance is less than 10 / 3 = 3.33; the medium distance is in the range of 3.33-6.67; and the large distance is greater than 6.67. You can also set more detailed thresholds, such as 5 or 10 segments, but the basic idea is to divide the distance range into multiple intervals evenly according to the maximum Euclidean distance value, and then judge the size relationship according to which interval the distance value falls into. This can give a quantitative standard and avoid the uncertainty caused by subjective judgment.
[0083] Step 102: obtaining simulation algorithms corresponding to the simulation scale levels according to the simulation performance scales, and encapsulating the simulation algorithms into a dynamic link library.
[0084] In a preferred embodiment, a corresponding simulation algorithm is designed for each of the task factor sets according to the simulation performance scale, and the influencing factors are added to the simulation algorithm as external decision conditions, and the simulation algorithm after adding the influencing factors is encapsulated into a dynamic link library.
[0085] According to the standard structure of the simulation model, the task factors involved in each construction factor are analyzed. After all the task factors are counted, task flow analysis diagrams at different simulation scale levels are planned, namely, the simulation scale level planning.
[0086] According to the simulation scale hierarchy planning, the level of the simulation performance scale is determined, and according to the Euclidean distance division mentioned above, the simulation performance scale is divided into different levels, such as high performance, medium performance and low performance; for each task factor set, according to its corresponding simulation performance scale, the corresponding simulation algorithm is designed, and according to the demand and resource constraints, the appropriate algorithm and technology are selected to meet the simulation requirements of the corresponding simulation performance scale.
[0087] For high-performance simulation algorithms: for task factor sets with high simulation performance scales, efficient algorithms and optimization techniques are used. These algorithms usually have lower computational complexity and higher simulation speed to achieve fast simulation and real-time response.
[0088] For medium-performance simulation algorithms: For a set of task factors with medium simulation performance scale, moderate algorithms and techniques are used. These algorithms are at a medium level in computational complexity and simulation speed, and can provide a certain degree of accuracy and practicality.
[0089] For low-performance simulation algorithms: For task factor sets with low simulation performance scales, simplified algorithms and techniques can be used. These algorithms usually have higher computational complexity, but can provide more accurate and detailed simulation results. Among them, the specific algorithm should be specifically set according to the actual simulation model and accuracy requirements, and will not be explained in detail in this embodiment.
[0090] According to the differences in the above-mentioned task factor sets, the corresponding algorithm flow and parameter settings are designed for each task factor set. According to the specific task requirements and simulation objectives, the input parameters, processing steps and output results of the algorithm are determined, and the simulation algorithm is implemented and verified. According to the designed algorithm flow and parameter settings, the corresponding code is written to implement the simulation algorithm. Through testing and verification, it is ensured that the algorithm can produce simulation results that meet the requirements of the simulation performance scale as expected.
[0091] After determining the simulation algorithm corresponding to each simulation scale level, the external influencing factor of the task factor can be analyzed as the influencing factor of the task factor according to the statistical task factor. The influencing factor can be used as the decision condition of the task factor. The influencing factor is added to the simulation algorithm as the external decision condition, and the simulation algorithm after adding the influencing factor is encapsulated into a dynamic link library. One achievable method is as follows:
[0092] According to the specific simulation requirements, determine the influencing factors that need to be considered, and define their types and possible value ranges. Introduce the influencing factors into the simulation algorithm. According to the types of the influencing factors, add corresponding input parameters or conditional judgment statements in the implementation code of the simulation algorithm to take the influencing factors into account in the simulation algorithm. For example, the motor simulation model of the UAV has a relatively small influencing factor. Only in small-grained simulation scenarios, such as the posture simulation of a single UAV, can this influencing factor act on the simulation scenario. At this time, it is necessary to run the motor simulation model specifically in the scenario).
[0093] In a preferred embodiment, after the influencing factors are added to the simulation algorithm, the simulation algorithm with the influencing factors added is encapsulated into a dynamic link library, which specifically includes: selecting the corresponding simulation algorithm according to the simulation performance scale, developing a corresponding DLL module for the simulation algorithm, and implementing the main function of the simulation algorithm in the DLL module; writing the export function description of the DLL module, exporting the main function through the export function description, compiling and generating a DLL file corresponding to the task factor.
[0094] The verified simulation algorithm is encapsulated into a dynamic link library for use in other corresponding applications. The code of the simulation algorithm is compiled into an executable binary file and contains necessary interfaces and function calls so that it can be dynamically loaded and called by other programs. The use of the dynamic link library can improve the reusability and scalability of the simulation algorithm, and facilitate integration and calling in different environments and platforms. By encapsulating the simulation algorithm with the added influencing factor into a dynamic link library, it can be easily called and used in various application scenarios, and the value of the influencing factor can be dynamically adjusted according to actual needs to achieve more flexible and customized simulation.
[0095] The more specific packaging process of the simulation algorithm is not described in detail in this embodiment.
[0096] In a preferred embodiment, the dynamic link library of the task factor set is logically planned according to the simulation scale level, and the dynamic link library after logical planning is attached to the construction factor.
[0097] Among them, according to the relationship between the simulation scale level and the task factor set, logical planning is performed to determine the task factor set corresponding to different simulation scale levels, as well as the dependencies and calling sequences between them. For example, when testing a vehicle model, the overall task is vehicle model testing, the task precondition is component testing, and the task body is testing under different conditions; according to the result of the above logical planning, the dynamic link library is attached to the construction factor, which can be achieved by introducing the corresponding dynamic link library call statement in the implementation code of the construction factor, and different dynamic link libraries can be dynamically loaded and called during the execution of the construction factor as needed.
[0098] The purpose of logic planning is to reasonably organize and call the dynamic link library according to the relationship between the simulation level and the task factor level, so as to realize the flexible processing and control of different simulation scales and task factors. In this way, the simulation model can be customized and configurable, and its simulation efficiency and accuracy can be improved.
[0099] According to step 101 and step 102, the corresponding simulation performance scale is obtained according to different simulation scale levels, each simulation performance scale corresponds to a specific task factor, the task factor is planned at the simulation scale level to obtain the corresponding task flow, and the task flow is encapsulated with a dynamic link library and mounted on the construction factor. After determining the simulation scale, the corresponding task flow is triggered by the influencing factor, thereby realizing high-precision calculation of simulation events.
[0100] Step 103: Calculate the simulation event separately according to the dynamic link library, and output all simulation parameters simultaneously through the dynamic link library to ensure that the step length of the simulation event is fixed and consistent.
[0101] The method of calculating the simulation events separately according to the dynamic link library includes: importing the dynamic link library in a three-dimensional editor; calling the corresponding task factors according to the order of the simulation scale levels, and performing simulation calculation processing on each task factor; and implementing a complete algorithm logic inside each task factor to realize independent calculation of the task factor.
[0102] Among them, in the development environment or script of the three-dimensional editor, the required dynamic link library is introduced so that the functions and methods therein can be called, which usually involves using appropriate programming languages and library functions to load and link the dynamic link library; according to the order of the simulation scale levels, the corresponding task factors are called in sequence according to the predetermined calling order, and according to the specific needs and the logical relationship of the task factors, it is ensured that the task factors are called in the correct order during the simulation process; when each task factor is called, the corresponding simulation calculation processing is performed according to the complete algorithm logic implemented internally; according to the input and output requirements of the task factor, the necessary parameters and data are provided, and the corresponding function or method is called to perform the simulation calculation.
[0103] Since each task factor implements complete algorithm logic, it can be calculated and processed independently, ensuring that during the simulation calculation process of each task factor, only the input and output required by the task factor are used, avoiding dependence on the calculation results of other task factors.
[0104] In a preferred embodiment, all simulation parameters are output simultaneously through the dynamic link library to ensure that the step size of the simulation event is fixed and consistent, including: in the DLL file of the task factor, all parameters after calculation of the current simulation event are output; the three-dimensional editor receives the parameters and saves them in a shared memory or file; the parameters output by the previous task are directly read as input through the DLL file of the next task factor; and the DLL file of each task factor is repeatedly executed to complete the calculation of all simulation events.
[0105] Among them, in the dynamic link library of each task factor, after the simulation calculation is completed, all the calculated parameters are output, and by defining appropriate functions, all the parameters are returned in the return value or output parameters of the function; in the three-dimensional editor, the output parameters of each task factor are received and saved in a shared memory or a file, and an appropriate data structure or file format can be used to organize and store the parameter data so that subsequent task factors can read and use it; for subsequent task factors, the parameters output by the previous task factor are directly read as input, and appropriate functions can be defined in the dynamic link library of each task factor to read the parameter data in the shared memory or file and use it as input for calculation processing.
[0106] The calculation process of each task factor is executed cyclically, and the output of the previous task factor is used as the input of the next task factor to complete the calculation of all simulation events, ensuring that the task factors are called and calculated in a predetermined order and step size to ensure that the step size of the simulation events is fixed and consistent.
[0107] Through step 103, parameter transfer and sharing can be achieved through the dynamic link library to ensure that the step size of the simulation event is fixed and consistent. The output parameters of each task factor are saved and used as input in the calculation of the next task factor, thereby achieving continuous transfer and utilization of parameters, thereby completing the calculation of all simulation events, which can ensure the continuity and accuracy of the simulation and improve the simulation efficiency.
[0108] The present embodiment provides an adaptive modeling method based on simulation performance. On the one hand, the embodiment of the present invention obtains the simulation performance scale corresponding to different simulation scale requirements by combining the simulation performance scale based on Euclidean distance, thereby realizing that different simulation performance scales can be used when executing simulation requirements of different simulation scales; on the other hand, the embodiment of the present invention encapsulates the simulation algorithm corresponding to the simulation performance scale into a dynamic link library, and outputs all simulation parameters at the same time through the dynamic link library, thereby ensuring that the step size of the simulation event is fixed and consistent.
[0109] Example 2
[0110] In Example 1, an adaptive modeling method based on simulation performance is provided. In this embodiment, an adaptive modeling system based on simulation performance scale is proposed to further illustrate the method. Figure 5 As shown, it includes: a construction module, a packaging module and a simulation calculation module; the construction module is used to construct a simulation model, and the simulation model is planned at a simulation scale level based on Euclidean distance to obtain simulation efficiency scales at different simulation scale levels; the packaging module is used to obtain simulation algorithms corresponding to the simulation scale levels according to each simulation efficiency scale, and package the simulation algorithms into a dynamic link library; the simulation calculation module is used to calculate simulation events separately according to the dynamic link library, and output all simulation parameters simultaneously through the dynamic link library to ensure that the step size of the simulation event is fixed and consistent.
[0111] The specific steps of the adaptive modeling method based on simulation efficiency are shown in Example 1, and will not be described in detail in this example.
[0112] Example 3
[0113] In Example 1 and Example 2, an adaptive modeling method and system based on simulation effectiveness are provided respectively. In this embodiment, an example is provided to further illustrate the adaptive modeling method based on simulation effectiveness.
[0114] Taking UAV as an example, the following is a UAV 3D modeling method based on the adaptive simulation efficiency scale of Euclidean distance. Figure 6 As shown, including:
[0115] Step 201: construct a simulation model of a UAV, perform simulation scale level planning on the simulation model of the UAV based on Euclidean distance, and obtain simulation performance scales at different simulation scale levels.
[0116] First, the structural factors of the UAV are modeled. The structural factors of the UAV are physical entities, including the shell, seeker, rudder, engine, etc.
[0117] Constructing the mission factors, according to the functional attributes of the UAV, its mission factors are defined into three levels: Mission factor set A corresponds to the simulation efficiency scale under the smallest scale. At this time, the mission factors include the capture of the seeker image, tracking of the target, the size of the engine thrust, the real-time adjustment of the rudder, the influence of the atmosphere and the earth's gravity, etc. There are more mission factors at this time; Mission factor set B corresponds to the simulation efficiency scale under the medium scale. At this time, the mission factors include setting targets and flight simulation. Compared with mission factor set A, the flight simulation at this time ignores the set values of the atmosphere and gravity in the scene and adopts fixed values; Mission factor set C corresponds to the simulation efficiency scale under the large scale. The corresponding mission factors include the calculation of the probability of accurate positioning and the calculation of the probability of pursuit. Compared with the first two mission factors, it only focuses on the results and pursues the minimization of computing resource consumption.
[0118] After determining the mission factors, the triggering external influencing factors of the mission factors are determined according to the mission factors. For mission factor set A, its external influencing factors include the atmosphere and gravity values set in the scene, the position and change trajectory of the target, visibility, adjustment and change of engine thrust, trajectory control of the flight control computer, launch events, etc.; for mission factor set B, its external influencing factors include the position and change trajectory of the target, trajectory control of the flight control computer, launch events, etc.; for mission factor set C, its external influencing factors include the target position and launch events.
[0119] To determine the simulation effectiveness scale, we first set the simulation scenarios. Scenario 1 is for one drone pilot to conduct drone training; Scenario 2 is for two drone pilots to conduct drone confrontation training; Scenario 3 is for two drone pilot teams to conduct confrontation training. According to the scale based on Euclidean distance, the most complex task of drones is flight control, which has a task order of magnitude of 10 2 The most complex task in scenario 1 is the control of the flight trajectory, which is at the order of magnitude of 10 2 The most complex task in scenario 2 is drone radar, etc., and the task order of magnitude is 10 4 The most complex task in scenario 3 is multiple drones chasing each other, with a task order of magnitude of 10 5 Level; According to the judgment method based on Euclidean distance, scenario 1 is applicable to task factor set A, scenario 2 is applicable to task factor set B, and scenario 3 is applicable to task factor set C.
[0120] The task factor set is formed into a task flow according to logic, and three levels of task flow are formed for the UAV: Task factor set A forms task flow X: launch event → engine thrust → influence of atmosphere and earth gravity → capture of the guidance head image → real-time adjustment of the control surface → tracking of the target, etc.; Task factor set B forms task flow Y: setting the target → flight simulation; Task factor set C forms task flow Z: confirming the launch → calculating the probability of pursuit.
[0121] The simulation scale level planning of the UAV simulation model is obtained from step 201, namely the task flow X, task flow Y and task flow Z mentioned above, and each task flow corresponds to a different simulation performance scale.
[0122] Step 202: obtaining simulation algorithms corresponding to the simulation scale levels according to the simulation performance scales, and encapsulating the simulation algorithms into a dynamic link library.
[0123] For each of the above task factors, an algorithm is performed separately, and the above influencing factors are added to the algorithm as decision conditions and encapsulated as a dynamic link library; according to the task flow, the dynamic link library of the task factor is logically planned and attached to the corresponding construction factor.
[0124] Among them, the simulation algorithm corresponding to each mission factor of the drone is not described in detail in this embodiment. For the encapsulation of the simulation algorithm, please refer to Example 1, which will not be repeated in this embodiment.
[0125] Step 203: Calculate the simulation event separately according to the dynamic link library, and output all simulation parameters simultaneously through the dynamic link library to ensure that the step length of the simulation event is fixed and consistent.
[0126] At this point, the simulation model is placed in the three-dimensional environment required for testing, and three-dimensional simulation verification can be performed. At this point, the modeling method for implementing high-precision simulation calculation of UAV simulation effectiveness scale adaptation based on Euclidean distance in a three-dimensional editor is completed.
[0127] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An adaptive modeling method based on simulation performance, characterized in that: include: A simulation model of the UAV is constructed, and the simulation model is subjected to simulation scale level planning based on Euclidean distance to obtain simulation efficiency scales at different simulation scale levels; The simulation model of building a drone includes: Constructing the construction factors of the simulation model according to the specific problem, wherein the construction factors are the physical entities of the UAV, including the shell, the seeker, the control surface and the engine; According to the functional attributes of the construction factors, the task factors of the simulation model are obtained, wherein the task factors include the capture of the seeker image, the tracking of the target, the thrust of the engine, the real-time adjustment of the control surface, and the influence of the atmosphere and the earth's gravity; Dividing the task factors into different task factor sets, and designing different simulation scales for each task factor set; constructing a simulation model based on the construction factor, the task factor set and the simulation scale; The construction of the UAV simulation model, and the simulation model are subjected to simulation scale level planning based on Euclidean distance, and the simulation performance scales at different simulation scale levels are obtained respectively, including: Modeling the appearance and structure of the simulation model to obtain a standard structure of the simulation model; Designing a corresponding simulation scenario according to the standard structure of the simulation model; According to the degree of difference between the simulation scenario and the simulation model, in each simulation scenario, taking the task complexity and the task order of magnitude as the center of the circle and taking the most complex task and the task order of magnitude in the simulation scenario as the radius, calculate the Euclidean distance between the simulation model and the center of the circle; Determine the simulation performance scale of the task factor set corresponding to the simulation scenario and the simulation scale level according to the Euclidean distance to obtain the simulation performance scale corresponding to the simulation scale level; obtain the simulation algorithm corresponding to the simulation scale level according to each of the simulation performance scales, and encapsulate the simulation algorithm into a dynamic link library; The simulation events are calculated separately according to the dynamic link library, and all simulation parameters are outputted simultaneously through the dynamic link library to ensure that the step length of the simulation events is fixed and consistent.
2. The adaptive modeling method based on simulation effectiveness according to claim 1, characterized in that: The construction of the simulation model also includes: Analyze each of the task factor sets to obtain external conditions that affect the functional attributes of the task factor set, and use the external conditions as the influencing factors corresponding to the task factor set, wherein the influencing factors include: the atmosphere and gravity values set in the scene, the position and change trajectory of the target, visibility, adjustment and change of engine thrust, trajectory control of the flight control computer, and launch events; The implementation of the task factor is triggered according to the influencing factor as a decision condition, and the task factor is used to drive the construction factor.
3. The adaptive modeling method based on simulation effectiveness according to claim 1, characterized in that: The step of obtaining the simulation algorithms corresponding to the simulation scale levels according to the simulation performance scales, and packaging the simulation algorithms into a dynamic link library includes: According to the simulation effectiveness scale, a corresponding simulation algorithm is designed for each of the task factor sets, and an influencing factor is added to the simulation algorithm as an external decision condition; The simulation algorithm after adding the influencing factors is encapsulated into a dynamic link library.
4. The adaptive modeling method based on simulation effectiveness according to claim 3, characterized in that: The step of obtaining the simulation algorithms corresponding to the simulation scale levels according to the simulation performance scales and packaging the simulation algorithms into a dynamic link library further includes: According to the simulation scale level, the dynamic link library of the task factor set is logically planned, and the dynamic link library after logical planning is attached to the construction factor.
5. The adaptive modeling method based on simulation effectiveness according to claim 3, characterized in that: The step of packaging the simulation algorithm into a dynamic link library comprises: Selecting a corresponding simulation algorithm according to the simulation performance scale, developing a corresponding DLL module for the simulation algorithm, and implementing the main functions of the simulation algorithm in the DLL module; Write the export function description of the DLL module, export the main function through the export function description, compile and generate the DLL file corresponding to the task factor.
6. The adaptive modeling method based on simulation effectiveness according to claim 5, characterized in that: The step of calculating the simulation event separately according to the dynamic link library comprises: In the three-dimensional editor, import the dynamic link library; According to the order of the simulation scale levels, the corresponding task factors are called, and simulation calculation processing is performed on each task factor; A complete algorithm logic is implemented within each task factor to achieve independent calculation of the task factor.
7. The adaptive modeling method based on simulation effectiveness according to claim 6, characterized in that: The step of outputting all simulation parameters simultaneously through the dynamic link library to ensure that the step length of the simulation event is fixed and consistent includes: In the DLL file of the task factor, all parameters after calculation of the current simulation event are output; The three-dimensional editor receives parameters and saves them in a shared memory or a file; Directly read the parameters output by the previous task as input through the DLL file of the next task factor; The DLL file of each task factor is executed repeatedly to complete the calculation of all simulation events.
8. An adaptive modeling system based on simulation performance scale, characterized in that: The system is used to implement the adaptive modeling method based on simulation effectiveness as described in any one of claims 1 to 7, comprising: a construction module, a packaging module and a simulation calculation module; The construction module is used to construct a simulation model of the UAV, and the simulation model is subjected to simulation scale level planning based on Euclidean distance to obtain simulation efficiency scales at different simulation scale levels; The encapsulation module is used to obtain the simulation algorithms corresponding to the simulation scale levels according to each of the simulation performance scales, and encapsulate the simulation algorithms into a dynamic link library; The simulation calculation module is used to calculate the simulation event separately according to the dynamic link library, and output all simulation parameters simultaneously through the dynamic link library to ensure that the step length of the simulation event is fixed and consistent.
