A method, apparatus, and related equipment for predicting the calculation time of real-time power simulation.
By executing simulation tasks multiple times on a non-real-time simulation platform, obtaining time overhead and filtering out jitter, the computation time of real-time simulation can be accurately estimated. This solves the problem of simulation algorithm iteration testing relying on high-cost hardware and achieves low-cost and efficient simulation algorithm evaluation.
Patent Information
- Application Number
- CN202211095866.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-08
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-09-08
AI Technical Summary
Accurately predict the calculation time of real-time power simulation on non-real-time operating systems, and solve the problem that simulation algorithm iteration testing depends on high-cost hardware platforms.
By executing preset and target simulation tasks multiple times on a non-real-time simulation platform, the time cost is obtained and combined with jitter data. Outliers are filtered out using a sliding window, and the time cost of the target simulation task in the real-time simulation platform is calculated.
The computation time of simulation algorithms on real-time platforms can be evaluated without relying on high-cost real-time simulation platforms, reducing iterative testing costs and improving the efficiency of simulation algorithm iterative testing.
Smart Images

Figure CN115577498B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power simulation technology, and more specifically, to a method, apparatus, and related equipment for estimating the calculation time of real-time power simulation. Background Technology
[0002] In recent years, power system simulation calculations have increasingly relied on the powerful computing capabilities of computing hardware systems to accelerate the solution process, enabling both non-real-time and even real-time simulation calculations. Real-time simulation calculations depend on real-time operating systems on dedicated embedded hardware, while non-real-time simulations rely on non-real-time operating systems such as Windows.
[0003] Real-time simulation can be externally connected to achieve hardware-in-the-loop simulation, thus it has its own independent necessity. In real-time simulation, the determinism of computation time is crucial; if the computation time exceeds the simulation step size, the entire computation becomes invalid. Therefore, the real-time operating system upon which real-time simulation relies strives to ensure that each core performs only one task without interruption. That is, the difference between the maximum and minimum computation time of the same computational task due to interruptions or other disturbances is very small, i.e., jitter time is very small, generally less than 10μs. In some existing real-time operating systems, this jitter time can be less than 5μs. However, the development and debugging of real-time simulations must rely on dedicated hardware platforms, while the development of simulation algorithms requires rapid iterative testing. Therefore, the reliance on dedicated hardware platforms is quite stringent and detrimental to the iterative testing of algorithms.
[0004] Conversely, non-real-time simulation only requires a Windows system on a regular laptop or workstation, which facilitates development and debugging.
[0005] Therefore, how to test the computation speed of simulation algorithms on non-real-time operating systems, so as to accurately predict the computation time of the same simulation computation in a real-time operating system, is a problem that needs to be studied. Summary of the Invention
[0006] In view of this, this application provides a method, apparatus and related equipment for estimating the computation time of real-time power simulation, so as to estimate the computation time of real-time simulation through a non-real-time simulation platform.
[0007] To achieve the above objectives, the first aspect of this application provides a method for estimating the calculation time of real-time power simulation, comprising:
[0008] Obtain the first time cost of running a preset simulation task in a preset real-time simulation platform;
[0009] Obtain the second time cost of the simulation task running in a preset non-real-time simulation platform;
[0010] Obtain the third time cost of running the target simulation task on the non-real-time simulation platform;
[0011] Based on the first time cost, the second time cost, and the third time cost, the target time cost for the target simulation task to run in the real-time simulation platform is determined.
[0012] Preferably, the process of obtaining the first time cost of the preset simulation task running in the preset real-time simulation platform includes:
[0013] The simulation task is executed N1 times using a preset real-time simulation platform to obtain N1 time costs, where N1 is a preset natural number and N1≥100000.
[0014] The first time cost is obtained by averaging the N1 time costs.
[0015] The process of obtaining the second time cost of the simulation task running in a preset non-real-time simulation platform includes:
[0016] The simulation task is executed N2 times using a preset non-real-time simulation platform to obtain N2 time costs, where N2 is a preset natural number and N2≥100000;
[0017] The second time cost is obtained by averaging the N2 time costs.
[0018] Preferably, it further includes:
[0019] The time jitter data of the target simulation task running in the real-time simulation platform is obtained. The time jitter data includes the estimated maximum value, estimated minimum value and estimated jitter time of the target simulation task running in the real-time simulation platform.
[0020] Preferably, the process of acquiring the time jitter data of the target simulation task running in the real-time simulation platform includes:
[0021] Based on a preset first jitter threshold, a second jitter threshold is determined. The first jitter threshold is the maximum jitter value allowed under a real-time simulation platform, and the second jitter threshold is the maximum jitter value allowed under a non-real-time simulation platform.
[0022] The target simulation task is executed N3 times using a preset non-real-time simulation platform to obtain N3 time costs, where N3 is a preset natural number and N3≥10000;
[0023] A time cost sequence is constructed using the N3 time costs, and the time cost sequence contains N3 elements;
[0024] Using the second jitter threshold, outliers in the time cost sequence are removed to obtain the target time cost sequence;
[0025] Based on the target time cost sequence, time jitter data is determined.
[0026] Preferably, the process of using the second jitter threshold to remove outliers from the time cost sequence to obtain the target time cost sequence includes:
[0027] Step A: Assign the time cost sequence to the target processing sequence;
[0028] Step B: Starting from the first element of the target processing sequence, a sliding window of a preset size slides in the target processing sequence with a preset step size to obtain multiple time cost subsequences.
[0029] Step C: Obtain the minimum and maximum values of each time cost subsequence, and subtract the minimum value from the maximum value to obtain the difference value of each time cost subsequence;
[0030] Step D: Determine whether the difference value of each time cost subsequence is less than the second jitter threshold; if yes, proceed to step E; if no, proceed to step F.
[0031] Step E: Directly determine the target processing sequence as the target time cost sequence;
[0032] Step F: For each time cost subsequence, determine whether the difference value of the time cost subsequence is less than the median difference value, where the median difference value is half of the maximum difference value among the time cost subsequences; if so, proceed to step G.
[0033] Step G: Determine the time cost subsequence as the subsequence to be retained;
[0034] Step H: Based on each subsequence to be retained, construct a new time cost sequence, assign the new time cost sequence to the target processing sequence, and return to execute step B.
[0035] Preferably, the process of determining time jitter data based on the target time cost sequence includes:
[0036] The minimum value in the target time cost sequence is determined as the estimated minimum value, the maximum value in the target time cost sequence is determined as the estimated maximum value, and the difference between the estimated maximum value and the estimated minimum value is the estimated jitter time.
[0037] Preferably, the process of determining the second jitter threshold based on a preset first jitter threshold includes:
[0038] The second jitter threshold is determined based on the first time cost, the second time cost, and the first jitter threshold.
[0039] A second aspect of this application provides a device for predicting the calculation time of real-time power simulation, comprising:
[0040] The first overhead acquisition unit is used to acquire the first time overhead of a preset simulation task running in a preset real-time simulation platform.
[0041] The second overhead acquisition unit is used to acquire the second time overhead of the simulation task running in a preset non-real-time simulation platform.
[0042] The third overhead acquisition unit is used to acquire the third time overhead of the target simulation task running in the non-real-time simulation platform.
[0043] The target overhead acquisition unit is used to determine the target time overhead of the target simulation task running in the real-time simulation platform based on the first time overhead, the second time overhead, and the third time overhead.
[0044] A third aspect of this application provides a device for estimating the computation time of real-time power simulation, comprising: a memory and a processor;
[0045] The memory is used to store programs;
[0046] The processor is used to execute the program to implement each step of the above-described method for estimating the real-time power simulation calculation time.
[0047] The fourth aspect of this application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the various steps of the method for estimating the real-time power simulation calculation time as described above.
[0048] As can be seen from the above technical solution, this application first obtains the first time cost of a preset simulation task running in a preset real-time simulation platform, and the second time cost of the simulation task running in a preset non-real-time simulation platform. It is understood that the preset simulation task is a reference simulation task, which can be used to evaluate the time cost of other simulation tasks in both the non-real-time and real-time simulation platforms. Then, based on the target simulation task to be evaluated, its third time cost running in the non-real-time simulation platform is obtained. Finally, based on the first, second, and third time costs, the target time cost of the target simulation task running in the real-time simulation platform is determined. This application enables the evaluation of the time cost of a target simulation task running in a real-time simulation platform using its time cost in a non-real-time simulation platform, eliminating the need to rely on a high-cost real-time simulation platform and reducing the cost of iterative testing of simulation algorithms. Furthermore, the readily available and multi-core, multi-task parallel processing capabilities of non-real-time simulation platforms improve the efficiency of iterative testing of simulation algorithms. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0050] Figure 1 This is a schematic diagram of the method for estimating the real-time power simulation calculation time disclosed in the embodiments of this application;
[0051] Figure 2 This is another schematic diagram of the method for estimating the real-time power simulation calculation time disclosed in the embodiments of this application;
[0052] Figure 3 A schematic diagram illustrating the time cost sequence with outliers disclosed in an embodiment of this application is provided.
[0053] Figure 4 This is a flowchart of the method for obtaining a target time cost sequence disclosed in an embodiment of this application;
[0054] Figure 5 This is a schematic diagram illustrating the removal of jitter from a time-cost sequence as disclosed in an embodiment of this application;
[0055] Figure 6 This is a schematic diagram of the simulation task result comparison device disclosed in the embodiments of this application;
[0056] Figure 7 This is a schematic diagram of the simulation task result comparison device disclosed in the embodiments of this application. Detailed Implementation
[0057] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0058] The inventors of this application have discovered that simulation in a non-real-time environment facilitates the verification of the correctness of the simulation algorithm and the optimization of its performance; by conducting multiple iterative tests in a non-real-time environment before transferring to a real-time environment for simulation, the unknown factors caused by hardware and the problem of low debugging efficiency can be reduced.
[0059] Specifically, the CPUs used in real-time simulation and those used in non-real-time simulation are essentially the same; they all have key metrics such as frequency (which is further divided into base frequency and turbo frequency) and IPC (instructions executed per clock cycle). A single-core CPU's performance is approximately equal to IPC multiplied by its frequency. Both IPC and frequency are related to the CPU's design architecture and manufacturing process, but once the specific CPU model is determined, the IPC is fixed, and the CPU's performance is only related to its inherent frequency. Turbo Boost allows the CPU to briefly increase its frequency as needed, but it is disabled by default in real-time simulation.
[0060] Therefore, in this application, Turbo Boost is disabled for both real-time and non-real-time CPUs. Assume that real-time simulation uses CPU model 1, IPC is IPC1, base frequency is F1, and the computation time for the preset simulation task is t1; non-real-time simulation uses CPU model 2, IPC is IPC2, base frequency is F2, and the computation time for the preset simulation task is t2. Then, theoretically, the performance ratio of CPU1 to CPU2 is IPC1*F1 to IPC2*F2, so t1 = t2·IPC1·F1 / (IPC2·F2).
[0061] However, since IPC is labeled by the manufacturer and is only for reference, it is not entirely accurate. Therefore, it is necessary to use authoritative benchmarking software to obtain the actual performance. In practical applications, the same simulation task can be run continuously 100,000 or more times on both real-time and non-real-time simulation platforms to obtain the average time T1 and T2 respectively. The correction formula is then t1 = t2·T1 / T2.
[0062] Based on this, the method for estimating the real-time power simulation calculation time provided in the embodiments of this application is described below. Please refer to... Figure 1 The method for estimating the real-time power simulation calculation time provided in this application embodiment may include the following steps:
[0063] Step S101: Obtain the first time cost of running the preset simulation task in the preset real-time simulation platform.
[0064] The preset simulation task can serve as a benchmark to evaluate the computing power of the real-time simulation platform. The first time cost is the time spent executing the preset simulation task on the real-time simulation platform. To eliminate environmental influences, for example, the task can be executed continuously a sufficient number of times on the real-time simulation platform, such as 100,000 times, and the average time spent each time can be taken to obtain the first time cost.
[0065] Step S102: Obtain the second time cost of running the simulation task in a preset non-real-time simulation platform.
[0066] The second time cost is the time spent executing the preset simulation task on a non-real-time simulation platform. Similarly, to eliminate environmental influences, for example, the task can be executed continuously a sufficient number of times on a non-real-time simulation platform, such as 100,000 times, and then the average time spent each time can be taken to obtain the second time cost.
[0067] Step S103: Obtain the third time cost of the target simulation task running on the non-real-time simulation platform.
[0068] The target simulation task is the simulation task to be evaluated. If a simulation algorithm has been modified by an engineer and its functionality and performance need to be tested, the target simulation task is executed in a non-real-time simulation platform in order to obtain the third time cost.
[0069] Step S104: Based on the first time cost, the second time cost, and the third time cost, determine the target time cost for the target simulation task to run in the real-time simulation platform.
[0070] Since the first time cost represents, to some extent, the time cost required to execute the preset simulation task on a real-time simulation platform, and the second time cost represents, to some extent, the time cost required to execute the same simulation task on a non-real-time simulation platform, the ratio of the first time cost to the second time cost can represent the execution capabilities of the real-time and non-real-time simulation platforms. Combining this with the third time cost, the target time cost for the target simulation task to run on the real-time simulation platform can be easily calculated.
[0071] This application first obtains the first time cost of a preset simulation task running on a preset real-time simulation platform, and the second time cost of the same task running on a preset non-real-time simulation platform. It is understood that the preset simulation task is a reference simulation task, which can be used to evaluate the time cost of other simulation tasks on both the non-real-time and real-time simulation platforms. Then, based on the target simulation task to be evaluated, its third time cost running on the non-real-time simulation platform is obtained. Finally, based on the first, second, and third time costs, the target time cost of the target simulation task running on the real-time simulation platform is determined. This application enables the evaluation of the time cost of a target simulation task running on a real-time simulation platform using its time cost on a non-real-time simulation platform, eliminating the need to rely on high-cost real-time simulation platforms and reducing the cost of iterative testing of simulation algorithms. Furthermore, the readily available and multi-core, multi-task parallel processing capabilities of non-real-time simulation platforms improve the efficiency of iterative testing of simulation algorithms.
[0072] In some embodiments of this application, the process of obtaining the first time cost of a preset simulation task running in a preset real-time simulation platform in step S101 may include:
[0073] S1, use a preset real-time simulation platform to execute the simulation task N1 times, and obtain N1 time costs.
[0074] Wherein, N1 is a preset natural number, and N1≥100000.
[0075] S2, take the average of the N1 time costs to obtain the first time cost.
[0076] The first time cost T1 is calculated using the following equation:
[0077]
[0078] Among them, t1 i It is the i-th time cost among the N1 time costs.
[0079] In some embodiments of this application, the process of obtaining the second time cost of the simulation task running in a preset non-real-time simulation platform in step S102 above may include:
[0080] S1, use a preset non-real-time simulation platform to execute the simulation task N2 times, and obtain N2 time costs.
[0081] Where N2 is a preset natural number, and N2≥100000.
[0082] S2, take the average of the N2 time costs to obtain the second time cost.
[0083] The first time cost T2 is calculated using the following equation:
[0084]
[0085] Among them, t2 i It is the i-th time cost among the N2 time costs.
[0086] Understandably, when N2 is large enough, the impact of computational jitter inherent in non-real-time simulation platforms becomes very small.
[0087] In both real-time and non-real-time simulation environments, two factors influence their actual runtime: the difference in CPU performance and the variation in jitter time caused by environmental differences. For the former, the above embodiments quantitatively evaluated CPU performance using the same standard simulation task; however, for the latter, it's necessary to filter out the jitter effect as much as possible. In reality, Windows jitter times vary considerably, ranging from as low as tens of microseconds to as high as 10 milliseconds or more. While the above embodiments theoretically and practically provide methods for estimating real-time simulation time using non-real-time simulation, these are based on the assumption of no jitter. Therefore, it's first necessary to use jitter filtering methods to determine the actual runtime of the same standard simulation model across a large amount of continuous data in both non-real-time and real-time simulations.
[0088] Based on this, please refer to some embodiments of this application. Figure 2 The method for estimating the real-time power simulation calculation time may also include:
[0089] Step S105: Obtain the time jitter data of the target simulation task running in the real-time simulation platform.
[0090] The time jitter data may include the estimated maximum value, estimated minimum value, and estimated jitter time of the target simulation task running on the real-time simulation platform.
[0091] Specifically, the simulation task is one in which, within a specified simulation duration (e.g., 1 second), each simulation step (e.g., 50 μs) is executed once. The actual execution time for each step is not exactly the same. Based on the 1-second simulation duration and 50 μs simulation step, a total of 200,000 executions are required. The execution time for each step forms a sequence {t1, t2, ..., t...}. N}, where N = 200,000, and the maximum value t of the sequence. max and minimum value t minThe difference is the jitter time t in the execution time. max-min For a simulation task, we want the "actual running time" to include the maximum, minimum, and jitter times of its sequence.
[0092] In some embodiments of this application, the process of obtaining the time jitter data of the target simulation task running in the real-time simulation platform in step S105 above may include:
[0093] S1, determine the second jitter threshold based on the preset first jitter threshold.
[0094] Wherein, the first jitter threshold is the maximum jitter value allowed under the real-time simulation platform, and the second jitter threshold is the maximum jitter value allowed under the non-real-time simulation platform. The second jitter threshold Δt2 can be calculated using the first jitter threshold Δt1 and the aforementioned correction formula:
[0095] Δt2=Δt1·T2 / T1
[0096] For example, the first jitter threshold can be any other desired maximum jitter time allowed in a real-time simulation platform, such as 5μs, 10μs, or 20μs. For instance, assuming the first jitter threshold is 10μs, then the second jitter threshold is (10μs)·T2 / T1.
[0097] S2, using a preset non-real-time simulation platform, execute the target simulation task N3 times, obtaining N3 time costs: t21, t22, ..., t2 N3 .
[0098] Wherein, N3 is a preset natural number, and N3≥10000.
[0099] S3, construct a time cost sequence using the N3 time costs.
[0100] The time cost sequence consists of N3 time costs, containing a total of N3 elements, and can be specifically represented as follows:
[0101] A={t2 i |i=1,2,3,…N3}
[0102] S4. Using the second jitter threshold, outliers in the time cost sequence are removed to obtain the target time cost sequence.
[0103] For example, such as Figure 3 As shown, the obtained time cost sequence may contain some outliers. The second jitter threshold can be used to remove the outliers from the time cost sequence using a certain algorithm, thereby obtaining the target time cost sequence.
[0104] S5. Based on the target time cost sequence, determine the time jitter data.
[0105] In some embodiments of this application, please also refer to Figure 4 and Figure 5 The process of S4 above, which uses the second jitter threshold to remove outliers from the time cost sequence to obtain the target time cost sequence, may include:
[0106] S40, assign the time cost sequence to the target processing sequence.
[0107] After assignment, the target processing sequence has the same elements as the time cost sequence.
[0108] S41, taking the first element of the target processing sequence as the starting point, a sliding window of a preset size slides in the target processing sequence with a preset step size to obtain multiple time cost subsequences.
[0109] Based on test statistics, the maximum number of jitters is generally 1, and the probability of M consecutive jitters (generally M≤5) is almost 0. To ensure accuracy, the preset size can be set to 10. For a target processing sequence of length N3, there are a total of N3-(M-1) time-cost subsequences.
[0110] S42, obtain the minimum and maximum values of each time cost subsequence, and subtract the minimum value from the maximum value to obtain the difference value of each time cost subsequence.
[0111] S43, determine whether the difference value of each time cost subsequence is less than the second jitter threshold; if yes, execute S44; if no, execute S45.
[0112] S44, directly determine the time cost sequence as the target time cost sequence.
[0113] S45, For each time cost subsequence, determine whether the difference value of the time cost subsequence is less than the median difference; if so, execute S46.
[0114] The median value of this gap is half of the maximum value among the gap values of each time cost subsequence.
[0115] S46, the time-cost subsequence is determined as the subsequence to be retained.
[0116] S47. Based on each subsequence to be retained, construct a new time cost sequence and assign the new time cost sequence to the target processing sequence, then return to execute S41.
[0117] In some embodiments of this application, the process of determining time jitter data based on the target time cost sequence in step S5 may include:
[0118] S51, determine the minimum value in the target time cost sequence as the estimated minimum value.
[0119] S52, determine the maximum value in the target time cost sequence as the estimated maximum value.
[0120] S53, the difference between the estimated maximum value and the estimated minimum value is the estimated jitter time.
[0121] From the above calculation process of the first time cost T1 and the second time cost T2, it can be seen that although when N2 is large enough, the impact of the inherent computational jitter of the non-real-time simulation platform becomes very small, the second jitter threshold Δt2 is itself obtained by solving T1 and T2 without filtering out jitter. Therefore, to further improve the accuracy, several iterations can be performed.
[0122] Specifically, the original time overhead sequence A1[1] obtained by CPU1 using a preset standard simulation task is used to calculate the second jitter threshold Δt2[1] using the first time overhead T1[1] and the second time overhead T2[1] calculated according to the above embodiment.
[0123] Next, the first version R1[1] = F(A1[1], Δt2[1]) is calculated, and the average value of R1[1] is obtained to get R1_avr[1]; similarly, A2[1] and R2_avr[1] are obtained in CPU2. Let the new T1[2] = R1_avr[1] and the new T2[2] = R2_avr[1] as more accurate first time cost and second time cost, and further calculate the more accurate second jitter threshold Δt2[2].
[0124] And so on, we obtain Δt2[3], Δt2[4], ..., until we consider Δt2 to be sufficiently accurate. Optionally, one method of judgment is that Δt2[i] in a certain time and Δt2[i-1] in the previous time satisfy:
[0125]
[0126] Where σ is a preset threshold, which can be 1%, 2%, or 5%, etc., depending on the actual experimental data. Then, Δt2[i] is the precise second jitter threshold, and the corresponding R1[i] and R2[i] are the precise first and second time costs.
[0127] The following describes the power real-time simulation calculation time estimation device provided in the embodiments of this application. The power real-time simulation calculation time estimation device described below can be referred to in correspondence with the power real-time simulation calculation time estimation method described above.
[0128] Please see Figure 6 The power real-time simulation calculation time estimation device provided in this application embodiment may include:
[0129] The first overhead acquisition unit 21 is used to acquire the first time overhead of a preset simulation task running in a preset real-time simulation platform.
[0130] The second overhead acquisition unit 22 is used to acquire the second time overhead of the simulation task running in a preset non-real-time simulation platform.
[0131] The third overhead acquisition unit 23 is used to acquire the third time overhead of the target simulation task running in the non-real-time simulation platform.
[0132] The target overhead acquisition unit 24 is used to determine the target time overhead of the target simulation task running in the real-time simulation platform based on the first time overhead, the second time overhead and the third time overhead.
[0133] In some embodiments of this application, the process by which the first overhead acquisition unit 21 acquires the first time overhead of a preset simulation task running in a preset real-time simulation platform may include:
[0134] The simulation task is executed N1 times using a preset real-time simulation platform to obtain N1 time costs, where N1 is a preset natural number and N1≥100000.
[0135] The first time cost is obtained by averaging the N1 time costs.
[0136] The process of obtaining the second time cost of the simulation task running in a preset non-real-time simulation platform includes:
[0137] The simulation task is executed N2 times using a preset non-real-time simulation platform to obtain N2 time costs, where N2 is a preset natural number and N2≥100000;
[0138] The second time cost is obtained by averaging the N2 time costs.
[0139] In some embodiments of this application, the device for estimating the real-time power simulation calculation time may further include a jitter removal unit, which is used for:
[0140] The time jitter data of the target simulation task running in the real-time simulation platform is obtained. The time jitter data includes the estimated maximum value, estimated minimum value and estimated jitter time of the target simulation task running in the real-time simulation platform.
[0141] In some embodiments of this application, the process by which the jitter removal unit acquires the time jitter data of the target simulation task running in the real-time simulation platform may include:
[0142] Based on a preset first jitter threshold, a second jitter threshold is determined. The first jitter threshold is the maximum jitter value allowed under a real-time simulation platform, and the second jitter threshold is the maximum jitter value allowed under a non-real-time simulation platform.
[0143] The target simulation task is executed N3 times using a preset non-real-time simulation platform to obtain N3 time costs, where N3 is a preset natural number and N3≥10000;
[0144] A time cost sequence is constructed using the N3 time costs, and the time cost sequence contains N3 elements;
[0145] Using the second jitter threshold, outliers in the time cost sequence are removed to obtain the target time cost sequence;
[0146] Based on the target time cost sequence, time jitter data is determined.
[0147] In some embodiments of this application, the process by which the dejittering unit uses the second jitter threshold to remove outliers from the time cost sequence to obtain the target time cost sequence may include:
[0148] Step A: Assign the time cost sequence to the target processing sequence;
[0149] Step B: Starting from the first element of the target processing sequence, a sliding window of a preset size slides in the target processing sequence with a preset step size to obtain multiple time cost subsequences.
[0150] Step C: Obtain the minimum and maximum values of each time cost subsequence, and subtract the minimum value from the maximum value to obtain the difference value of each time cost subsequence;
[0151] Step D: Determine whether the difference value of each time cost subsequence is less than the second jitter threshold; if yes, proceed to step E; if no, proceed to step F.
[0152] Step E: Directly determine the target processing sequence as the target time cost sequence;
[0153] Step F: For each time cost subsequence, determine whether the difference value of the time cost subsequence is less than the median difference value, where the median difference value is half of the maximum difference value among the time cost subsequences; if so, proceed to step G.
[0154] Step G: Determine the time cost subsequence as the subsequence to be retained;
[0155] Step H: Based on each subsequence to be retained, construct a new time cost sequence, assign the new time cost sequence to the target processing sequence, and return to execute step B.
[0156] In some embodiments of this application, the process by which the dejitter unit determines time jitter data based on the target time overhead sequence may include:
[0157] The minimum value in the target time cost sequence is determined as the estimated minimum value, the maximum value in the target time cost sequence is determined as the estimated maximum value, and the difference between the estimated maximum value and the estimated minimum value is the estimated jitter time.
[0158] In some embodiments of this application, the process by which the de-jitter unit determines a second jitter threshold based on a preset first jitter threshold may include:
[0159] The second jitter threshold is determined based on the first time cost, the second time cost, and the first jitter threshold.
[0160] The power real-time simulation calculation time estimation device provided in this application embodiment can be applied to power real-time simulation calculation time estimation equipment, such as computers. Optionally, Figure 7 The hardware structure block diagram of the device for predicting the calculation time of real-time power simulation is shown. (Refer to...) Figure 7 The hardware structure of the power real-time simulation calculation time prediction device may include: at least one processor 31, at least one communication interface 32, at least one memory 33 and at least one communication bus 34.
[0161] In this embodiment, the number of processor 31, communication interface 32, memory 33 and communication bus 34 is at least one, and processor 31, communication interface 32 and memory 33 communicate with each other through communication bus 34;
[0162] The processor 31 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0163] The memory 33 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0164] The memory 33 stores a program, and the processor 31 can call the program stored in the memory 33. The program is used for:
[0165] Obtain the first time cost of running a preset simulation task in a preset real-time simulation platform;
[0166] Obtain the second time cost of the simulation task running in a preset non-real-time simulation platform;
[0167] Obtain the third time cost of running the target simulation task on the non-real-time simulation platform;
[0168] Based on the first time cost, the second time cost, and the third time cost, the target time cost for the target simulation task to run in the real-time simulation platform is determined.
[0169] Optionally, the refined and extended functions of the program can be found in the description above.
[0170] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor, the program being used for:
[0171] Obtain the first time cost of running a preset simulation task in a preset real-time simulation platform;
[0172] Obtain the second time cost of the simulation task running in a preset non-real-time simulation platform;
[0173] Obtain the third time cost of running the target simulation task on the non-real-time simulation platform;
[0174] Based on the first time cost, the second time cost, and the third time cost, the target time cost for the target simulation task to run in the real-time simulation platform is determined.
[0175] Optionally, the refined and extended functions of the program can be found in the description above.
[0176] In summary:
[0177] This application first obtains the first time cost of a preset simulation task running on a preset real-time simulation platform, and the second time cost of the same task running on a preset non-real-time simulation platform. It is understood that the preset simulation task is a reference simulation task, which can be used to evaluate the time cost of other simulation tasks on both the non-real-time and real-time simulation platforms. Then, based on the target simulation task to be evaluated, its third time cost running on the non-real-time simulation platform is obtained. Finally, based on the first, second, and third time costs, the target time cost of the target simulation task running on the real-time simulation platform is determined. This application enables the evaluation of the time cost of a target simulation task running on a real-time simulation platform using its time cost on a non-real-time simulation platform, eliminating the need to rely on high-cost real-time simulation platforms and reducing the cost of iterative testing of simulation algorithms. Furthermore, the readily available and multi-core, multi-task parallel processing capabilities of non-real-time simulation platforms improve the efficiency of iterative testing of simulation algorithms.
[0178] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0179] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0180] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for predicting the calculation time of real-time power simulation, characterized in that, include: Obtain the first time cost of running a preset simulation task in a preset real-time simulation platform; Obtain the second time cost of the simulation task running in a preset non-real-time simulation platform; Obtain the third time cost of running the target simulation task on the non-real-time simulation platform; Based on the first time cost, the second time cost, and the third time cost, the target time cost for the target simulation task to run in the real-time simulation platform is determined. Based on the first time cost, the second time cost, and the third time cost, the target time cost for the target simulation task to run in the real-time simulation platform is determined, specifically including: Calculate the ratio of the first time cost to the second time cost; Multiplying the third time cost by the ratio yields the target time cost of the target simulation task running in the real-time simulation platform; The process of obtaining the first time cost of a preset simulation task running in a preset real-time simulation platform includes: The simulation task is executed using a pre-defined real-time simulation platform. Next, get Time expenditure, Let be a pre-defined natural number, and ; Regarding the The first time cost is obtained by averaging the time costs of each item. The process of obtaining the second time cost of the simulation task running in a preset non-real-time simulation platform includes: The simulation task is executed using a pre-defined non-real-time simulation platform. Next, get Time expenditure, Let be a pre-defined natural number, and ; Regarding the The average of the time costs is taken to obtain the second time cost.
2. The method according to claim 1, characterized in that, Also includes: The time jitter data of the target simulation task running in the real-time simulation platform is obtained. The time jitter data includes the estimated maximum value, estimated minimum value and estimated jitter time of the target simulation task running in the real-time simulation platform.
3. The method according to claim 2, characterized in that, The process of acquiring time jitter data of the target simulation task running in the real-time simulation platform includes: Based on a preset first jitter threshold, a second jitter threshold is determined. The first jitter threshold is the maximum jitter value allowed under a real-time simulation platform, and the second jitter threshold is the maximum jitter value allowed under a non-real-time simulation platform. The target simulation task is executed using a pre-defined non-real-time simulation platform. Next, get Time expenditure, Let be a pre-defined natural number, and ; Using the A time cost sequence is constructed from the time costs, the time cost sequence containing One element; Using the second jitter threshold, outliers in the time cost sequence are removed to obtain the target time cost sequence; Based on the target time cost sequence, time jitter data is determined.
4. The method according to claim 3, characterized in that, The process of removing outliers from the time cost sequence using the second jitter threshold to obtain the target time cost sequence includes: Step A: Assign the time cost sequence to the target processing sequence; Step B: Starting from the first element of the target processing sequence, a sliding window of a preset size slides in the target processing sequence with a preset step size to obtain multiple time cost subsequences. Step C: Obtain the minimum and maximum values of each time cost subsequence, and subtract the minimum value from the maximum value to obtain the difference value of each time cost subsequence; Step D: Determine whether the difference value of each time cost subsequence is less than the second jitter threshold; if yes, proceed to step E; if no, proceed to step F. Step E: Directly determine the target processing sequence as the target time cost sequence; Step F: For each time cost subsequence, determine whether the difference value of the time cost subsequence is less than the median difference value, where the median difference value is half of the maximum difference value among the time cost subsequences; if so, proceed to step G. Step G: Determine the time cost subsequence as the subsequence to be retained; Step H: Based on each subsequence to be retained, construct a new time cost sequence, assign the new time cost sequence to the target processing sequence, and return to execute step B.
5. The method according to claim 3, characterized in that, The process of determining time jitter data based on the target time cost sequence includes: The minimum value in the target time cost sequence is determined as the estimated minimum value, the maximum value in the target time cost sequence is determined as the estimated maximum value, and the difference between the estimated maximum value and the estimated minimum value is the estimated jitter time.
6. The method according to claim 3, characterized in that, The process of determining the second jitter threshold based on the preset first jitter threshold includes: The second jitter threshold is determined based on the first time cost, the second time cost, and the first jitter threshold.
7. A device for predicting the calculation time of real-time power simulation, characterized in that, include: The first overhead acquisition unit is used to acquire the first time overhead of a preset simulation task running in a preset real-time simulation platform. The second overhead acquisition unit is used to acquire the second time overhead of the simulation task running in a preset non-real-time simulation platform. The third overhead acquisition unit is used to acquire the third time overhead of the target simulation task running in the non-real-time simulation platform. The target overhead acquisition unit is used to determine the target time overhead of the target simulation task running in the real-time simulation platform based on the first time overhead, the second time overhead, and the third time overhead. The target cost acquisition unit is specifically used to calculate the ratio of the first time cost to the second time cost; Multiplying the third time cost by the ratio yields the target time cost of the target simulation task running in the real-time simulation platform; The process of obtaining the first time cost of a preset simulation task running in a preset real-time simulation platform includes: The simulation task is executed using a pre-defined real-time simulation platform. Next, get Time expenditure, Let be a pre-defined natural number, and ; Regarding the The first time cost is obtained by averaging the time costs of each item. The process of obtaining the second time cost of the simulation task running in a preset non-real-time simulation platform includes: The simulation task is executed using a pre-defined non-real-time simulation platform. Next, get Time expenditure, Let be a pre-defined natural number, and ; Regarding the The average of the time costs is taken to obtain the second time cost.
8. A device for predicting the calculation time of real-time power simulation, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the method for estimating the real-time power simulation calculation time as described in any one of claims 1 to 6.
9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the method for estimating the real-time power simulation calculation time as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for providing a real-time simulation for control unit development and simulator for control unit development
CN109459939A
Simulation of a process of an industrial control system
EP3798749A1