Method, device and related equipment for improving calculation accuracy in real-time power simulation

By calculating the count values ​​and communication delays of the current and previous cycles in real-time power simulation, and combining the residual decimal values, the starting count integer value and the residual count decimal value of the simulation step are determined, which solves the problem of inaccurate step synchronization and improves the calculation accuracy.

CN115408867BActive Publication Date: 2025-10-03ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211077527.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-02
Publication Date
2025-10-03
Estimated Expiration
2042-09-02

AI Technical Summary

Technical Problem

In real-time power simulation, the loss of decimal precision caused by the accumulation of a large number of real numbers leads to inaccurate step synchronization, which affects the calculation accuracy.

Method used

By obtaining the count values, simulation steps and communication delay of the current cycle and the previous cycle, the starting count real value of the next simulation step is calculated. Combined with the remaining count decimal value, the starting count integer value and the remaining count decimal value are determined to avoid error accumulation.

Benefits of technology

The calculation accuracy in real-time power simulation is improved, the accuracy of step synchronization of each simulation core is ensured, and error accumulation is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408867B_ABST
    Figure CN115408867B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus and related equipment for improving calculation accuracy in real-time power simulation. The method comprises: obtaining a count value of a current cycle, and calculating a starting count real value of a next simulation step based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps of each cycle and the count value occupied by communication delay, wherein the count value of the previous cycle, the number of simulation steps and the count value occupied by communication delay are obtained in advance; obtaining a residual count decimal value of the previous cycle, wherein the residual count decimal value is a real number less than 1; calculating a starting count integer value of the next simulation step by combining the starting count real value calculated in the current cycle and the residual count decimal value of the previous cycle, and recording the residual count decimal value of the current cycle for use in the calculation of the next cycle, thereby avoiding the accumulation of errors and improving the calculation accuracy in real-time power simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of power simulation technology, and more specifically, to a method, apparatus, and related equipment for improving calculation accuracy in real-time power simulation. Background Art

[0002] In recent years, power system simulations have increasingly relied on the powerful computing power of computing hardware systems to accelerate the solution process and achieve non-real-time or even real-time simulations. Because computing hardware systems have ample computing and storage resources, they offer significant advantages over the single computers commonly used in the past. With the interconnection of regional power grids, the scale of power systems continues to expand. Coupled with the widespread use of fast-response power electronic devices such as large-scale renewable energy, the scale and computational complexity of power system simulations are becoming increasingly complex. Data exchange between distributed computing subunits (tasks) during power system simulations is becoming increasingly frequent.

[0003] To ensure step synchronization across all operator units, a large number of floating-point operations are required. Since the precision of the decimal fraction is gradually lost when performing large-scale real-number accumulation calculations, this loss of decimal precision can lead to inaccurate step synchronization during the continuous step synchronization process of real-time power simulation. Summary of the Invention

[0004] In view of this, the present application provides a method, apparatus and related equipment for improving calculation accuracy in real-time power simulation, so as to improve the calculation accuracy of simulation step length.

[0005] To achieve the above objectives, the first aspect of the present application provides a method for improving calculation accuracy in real-time power simulation, comprising:

[0006] Obtaining a count value of a current cycle, and calculating a starting count real value of a next simulation step length based on the count value of the current cycle, the count value of a previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay, wherein the count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are obtained in advance;

[0007] Obtain a decimal value of a residual count of a previous period, where the decimal value of the residual count is a real number less than 1;

[0008] Based on the starting count real value of the next simulation step and the carryover count decimal value of the previous cycle, the starting count integer value of the next simulation step and the carryover count decimal value of the current cycle are determined.

[0009] Preferably, the starting count real value includes an integer part and a decimal part; and the process of determining the starting count integer value of the next simulation step length and the remaining count decimal value of the current cycle based on the starting count real value of the next simulation step length and the remaining count decimal value of the previous cycle includes:

[0010] Dividing the start count real value into a first integer part and a first fractional part;

[0011] Summing the decimal part and the remaining count decimal value of the current cycle to obtain a summation result;

[0012] dividing the summation result into a second integer part and a second decimal part, and determining the second decimal part as the residual count decimal value of the current cycle;

[0013] The first integer part and the second integer part are summed to obtain a starting count integer value of the next simulation step.

[0014] Preferably, the process of obtaining the count value of the current cycle includes:

[0015] When receiving the synchronization signal sent by the synchronization source, obtain the reception time at this time, obtain the count value of the previous cycle, and obtain the count value of the counter in the current cycle;

[0016] Subtract the previous receiving time from the receiving time to obtain a receiving interval, where the previous receiving time is the time when the previous synchronization signal is received;

[0017] The count value of the current cycle is determined based on the receiving interval, the count value of the previous cycle, the count value of the counter in the current cycle, the count cycle of the counter and the communication interval of the synchronization signal, wherein the count cycle of the counter and the communication interval are pre-acquired.

[0018] Preferably, the process of determining the count value of the current cycle based on the reception interval, the count value of the previous cycle, the count value of the counter in the current cycle, the count cycle of the counter and the communication interval of the synchronization signal includes:

[0019] Determining whether the receiving interval is greater than or equal to a preset threshold, where the preset threshold is proportional to the communication interval;

[0020] If so, determining a count value of a current cycle based on the count value of a previous cycle, the count cycle of the counter, and the communication interval;

[0021] If not, the count value of the counter in the current cycle is used as the count value of the current cycle.

[0022] Preferably, the process of determining the count value of the current cycle based on the count value of the previous cycle, the count cycle of the counter and the communication interval includes:

[0023] Use the following equation to calculate the count value CT of the current cycle current :

[0024]

[0025] Among them, CT pre is the count value of the previous cycle, T s is the counting period of the counter, is the communication interval.

[0026] Preferably, the process of determining the preset threshold includes:

[0027] The preset threshold φ is calculated using the following equation:

[0028]

[0029] Among them, k is a preset constant, is the communication interval.

[0030] Preferably, the process of calculating the starting count real value of the next simulation step length based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay includes:

[0031] Initialize the variable w using the following equation:

[0032] w=-CT delay

[0033] Among them, CT delay The count value occupied by communication delay;

[0034] The value of the intermediate variable Δw is calculated using the following equation:

[0035] Δw=(CT current -CT pre ) / Num

[0036] Among them, CT current is the count value of the current cycle, CT pre is the count value of the previous cycle, and Num is the number of simulation steps;

[0037] Update the value of variable w using the following equation:

[0038] w=w+Δw

[0039] Determine whether the value of w is greater than 0;

[0040] If so, the value of w is determined as the starting count real value of the next simulation step;

[0041] If not, return to the step of updating the value of the variable w using the following equation.

[0042] A second aspect of the present application provides a device for improving calculation accuracy in real-time power simulation, comprising:

[0043] a starting real number acquisition unit, configured to obtain a count value of a current cycle, and calculate a starting count real value of a next simulation step length based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps of each cycle, and the count value occupied by the communication delay, wherein the count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are pre-acquired;

[0044] A residual decimal obtaining unit, configured to obtain a residual count decimal value of a previous cycle, wherein the residual count decimal value is a real number less than 1;

[0045] The start count determining unit is used to determine the start count integer value of the next simulation step and the carryover count decimal value of the current cycle based on the start count real value of the next simulation step and the carryover count decimal value of the previous cycle.

[0046] A third aspect of the present application provides a device for improving calculation accuracy in real-time power simulation, comprising: a memory and a processor;

[0047] The memory is used to store programs;

[0048] The processor is used to execute the program to implement the various steps of the method for improving calculation accuracy in the above-mentioned real-time power simulation.

[0049] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the various steps of the method for improving calculation accuracy in the above-mentioned real-time power simulation.

[0050] Through the above technical solution, it can be known that the present application first obtains the count value of the current cycle, and based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps of each cycle and the count value occupied by the communication delay, calculates the starting count real value of the next simulation step. Among them, the count value of the previous cycle, the number of simulation steps and the count value occupied by the communication delay are obtained in advance. It can be understood that the starting count real value can include an integer part and a decimal part. Then, the remaining count decimal value of the previous cycle is obtained. Among them, the remaining count decimal value is a real number less than 1. It can be understood that the remaining count decimal value is the decimal part left over due to rounding in the previous cycle. Since the starting count value of each cycle can only be an integer, an unused decimal part will be left over in the rounding, and this decimal part constitutes the remaining count decimal value. By combining the real value of the starting count calculated in the current cycle and the decimal value of the left-over count in the previous cycle, the integer value of the starting count of the next simulation step is calculated. At the same time, the decimal value of the left-over count in the current cycle is recorded for use in the calculation of the next cycle. This can avoid the accumulation of errors and improve the calculation accuracy in real-time power simulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0052] Figure 1 A schematic diagram of the synchronization signal transmission between the synchronization source and each simulation core disclosed in the embodiment of the present application;

[0053] Figure 2 A schematic diagram of the simulation step lengths of each simulation core disclosed in the embodiments of this application;

[0054] Figure 3 A schematic diagram of a method for improving calculation accuracy in real-time power simulation disclosed in an embodiment of the present application;

[0055] Figure 4 A schematic diagram of the count values ​​at various time points disclosed in the embodiments of this application;

[0056] Figure 5 A schematic diagram of the calculation process of the starting count value disclosed in the embodiment of the present application;

[0057] Figure 6 A schematic diagram of a device for improving calculation accuracy in real-time power simulation disclosed in an embodiment of the present application;

[0058] Figure 7 Schematic diagram of a device for improving calculation accuracy in real-time power simulation disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0060] See also Figure 1 To ensure time synchronization between the various operating subunits, a synchronization source typically sends a synchronization signal at regular intervals. This synchronization signal, used for time calibration, can be a rising edge signal. Upon receiving this signal, each simulation core immediately sends a reply signal to the synchronization source. In each synchronization cycle, a fixed number of simulation steps are executed.

[0061] See also Figure 2 In order to accurately control the simulation step of each simulation core while ensuring that it remains consistent with the synchronization source on the absolute time axis, it is necessary to ensure that the starting point of each step of all simulation cores is precisely aligned. This means that the following three conditions must be met simultaneously:

[0062] 1. The starting time of each kernel corresponding to the step length is precisely aligned, that is, T 1i =T 2i =T 3i ;

[0063] 2. The simulation step size of each core is exactly the same, that is, ΔT 1i =ΔT 2i =ΔT 3i ;

[0064] 3. The step size of each kernel is equal to the preset target step size ΔT r , that is, ΔT r =ΔT 1i =ΔT 2i =ΔT 3i .

[0065] To achieve the above objectives, each simulation core can monitor its own counter (the count value is a positive integer) that increases at a preset frequency, and set the counter to trigger at a certain value, which serves as the start time of the simulation. The communication between each simulation core and the synchronization source may be subject to communication jitter, communication delay, etc. Therefore, the starting point of the simulation cannot be simply triggered based on the preset trigger value. As an optional method, the simulation starting point can be determined by combining the pre-acquired communication interval and communication delay. Among them, the communication interval is the interval of the calibrated synchronization signal received periodically from the synchronization source; the communication delay is the communication delay between the synchronization source and the simulation core.

[0066] In the process of determining the simulation starting point, a large number of real number calculations are inevitably involved. For example, in order to obtain the count value corresponding to the simulation step length of 50μs in each synchronization cycle, it is necessary to divide the total duration of the synchronization cycle by the length of the simulation step length (i.e., 50μs). The resulting calculation result may be a real number with a decimal part. However, the count value of the counter must be an integer. In this case, after rounding this real number to obtain the target count value, there will be an error caused by rounding. For example, assuming that the real value is 1000.1, if it is rounded to 1000, the accumulated simulation step length will be smaller as time accumulates; if it is rounded to 1001, the accumulated simulation step length will be larger as time accumulates. Therefore, the present application proposes an accurate value-taking method that can ensure that no cumulative error occurs. For example, for the above example, assuming that the first 9 roundings are 1000, then the next rounding is 1001 to avoid the accuracy problem that will occur as the count continues.

[0067] The following describes a method for improving calculation accuracy in real-time power simulation provided by an embodiment of the present application. Figure 3 The method for improving calculation accuracy in real-time power simulation provided by the embodiment of the present application may include the following steps:

[0068] Step S101, obtaining the count value of the current cycle.

[0069] Among them, each simulation core executes a fixed number of simulation steps in each synchronization cycle. The count value of the current cycle represents the current moment of each simulation core on the unified time axis and can be used to calculate the starting count value of the first simulation step in the current cycle.

[0070] Step S102 , based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay, calculate the starting count real value of the next simulation step.

[0071] The count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are obtained in advance.

[0072] Specifically, the number of simulation steps is the number of simulation steps executed by the simulation core in one synchronization cycle, and can usually be calculated by combining the simulation step length and the length of the synchronization cycle.

[0073] The communication delay is the communication delay from the synchronization source to a simulation core. For example, see Figure 4 The time when the synchronization source sends out rising edge signals at equal intervals is t1, t2, t3, etc. Taking simulation core 1 as an example, the time when it receives the rising edge signals sent by the synchronization source is t11, t12, t13, etc. Since the synchronization source cannot directly know the time when the simulation core receives the rising edge signal, the time when the synchronization source receives the rising edge signal returned by simulation core 1 can be used to infer the time when the simulation core receives the rising edge signal. For example, assuming that the round-trip time is consistent, the time interval Δt can be obtained by dividing the transmission and reception time of the synchronization source by 2. 11 , Δt 12 , Δt 13 The time interval is the communication delay, and the communication delay sequence can be expressed as:

[0074] A={Δt 1i , i=1, 2, ..., N}

[0075] Generally speaking, the network design is exclusive, and each simulation core and synchronization source have an exclusive communication channel, so the communication delay will be relatively stable, that is, the communication delay Δt 11 , Δt 12 , Δt 13 The difference between them is very small.

[0076] Although the network is exclusive and will not be interfered with by other simulation cores, if the communication medium is interfered with, communication failure may occur, and retransmission may occur, resulting in Δt 11 , Δt 12 , Δt 13 etc. are not completely consistent. Theoretically, most of Δt 11 , Δt 12 , Δt 13 The time is a constant value, occasionally showing a value of approximately 1.5 times (1 retransmission in both directions), approximately 2 times (2 retransmissions in both directions), approximately 2.5 times (3 retransmissions in both directions), etc. Therefore, to obtain a more accurate communication delay, it is also necessary to consider the recent data performance of the communication channel to dynamically determine the specific value of the communication delay. In other words, the communication delay used in this application can be obtained through a series of calculations. The specific calculation process can be referred to another patent application document of the inventor of this application.

[0077] The real value of the start count of the next simulation step can contain an integer part and a decimal part.

[0078] Step S103: Obtain the residual count decimal value of the previous cycle.

[0079] Among them, the residual count decimal value can be a real number less than 1. Since the starting count real value in each cycle can contain an integer part and a decimal part, and the count value of each cycle can only be an integer, an unused decimal part will be left in the rounding process, and this decimal part constitutes the residual count decimal value.

[0080] Step S104 , determining the starting count integer value of the next simulation step and the remaining count decimal value of the current cycle based on the starting count real value of the next simulation step and the remaining count decimal value of the previous cycle.

[0081] The present application first obtains the count value of the current cycle, and based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps of each cycle, and the count value occupied by the communication delay, calculates the starting count real value of the next simulation step. Among them, the count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are obtained in advance. It is understandable that the starting count real value may include an integer part and a decimal part. Then, the remaining count decimal value of the previous cycle is obtained. Among them, the remaining count decimal value is a real number less than 1. It is understandable that the remaining count decimal value is the decimal part left over due to rounding in the previous cycle. Since the starting count value of each cycle can only be an integer, an unused decimal part will be left over in the rounding, and this decimal part constitutes the remaining count decimal value. By combining the real value of the starting count calculated in the current cycle and the decimal value of the left-over count in the previous cycle, the integer value of the starting count of the next simulation step is calculated. At the same time, the decimal value of the left-over count in the current cycle is recorded for use in the calculation of the next cycle. This can avoid the accumulation of errors and improve the calculation accuracy in real-time power simulation.

[0082] In some embodiments of the present application, the starting count real value mentioned in step S102 includes an integer part and a decimal part. The process of determining the starting count integer value of the next simulation step and the remaining count decimal value of the current cycle based on the starting count real value of the next simulation step and the remaining count decimal value of the previous cycle in step S104 may include:

[0083] S1, dividing the starting count real value into a first integer part and a first fractional part.

[0084] S2, summing the decimal part and the remaining count decimal value of the current cycle to obtain a sum result.

[0085] S3, dividing the summation result into a second integer part and a second decimal part, and determining the second decimal part as the residual count decimal value of the current cycle.

[0086] S4, summing the first integer part and the second integer part to obtain a starting count integer value for the next simulation step.

[0087] In fact, the above calculation method is applicable to any case where the calculation results or intermediate results must be rounded when floating-point operations are involved. That is, the decimal part ignored during the rounding process is retained and included in the calculation of the next cycle.

[0088] Specifically, the calculation result or intermediate calculation result is defined as z, where z is generally not an integer, and two operations are defined:

[0089] f(z) means taking the integer part of z, and g(z) means taking the decimal part of z, satisfying:

[0090] z=f(z)+g(z)

[0091] Define data structure: z = {f(z), g(z)} = f(z) + g(z)

[0092] When z participates in the four arithmetic operations, the relevant operations are performed according to the following steps:

[0093] 1. For addition calculation: y = z1 + z2

[0094] First expand:

[0095] y={f(z1),g(z1)}+{f(z2),g(z2)}=f(z1)+g(z1)+f(z2)+g(z2)

[0096] Then combine the integer and fractional parts separately:

[0097] y=[f(z1)+f(z2)]+[g(z1)+g(z2)]

[0098] The carry or borrow that may occur in the decimal part is transferred to the integer part:

[0099] y={f(z1)+f(z2)+f(g(z1)+g(z2)), g(g(z1)+g(z2))}

[0100] 2. For subtraction calculation: y = z1 - z2

[0101] First expand:

[0102] y={f(z1),g(z1)}-{f(z2),g(z2)}=f(z1)+g(z1)-f(z2)-g(z2)

[0103] Then combine the integer and fractional parts:

[0104] y=[f(z1)-f(z2)]+[g(z1)-g(z2)]

[0105] The carry or borrow that may occur in the decimal part is transferred to the integer part:

[0106] y={f(z1)-f(z2)+f(g(z1)-g(z2)), g(g(z1)-g(z2))}

[0107] 3. For multiplication calculation: y = z1 * z2

[0108] First expand:

[0109] y={f(z1),g(z1)}*{f(z2),g(z2)}=[f(z1)+g(z1)]*[f(z2)+g(z2)]

[0110] =f(z1)*f(z2)+f(z1)*g(z2)+g(z1)*f(z2)+g(z1)*g(z2)

[0111] Then combine the integer and fractional parts:

[0112] y=f(z1)*f(z2)+[f(z1)*g(z2)+g(z1)*f(z2)+g(z1)*g(z2)]

[0113] The carry or borrow that may occur in the decimal part is transferred to the integer part:

[0114] y={f(z1)*f(z2)+f(f(z1)*g(z2)+g(z1)*f(z2)+g(z1)*g(z2)), g(f(z1)*g(z2)+g(z1)*f(z2)+g(z1)*g(z2))}

[0115] In some embodiments of the present application, the process of obtaining the count value of the current cycle in step S101 may include:

[0116] S1, when receiving the synchronization signal sent by the synchronization source, obtain the reception time at this time, obtain the count value of the previous cycle, and obtain the count value of the counter in the current cycle.

[0117] The previous cycle and the cycle in the current cycle refer to the synchronization cycle in which the synchronization signal is sent. Figure 4, define the time when the synchronization source sends the synchronization signal as t1, t2, t3, etc. Taking simulation core 1 as an example, the time when it receives the synchronization source is t11, t12, t13, etc. Then, assuming that the current time is t12, the count value of the previous cycle is the count value at time t11, and the count value of the counter in the current cycle is the count value of the counter at time t12.

[0118] It can be understood that the count value in a certain period and the count value of the counter in a certain period are different concepts. Specifically, the count value of the counter in a certain period is the direct reading of the counter, while the count value in a certain period is calculated through this step.

[0119] S2, subtract the previous receiving time from the receiving time to obtain the receiving interval.

[0120] The last receiving moment is the moment when the last synchronization signal is received.

[0121] S3, determining a count value of a current cycle based on the receiving interval, the count value of a previous cycle, the count value of the counter in the current cycle, the count cycle of the counter, and the communication interval of the synchronization signal.

[0122] The counting period of the counter and the communication interval are obtained in advance. s Depends on the counter's counting frequency f s , specifically, satisfying the following equation:

[0123] T s =1 / f s

[0124] As mentioned above, the communication interval is the interval in which the simulation core receives the synchronization signal from the synchronization source, and the communication interval is obtained in advance. Figure 1 As shown, the intervals between synchronization signals sent by the communication source are exactly equal. However, due to reasons such as transmission loss, the times at which the simulation core receives the signals may not be equally spaced. Therefore, in order to obtain a more accurate communication interval, it is also necessary to consider the recent data performance of the communication channel to dynamically determine the interval of the synchronization signals received by the simulation core. In other words, the communication interval used in this application can be obtained through a series of calculations, rather than simply using the synchronization signal sending interval preset by the synchronization source. The specific calculation process of the communication interval can be referred to another patent application document of the inventor of this application.

[0125] In some embodiments of the present application, the process of determining the count value of the current cycle in S3 based on the reception interval, the count value of the previous cycle, the count value of the counter in the current cycle, the count cycle of the counter, and the communication interval of the synchronization signal may include:

[0126] S31, determine whether the receiving interval is greater than or equal to a preset threshold; if so, execute S32; if not, execute S33.

[0127] The preset threshold is proportional to the communication interval.

[0128] S32, determining the count value of the current cycle based on the count value of the previous cycle, the count cycle of the counter, and the communication interval.

[0129] S33, using the count value of the counter in the current cycle as the count value of the current cycle.

[0130] Since communication jitter causes communication data packets to be retransmitted, the reception interval will be larger than the normal value. Therefore, when the reception interval is less than the preset threshold, it can be considered that the communication status is normal, and the count value of the counter in the current cycle can be directly used.

[0131] In some embodiments of the present application, the process of determining the preset threshold mentioned in S1 above may include:

[0132] The preset threshold φ is calculated using the following equation:

[0133]

[0134] Among them, k is a preset constant, is the communication interval. For example, k can take a value of 1.25.

[0135] In some embodiments of the present application, the process of determining the count value of the current cycle in S2 based on the count value of the previous cycle, the count cycle of the counter, and the communication interval may include:

[0136] Use the following equation to calculate the count value CT of the current cycle current :

[0137]

[0138] Among them, CT pre is the count value of the previous cycle, T s is the counting period of the counter, is the communication interval.

[0139] It can be understood that when executing the step synchronization calibration method in the real-time power simulation provided by this application, for the count value of the initial cycle, since there is no earlier reference data, the count value of the counter in this cycle can be directly used as the count value of this cycle.

[0140] In some embodiments of this application, please refer to Figure 5The process of calculating the starting count real value of the next simulation step length based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay in step S102 may include:

[0141] S1, initialize the value of variable w.

[0142] Specifically, the variable w is initialized using the following equation:

[0143] w=-CT delay

[0144] Among them, CT delay It is understood that this step is an initialization step, and the initialization in the entire system only needs to be performed once.

[0145] S2, calculate the value of the intermediate variable Δw.

[0146] Specifically, the value of the intermediate variable Δw is calculated using the following equation:

[0147] Δw=(CT current -CT pre ) / Num

[0148] Among them, CT current is the count value of the current cycle, CT pre is the count value of the previous cycle, and Num is the number of simulation steps.

[0149] S3, using the intermediate variable Δw to update the value of the variable w.

[0150] Specifically, the value of the variable w is updated using the following equation:

[0151] w=w+Δw

[0152] S4, determine whether the value of w is greater than 0; if so, execute S5; if not, execute S3.

[0153] S5, determining the value of w as the starting count real value of the next simulation step.

[0154] It is understandable that the above process is an operation performed after receiving each synchronization signal sent by the synchronization source, and its purpose is to determine the starting count value of the first simulation step that the simulation core needs to execute after receiving the synchronization signal.

[0155] Since each cycle has more than one simulation step, but rather Num steps, where Num>>1, after determining the starting count value of the first simulation step to be executed after receiving the synchronization signal, it is necessary to cyclically determine the initial count value of each subsequent simulation step in the cycle. Specifically, the process can return to S3 to determine the initial count value of each subsequent simulation step in the cycle until the next synchronization signal is received, at which point the process returns to S2.

[0156] The following describes a device for improving calculation accuracy in real-time power simulation provided by an embodiment of the present application. The device for improving calculation accuracy in real-time power simulation described below and the method for improving calculation accuracy in real-time power simulation described above can be referenced to each other.

[0157] See Figure 6 The device for improving calculation accuracy in real-time power simulation provided by the embodiment of the present application may include:

[0158] A starting real number acquisition unit 21 is configured to obtain a count value of a current cycle and calculate a starting count real value of a next simulation step length based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay, wherein the count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are pre-acquired.

[0159] A residual decimal obtaining unit 22 is configured to obtain a residual count decimal value of a previous cycle, where the residual count decimal value is a real number less than 1;

[0160] The start count determining unit 23 is configured to determine the start count integer value of the next simulation step and the carryover count decimal value of the current cycle based on the start count real value of the next simulation step and the carryover count decimal value of the previous cycle.

[0161] In some embodiments of the present application, the process of the starting real number acquisition unit 21 acquiring the count value of the current cycle may include:

[0162] When receiving the synchronization signal sent by the synchronization source, obtain the reception time at this time, obtain the count value of the previous cycle, and obtain the count value of the counter in the current cycle;

[0163] Subtract the previous receiving time from the receiving time to obtain a receiving interval, where the previous receiving time is the time when the previous synchronization signal is received;

[0164] The count value of the current cycle is determined based on the receiving interval, the count value of the previous cycle, the count value of the counter in the current cycle, the count cycle of the counter and the communication interval of the synchronization signal, wherein the count cycle of the counter and the communication interval are pre-acquired.

[0165] In some embodiments of the present application, the process of the starting real number acquisition unit 21 determining the count value of the current cycle based on the reception interval, the count value of the previous cycle, the count value of the counter in the current cycle, the count cycle of the counter, and the communication interval of the synchronization signal includes:

[0166] Determining whether the receiving interval is greater than or equal to a preset threshold, where the preset threshold is proportional to the communication interval;

[0167] If so, determining a count value of a current cycle based on the count value of a previous cycle, the count cycle of the counter, and the communication interval;

[0168] If not, the count value of the counter in the current cycle is used as the count value of the current cycle.

[0169] In some embodiments of the present application, the process of the starting real number acquisition unit 21 determining the count value of the current cycle based on the count value of the previous cycle, the count cycle of the counter, and the communication interval includes:

[0170] Use the following equation to calculate the count value CT of the current cycle current :

[0171]

[0172] Among them, CT pre is the count value of the previous cycle, T s is the counting period of the counter, is the communication interval.

[0173] In some embodiments of the present application, the process of determining the preset threshold by the starting real number acquisition unit 21 includes:

[0174] The preset threshold φ is calculated using the following equation:

[0175]

[0176] Among them, k is a preset constant, is the communication interval.

[0177] In some embodiments of the present application, the process of the starting real number acquisition unit 21 calculating the starting count real value of the next simulation step length based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps of each cycle, and the count value occupied by the communication delay includes:

[0178] Initialize the variable w using the following equation:

[0179] w=-CT delay

[0180] Among them, CT delay The count value occupied by communication delay;

[0181] The value of the intermediate variable Δw is calculated using the following equation:

[0182] Δw=(CT current -CT pre ) / Num

[0183] Among them, CT current is the count value of the current cycle, CT pre is the count value of the previous cycle, and Num is the number of simulation steps;

[0184] Update the value of variable w using the following equation:

[0185] w=w+Δw

[0186] Determine whether the value of w is greater than 0;

[0187] If so, the value of w is determined as the starting count real value of the next simulation step;

[0188] If not, return to the step of updating the value of the variable w using the following equation.

[0189] In some embodiments of the present application, the start count real value includes an integer part and a decimal part. The process of the start count determining unit 23 determining the start count integer value of the next simulation step length and the carryover count decimal value of the current cycle based on the start count real value of the next simulation step length and the carryover count decimal value of the previous cycle may include:

[0190] Dividing the start count real value into a first integer part and a first fractional part;

[0191] Summing the decimal part and the remaining count decimal value of the current cycle to obtain a summation result;

[0192] dividing the summation result into a second integer part and a second decimal part, and determining the second decimal part as the residual count decimal value of the current cycle;

[0193] The first integer part and the second integer part are summed to obtain a starting count integer value of the next simulation step.

[0194] The device for improving calculation accuracy in real-time power simulation provided by the embodiment of the present application can be applied to devices for improving calculation accuracy in real-time power simulation, such as computers. Figure 7 The hardware structure diagram of the device for improving the calculation accuracy in real-time power simulation is shown. Figure 7The hardware structure of the device for improving calculation accuracy in power real-time simulation 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.

[0195] In the embodiment of the present application, the number of the processor 31, the communication interface 32, the memory 33, and the communication bus 34 is at least one, and the processor 31, the communication interface 32, and the memory 33 communicate with each other through the communication bus 34;

[0196] The processor 31 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application;

[0197] The memory 33 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0198] The memory 33 stores a program, and the processor 31 can call the program stored in the memory 33, wherein the program is used to:

[0199] Obtaining a count value of a current cycle, and calculating a starting count real value of a next simulation step length based on the count value of the current cycle, the count value of a previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay, wherein the count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are obtained in advance;

[0200] Obtain a decimal value of a residual count of a previous period, where the decimal value of the residual count is a real number less than 1;

[0201] Based on the starting count real value of the next simulation step and the carryover count decimal value of the previous cycle, the starting count integer value of the next simulation step and the carryover count decimal value of the current cycle are determined.

[0202] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0203] An embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0204] Obtaining a count value of a current cycle, and calculating a starting count real value of a next simulation step length based on the count value of the current cycle, the count value of a previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay, wherein the count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are obtained in advance;

[0205] Obtain a decimal value of a residual count of a previous period, where the decimal value of the residual count is a real number less than 1;

[0206] Based on the starting count real value of the next simulation step and the carryover count decimal value of the previous cycle, the starting count integer value of the next simulation step and the carryover count decimal value of the current cycle are determined.

[0207] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0208] In summary:

[0209] The present application first obtains the count value of the current cycle, and based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps of each cycle, and the count value occupied by the communication delay, calculates the starting count real value of the next simulation step. Among them, the count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are obtained in advance. It is understandable that the starting count real value may include an integer part and a decimal part. Then, the remaining count decimal value of the previous cycle is obtained. Among them, the remaining count decimal value is a real number less than 1. It is understandable that the remaining count decimal value is the decimal part left over due to rounding in the previous cycle. Since the starting count value of each cycle can only be an integer, an unused decimal part will be left over in the rounding, and this decimal part constitutes the remaining count decimal value. By combining the real value of the starting count calculated in the current cycle and the decimal value of the left-over count in the previous cycle, the integer value of the starting count of the next simulation step is calculated. At the same time, the decimal value of the left-over count in the current cycle is recorded for use in the calculation of the next cycle. This can avoid the accumulation of errors and improve the calculation accuracy in real-time power simulation.

[0210] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0211] The various embodiments in this specification are described in a progressive manner, and 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 referenced to each other.

[0212] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for improving calculation accuracy in real-time power simulation, characterized in that: include: Obtaining a count value of a current cycle, and calculating a starting count real value of a next simulation step length based on the count value of the current cycle, the count value of a previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay, wherein the count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are obtained in advance; Obtain a decimal value of a residual count of a previous period, where the decimal value of the residual count is a real number less than 1; Determine the starting count integer value of the next simulation step and the remaining count decimal value of the current cycle based on the starting count real value of the next simulation step and the remaining count decimal value of the previous cycle; The starting count real value includes an integer part and a decimal part; based on the starting count real value of the next simulation step and the remaining count decimal value of the previous cycle, the process of determining the starting count integer value of the next simulation step and the remaining count decimal value of the current cycle includes: Dividing the start count real value into a first integer part and a first fractional part; Summing the decimal part and the remaining count decimal value of the previous cycle to obtain a summation result; dividing the summation result into a second integer part and a second decimal part, and determining the second decimal part as the residual count decimal value of the current cycle; Summing the first integer part and the second integer part to obtain a starting count integer value for a next simulation step; The process of calculating the starting count real value of the next simulation step based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay includes: Initialize the variable w using the following equation: ; in, The count value occupied by communication delay; The intermediate variables are calculated using the following equations: Value: ; in, is the count value of the current cycle, is the count value of the previous cycle, is the number of simulation steps; Update the variables using the following equation Value: ; judge Is the value greater than 0? If so, The value of is determined as the starting count real value of the next simulation step; If not, return to execute and update the variable using the following equation The value of the step.

2. The method according to claim 1, characterized in that The process of obtaining the count value of the current cycle includes: When receiving the synchronization signal sent by the synchronization source, obtain the reception time at this time, obtain the count value of the previous cycle, and obtain the count value of the counter in the current cycle; Subtract the previous receiving time from the receiving time to obtain a receiving interval, where the previous receiving time is the time when the previous synchronization signal is received; The count value of the current cycle is determined based on the receiving interval, the count value of the previous cycle, the count value of the counter in the current cycle, the count cycle of the counter and the communication interval of the synchronization signal, wherein the count cycle of the counter and the communication interval are pre-acquired.

3. The method according to claim 2, characterized in that The process of determining the count value of the current cycle based on the receiving interval, the count value of the previous cycle, the count value of the counter in the current cycle, the count cycle of the counter, and the communication interval of the synchronization signal includes: Determining whether the receiving interval is greater than or equal to a preset threshold, where the preset threshold is proportional to the communication interval; If so, determining a count value of a current cycle based on the count value of a previous cycle, the count cycle of the counter, and the communication interval; If not, the count value of the counter in the current cycle is used as the count value of the current cycle.

4. The method according to claim 3, characterized in that The process of determining the count value of the current cycle based on the count value of the previous cycle, the count cycle of the counter, and the communication interval includes: Use the following equation to calculate the count value of the current cycle : ; in, is the count value of the previous cycle, is the counting period of the counter, is the communication interval.

5. The method according to claim 3, characterized in that The process of determining the preset threshold includes: The preset threshold is calculated using the following equation: : ; Among them, k is a preset constant, is the communication interval.

6. A device for improving calculation accuracy in real-time power simulation, characterized in that: include: a starting real number acquisition unit, configured to obtain a count value of a current cycle, and calculate a starting count real value of a next simulation step length based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps of each cycle, and the count value occupied by the communication delay, wherein the count value of the previous cycle, the number of simulation steps, and the count value occupied by the communication delay are pre-acquired; A residual decimal obtaining unit, configured to obtain a residual count decimal value of a previous cycle, wherein the residual count decimal value is a real number less than 1; a start count determining unit, configured to determine a start count integer value of a next simulation step length and a carryover count decimal value of a current cycle based on a start count real value of a next simulation step length and a carryover count decimal value of a previous cycle; The starting count real value includes an integer part and a decimal part; based on the starting count real value of the next simulation step and the remaining count decimal value of the previous cycle, the process of determining the starting count integer value of the next simulation step and the remaining count decimal value of the current cycle includes: Dividing the start count real value into a first integer part and a first fractional part; Summing the decimal part and the remaining count decimal value of the previous cycle to obtain a summation result; dividing the summation result into a second integer part and a second decimal part, and determining the second decimal part as the residual count decimal value of the current cycle; Summing the first integer part and the second integer part to obtain a starting count integer value for a next simulation step; The process of calculating the starting count real value of the next simulation step based on the count value of the current cycle, the count value of the previous cycle, the number of simulation steps in each cycle, and the count value occupied by the communication delay includes: Initialize the variable w using the following equation: ; in, The count value occupied by communication delay; The intermediate variables are calculated using the following equations: Value: ; in, is the count value of the current cycle, is the count value of the previous cycle, is the number of simulation steps; Update the variables using the following equation Value: ; judge Is the value greater than 0? If so, The value of is determined as the starting count real value of the next simulation step; If not, return to execute and update the variable using the following equation The value of the step.

7. A device for improving calculation accuracy in real-time power simulation, characterized in that: include: memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of the method for improving calculation accuracy in real-time power simulation according to any one of claims 1 to 5.

8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for improving calculation accuracy in real-time power simulation according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Data stream transmitting method and device

    CN102208973A

  • Calibration method and system for data sampling

    CN109428598A