A method for automatically laying out recording waveforms and event labels based on a force guiding algorithm
By adopting an automatic layout method for waveform recording graphics and event tags based on a force-guided algorithm, the problem of unintuitive display of switch quantity changes and protection event signals in waveform analysis tools is solved. This method achieves uniform distribution and concise display of waveform recording graphics and event tags, simplifying the fault analysis process.
Patent Information
- Application Number
- CN202211267583.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-17
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-10-17
AI Technical Summary
Existing waveform analysis tools cannot intuitively display the signals of switch changes and protection events, and lack a comprehensive display of key data before and after the fault.
An automatic placement method for waveform recording and event tags based on a force-guided algorithm is adopted to visualize switch position changes and protection event information as tags. Different cross-energy coefficients are defined through the force-guided algorithm to achieve automatic tag placement and avoid mutual obstruction and interference of multiple event information.
It achieves uniform distribution and aesthetically pleasing display of waveform graphics and event labels, providing a concise and intuitive presentation of the fault analysis process and reducing the hassle of manual comparison.
Smart Images

Figure CN115599854B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of power system fault analysis, and more particularly to an automatic layout method of recorded waveforms and event labels based on a force guiding algorithm. BACKGROUND
[0002] A fault recorded waveform file contains rich fault transient information and is important data in the process of power grid fault analysis. Although the current recorded waveform analysis tool can intuitively display the curve graph of the fault recorded waveform, the analysis of the waveform at the signal occurrence time still needs to be manually performed by contrasting the switch quantity displacement and the action event signal, and the process is not simple and intuitive, and the display of the key data before and after the fault time is not comprehensive.
[0003] Therefore, a method for simultaneously and visually displaying the recorded waveform graph and the event signal in the related channel is needed, and the rational layout of the event signal label also needs to be considered. SUMMARY
[0004] To solve the problems in the prior art, the purpose of the application is to provide an automatic layout method of recorded waveform graphs and event labels based on a force guiding algorithm, which visually displays the switch quantity displacement and the protection event at the same time and at different times in the recorded waveform graph as event labels, and uses the force guiding algorithm to automatically layout the label lines and label entries and the annotations on one side and both sides of the time axis, which can effectively avoid the mutual shielding and interference of multiple event information displays, and ensure the uniform distribution of the event labels around the recorded waveform graph, and by defining different cross-energy coefficients, the most reasonable and aesthetic automatic layout of the event labels can be realized.
[0005] The application adopts the following technical solutions.
[0006] The application provides an automatic layout method of recorded waveform graphs and event labels based on a force guiding algorithm, which comprises the following steps.
[0007] Step 1, visually display the switch quantity displacement information or the protection event information as spatial labels, and the labels comprise label lines and label entries;
[0008] Step 2, based on the spatial influence relationship between the labels defined by the label x-axis interval and the label line position, set the layout order of the labels that are not drawn;
[0009] Step 3, if there is no drawing space on the upper side or the lower side of the recorded waveform, place the labels on one side of the waveform centerline in the layout order;
[0010] Step 4, if there is drawing space on both the upper side and the lower side of the recorded waveform, place the labels on both sides of the waveform centerline in the layout order;
[0011] Step 5, if the above drawing process does not appear label influence, the drawing is completed; if it will appear label influence, return to step 2, adjust the label drawing order, repeat steps 2-4 to obtain all possible layout schemes;
[0012] Step 6, automatically select the most reasonable layout scheme by using force-directed algorithm.
[0013] Preferably, in step 1, a label includes a label line and one or more label entries, when there is only one event at the same time, a label contains only one label entry, when there are multiple events at the same time, a label contains multiple label entries, all label entries of the same label are located on the same side of the label line, and different labels are affected by the display space and are located on the left or right side of the label line.
[0014] Preferably, in step 1, the information of the label entry includes displacement information in the wave recording file switch channel, event information in the wave recording fault report header file, or external event information.
[0015] Preferably, in step 2: assuming that label N has an x-axis interval of [N1, N2], the label line position n is N1≤n≤N2, label M has an x-axis interval of [M1, M2], and the label line position m is M1≤m≤M2, then it is defined that:
[0016] (1) M affects N means that m belongs to the interval [N1, N2], N1≤m≤N2;
[0017] (2) M unidirectionally affects N means that M affects N, but N does not affect M;
[0018] (3) MN bidirectionally affects means that M affects N and N affects M.
[0019] Step 2 specifically includes:
[0020] Step 2-1, all the labels that have not been drawn are put into set L according to the position of the label line, and all the labels that have not been drawn are put into set R;
[0021] Step 2-2, if set L is empty, set R is put into queue C;
[0022] Step 2-3, if set R is empty, set L is put into queue D;
[0023] Step 2-4, if set L and set R are not empty, if any label in set L and set R does not affect other labels, the label is removed from the corresponding set and put into queue C;
[0024] Step 2-5, select the label l with the largest sample number in set L and the label r with the smallest sample number in set R, if l affects r and r does not affect l, take out l and put it into queue D, otherwise continue.
[0025] Steps 2-6: Select the label l with the largest sampling number in L and the label r with the smallest sampling number in R. If r affects 1 and 1 does not affect r, remove r and put it into queue D; otherwise, continue.
[0026] Steps 2-7: Select label 1 with the largest sampling number in L and label r with the smallest sampling number in R. If l and r affect each other, calculate the number of all other labels affected by 1 and r respectively. Take the label with the most affected labels and put it into queue D. Otherwise, continue.
[0027] Step 2-8: If L or R is empty, proceed to step 2-2 or step 2-3; otherwise, return to step 2-4.
[0028] Steps 2-9 result in two queues, C and D, with the following layout order: first, arrange the elements in D sequentially, then arrange the elements in C in reverse order.
[0029] Preferably, in step 3, the space occupied by the label refers to the space occupied by the label entry; the space corresponding to the label line is not counted as the space occupied by the label.
[0030] Step 3 specifically includes:
[0031] Step 3-1: When placing a new label, its space occupation should not affect all the labels that have been placed. For clarity, leave a gap between two labels in the y-axis direction. When placing the label, it should be close to the central axis of the waveform curve.
[0032] Step 3-2: Calculate the rectangular area of the current label, add the gap, and form two rectangles X and Y. Starting from the position closest to the central axis, test whether it can be placed outwards, and check whether XY and all placed labels AB have any impact.
[0033] Step 3-3: Move A from bottom to top and check if it affects B. The reasonable position of A is that the bottom coordinate of A is greater than the top coordinate of B.
[0034] Steps 3-4: For multiple labels B, C, D, ..., calculate the reasonable positions for each label until there is no impact.
[0035] Preferably, step 4 specifically includes:
[0036] Step 4-1: Place the label above the center line and record its position and whether the label line is affected.
[0037] Step 4-2: Place the label below the center line and record its position and whether the label line is affected.
[0038] Step 4-3: Choose the one that has no impact and is closest to the center line.
[0039] Preferably, in step 5, when adjusting the drawing order, the label line is drawn first to affect the labels of other labels.
[0040] Preferably, in step 6,
[0041] Step 6-1, the label line is regarded as a spring, and the equilibrium position is located outside the waveform area, at a distance h from the center axis, and the energy is defined as k1(x-h) 2 , wherein x≥h;
[0042] Step 6-2, the label entry is only adjusted in the vertical direction, has an impact, or is too close to have energy;
[0043] Step 6-3, assuming that label A has a width wA, a height hA, and a center point coordinate (xA, yA), and label B has a width wB, a height hB, and a center point coordinate (xB, yB), when (wA+wB) / 2<|xA-xB|, the labels do not affect each other, there is no repulsion, and the energy is 0;
[0044] Step 6-4, when (wA+wB) / 2≥|xA-xB| and |yA-yB|<c+(hA+hB) / 2, where c is the gap, energy exists because the label entries are not allowed to affect each other, and adjusting the y coordinate can achieve no impact, and the impact energy is defined as a large constant K2, which ensures that the label entries do not affect each other and that there is a gap between the labels;
[0045] Step 6-5, when the label line and the label entry intersect, energy exists, and the energy coefficient of each intersection is defined as K3, and K2>>K3>>k1(x-h) 2 , and the intersection energy ensures that the label line and the label entry do not intersect.
[0046] The beneficial effects of the present application are that, compared with the prior art, the present application visualizes and simply displays the fault analysis process based on recording and related events by displaying the switch quantity displacement and protection event information as graphical labels and synchronously marking on the related waveform channel curve based on the time axis, and at the same time, based on the force guiding algorithm, different intersection energy coefficients are defined to automatically select a most reasonable and beautiful layout for display in a variety of label selection and layout methods, further facilitating the viewing of fault analysis personnel and eliminating the trouble of manually comparing waveform changes and related events. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 is a schematic diagram of a label drawing and composition in the present application;
[0048] Figure 2 is a class diagram of label definition objects in the present application;
[0049] Figure 3is a schematic diagram of the label selection process in the present application;
[0050] Figure 4 is a schematic diagram of the occupied space of the label when placing the label in the present application;
[0051] Figure 5 is a schematic diagram of the method of not affecting the placement when placing the label on one side in the present application;
[0052] Figure 6 is a schematic diagram of the spring model of the force guide algorithm in the present application.
[0053] Figure 7 is a schematic diagram of the energy calculation when the label entry affects in the present application;
[0054] Figure 8 is a schematic diagram of the energy calculation when the label line and the label entry intersect in the present application;
[0055] Figure 9 is a flow chart of the waveform graph and event label automatic layout method based on the force guide algorithm in the present application. DETAILED DESCRIPTION
[0056] The present application will be further described below in conjunction with the accompanying drawings. The following examples are only used to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the protection scope of the present application.
[0057] Example 1.
[0058] A waveform graph and event label automatic layout method based on a force guide algorithm, as shown in Figure 9 , includes the following steps:
[0059] Step 1, visualizing the switch variable displacement information or protection event information as a label, the label including: a label line and a label entry.
[0060] In a preferred but non-limiting embodiment, specifically, as shown in Figure 1 , a label can include a label line and one or more label entries, when there is only one event at the same time, a label contains only one label entry, when there are multiple events at the same time, a label contains multiple label entries, all label entries of the same label are located on the same side of the label line, different labels are affected by the display space and can be located on the left or right side, and the design class diagram of the label object is as shown in Figure 2 .
[0061] It is worth noting that the information of the label entry can come from the displacement information in the switch channel of the waveform file, the event information in the waveform fault report header file (HDR, High-Dynamic Range) or external event information.
[0062] Step 2, based on the spatial influence relationship between labels defined by the label x-axis interval and the label line position, set the layout order of the labels not drawn.
[0063] In a preferred but non-limiting embodiment, specifically, in Figure 3 For example, if label B is placed first and label A is placed second, the y-coordinate of label A is adjusted to achieve non-intersection; if label A is placed first and label B is placed second, intersection occurs. Note that label B cannot be placed below label A and cannot block the waveform interval.
[0064] In a preferred but non-limiting embodiment, assuming label N, whose x-axis interval is [N1, N2], label line position n, N1≤n≤N2, label M, whose x-axis interval is [M1, M2], label line position m, M1≤m≤M2, then define:
[0065] (1) M influences N: that is, m belongs to the interval [N1, N2], N1≤m≤N2.
[0066] (2) M unidirectionally influences N: that is, M influences N, but N does not influence M.
[0067] (3) MN bidirectionally influences: that is, M influences N, and N influences M.
[0068] In a further preferred embodiment, step 2 can include:
[0069] Step 2-1, place all the labels not drawn into set L according to the position of the label line, and at the same time, place all the labels not drawn into set R;
[0070] Step 2-2, if set L is empty, place the labels in set R into queue C;
[0071] Step 2-3, if set R is empty, place the labels in set L into queue D;
[0072] Step 2-4, if both set L and set R are not empty, if any label in either set L or set R does not influence other labels, remove it from the corresponding set and place it into queue C; where influence means that the placement of the label line will block the display of other label entries.
[0073] Step 2-5, select the label l with the largest sample number in set L and the label r with the smallest sample number in set R, if l influences r and r does not influence l, take out l and place it into queue D, otherwise continue;
[0074] Step 2-6, select the label l with the largest sample number in set L and the label r with the smallest sample number in set R, if r influences l and l does not influence r, take out r and place it into queue D, otherwise continue;
[0075] Step 2-7, select the label 1 with the largest sample number in L and the label r with the smallest sample number in R. If 1 and r affect each other, calculate the number of labels affected by 1 and r respectively, and take the one that affects more labels to put into the queue D, otherwise continue.
[0076] Step 2-8, if L or R is empty, refer to step 2-2 or step 2-3 for processing, otherwise return to step 2-4.
[0077] Step 2-9, finally get two queues C and D, and the layout order is: first, layout the elements in D in order, and then layout the elements in C in reverse order.
[0078] Step 3, if there is no drawing space on the upper or lower side of the recording waveform, place the labels on one side of the waveform center line in the order of layout.
[0079] Specifically, as shown in Figure 4 , the space occupied by the label refers to the space occupied by the label entry, and the space corresponding to the label line is not counted as the space occupied by the label. In order to be clear, the rectangular interval is large, and the actual space is bounded by the text rectangular frame and the label line.
[0080] In a preferred but non-limiting embodiment, step 3 can include:
[0081] Step 3-1, when placing a new label, its occupied space satisfies and does not affect all placed labels, does not consider the label line, and in order to be clear, a small gap should be left between the two labels in the y-axis direction, and the placement should be as close to the central axis of the waveform curve as possible.
[0082] Step 3-2, as shown in Figure 5 , calculate the rectangular region of the current label, add the gap to form two rectangles X and Y, and test from the position closest to the central axis to see if it can be placed, that is, check whether XY and all placed labels AB affect each other.
[0083] Step 3-3, move A from bottom to top to check if it affects B, for example, as shown in Figure 5 , A and B affect each other, obviously the reasonable position of A is that the bottom coordinate of A is greater than the top coordinate of B.
[0084] Step 3-4, for multiple labels B, C, D, …, calculate the reasonable position respectively until there is no influence.
[0085] Step 4, if there is drawing space on both the upper and lower sides of the recording waveform, place the labels on both sides of the waveform center line in the order of layout.
[0086] In a preferred but non-limiting embodiment, specifically, step 4 can include:
[0087] Step 4-1, place the upper side of the center line, record the position, whether the label line affects;
[0088] Step 4-2, place the lower side of the center line, record the position, whether the label line affects;
[0089] Step 4-3, select the one without influence and close to the center line.
[0090] Step 5, if the above drawing process does not affect the label, the drawing is completed; if it will affect the label, return to step 2, adjust the label drawing order, repeat steps 2-4 to get all possible layout schemes.
[0091] Specifically, when adjusting the drawing order, the label that affects other labels is preferentially drawn.
[0092] Step 6, automatically select the most reasonable layout scheme using a force-directed algorithm.
[0093] In a preferred but non-limiting embodiment, specifically, step 6 can include:
[0094] Step 6-1, as shown in Figure 6 , the label line is regarded as a spring, and the equilibrium position is located outside the wave region, at a distance h from the center axis, let the label line length be x, and define the energy as k1(x-h) 2 , where x≥h;
[0095] Step 6-2, the label entry is only adjusted in the vertical direction, there is an influence, or it is too close to have energy;
[0096] Step 6-3, let label A have a width wA, a height hA, and a center point coordinate (xA, yA), and let label B have a width wS, a height hB, and a center point coordinate (xB, yB), when (wA+wB) / 2<|xA-xB|, the label does not affect, there is no repulsion, and the energy is 0;
[0097] Step 6-4, when (wA+wB) / 2≥|xA-xB|, and |yA-yB|<c+(hA+hB) / 2, where c is the gap, there is energy at this time, as the label entry is not allowed to affect, adjusting the y coordinate can achieve no influence, and the influence energy is defined as a large constant K2, as shown in Figure 7 , the influence energy ensures that the label entries do not affect each other and ensures that there is a gap between the labels;
[0098] Step 6-5, as shown in Figure 8 , when the label line and the label entry intersect, there is energy, and the energy coefficient of each intersection is defined as K3, and K2>>K3>>k1(x-h) 2The cross energy guarantee label line and the label entry are not crossed as much as possible, and the most reasonable layout is selected in multiple layouts.
[0099] The present application visualizes and simply displays the fault analysis process based on the recording wave and the related events by displaying the switch variable displacement and the protection event information as graphical labels and marking on the related waveform channel curve based on the time axis synchronization. Meanwhile, based on the force guiding algorithm, different cross energy coefficients are defined, so that in multiple label selection and layout methods, a most reasonable and lossless layout is automatically selected for display, which further facilitates the viewing of the fault analysis personnel and eliminates the trouble of manually comparing the waveform changes and the related events.
[0100] The applicant of the present application has made a detailed description and explanation of the embodiment examples of the present application in combination with the drawings of the specification. However, those skilled in the art should understand that the above embodiment examples are only preferred embodiments of the present application, and the detailed description is only to help the reader better understand the spirit of the present application, and is not a limitation on the protection scope of the present application. On the contrary, any improvement or modification based on the spirit of the present application should fall within the protection scope of the present application.
Claims
1. A method for automatic layout of waveform recordings and event labels based on a force-guided algorithm, characterized in that, Includes the following steps: Step 1: Visualize the switch change information or protection event information as spatial labels. The labels include: label lines and label entries. Step 2: Based on the spatial influence relationship between labels defined by the label x-axis interval and label line position, set the layout order of undrawn labels; Suppose label N has an x-axis interval of [N1, N2] and a label line position of n, where N1 ≤ n ≤ N2; label M has an x-axis interval of [M1, M2] and a label line position of m, where M1 ≤ m ≤ M2; then define: (1) M influences N, indicating that m belongs to the interval [N1, N2], N1 ≤ m ≤ N2; (2) M unidirectionally affects N means that M affects N, but N does not affect M; (3) The bidirectional influence of MN means that M influences N, and N influences M; Step 2 specifically includes: Step 2-1: Place all undrawn labels into set L according to the position of the label lines, and at the same time, place all undrawn labels into set R. Step 2-2: If set L is empty, add set R to queue C; Steps 2-3: If set R is empty, add set L to queue D; Steps 2-4: If both sets L and R are not empty, and if a label in either set L or set R does not affect other labels, then remove it from the corresponding set and put it into queue C. Steps 2-5: Select the label l with the largest sampling number in set L and the label r with the smallest sampling number in set R. If l affects r but r does not affect l, remove l and put it into queue D; otherwise, continue. Steps 2-6: Select the label l with the largest sampling number in L and the label r with the smallest sampling number in R. If r affects l but l does not affect r, remove r and put it into queue D; otherwise, continue. Steps 2-7: Select the label l with the largest sampling number in L and the label r with the smallest sampling number in R. If l and r affect each other, calculate the number of all other labels affected by l and r respectively. Take the label with the most affected labels and put it into queue D. Otherwise, continue. Step 2-8: If L or R is empty, proceed to step 2-2 or step 2-3; otherwise, return to step 2-4. Steps 2-9 result in two queues, C and D, with the following layout order: first, arrange the elements in D sequentially, then arrange the elements in C in reverse order. Step 3: If there is no drawing space above or below the waveform, place the labels on one side of the waveform centerline in the order of layout. Step 4: If there is drawing space on both the upper and lower sides of the recorded waveform, place the labels on both sides of the waveform centerline in the order of layout. Step 5: If the above drawing process does not affect the labels, the drawing is complete; if the labels affect the drawing, return to step 2, adjust the label drawing order, and repeat steps 2-4 to obtain all possible layout schemes. Step 6: Use a force-guided algorithm to automatically select the most reasonable layout scheme; Step 6-1: Treat the label line as a spring, with its equilibrium position located outside the waveform region, h distance from the central axis. Let the label line length x be defined as the energy k1(xh). 2 , where x≥h; Step 6-2: Adjusting the labels only vertically has an impact, or if they are too close together, energy may be present. Step 6-3: Set label A with width wA, height hA, and center point coordinates (xA, yA), and label B with width wB, height hB, and center point coordinates (xB, yB). When (wA + wB) / 2 < |hA - xB|, the label will not be affected, there is no repulsive force, and the energy is 0. Step 6-4: When (wA + wB) / 2 ≥ |xA - xB| and |yA - yB| < c + (hA + hB) / 2, where c is the gap, there is energy at this time. Since label entries are not allowed to affect each other, and adjusting the y coordinate can achieve no impact. Define the impact energy as a large constant K2. The impact energy ensures that label entries do not affect each other and ensures there is a gap between labels. Step 6-5: When label lines and label entries intersect, energy exists. Define the energy coefficient for each intersection as K3, and K2 >> K3 >> k1(xh). 2 Cross energy ensures that label lines and label entries do not cross.
2. The automatic layout method for oscillogram and event labels based on force-guided algorithm according to claim 1, wherein In step 1, a label includes a label line and one or more label entries. When there is only one event at the same time, a label contains only one label entry. When there are multiple events at the same time, a label contains multiple label entries. All label entries of the same label are on the same side of the label line. Different labels are affected by the display space and are located on the left or right side of the label line.
3. The automatic layout method for oscillogram and event labels based on force-guided algorithm according to claim 1, wherein In step 1, the information of the label entry includes: the change information in the switched quantity channel of the recording file, the event information in the recording fault report header file, or external event information.
4. The automatic layout method for oscillogram and event labels based on force-guided algorithm according to claim 1, wherein In step 3, the space occupied by the label is the space occupied by the label entry; the space corresponding to the label line is not counted as the space occupied by the label.
5. The automatic layout method for oscillogram and event labels based on force-guided algorithm according to claim 1, wherein Step 3 specifically includes: Step 3-1: When placing a new label, the space it occupies should satisfy that it does not affect all the already placed labels. And for clarity, leave a gap between two labels in the y-axis direction. When placing, it should be close to the mid-axis of the waveform curve. Step 3-2: Calculate the rectangular area of the current label, plus the gap, to form two rectangles X and Y. Starting from the position closest to the mid-axis, test whether it can be placed outward, and check whether XY and all the already placed labels AB have an impact. Step 3-3: Move A from bottom to top and check whether it affects B. The reasonable position of A is that the bottom coordinate of A is greater than the top coordinate of B. Step 3-4: For multiple labels B, C, D, ……, calculate the reasonable positions respectively until there is no impact.
6. The automatic layout method for oscillogram and event labels based on force-guided algorithm according to claim 5, wherein Step 4 specifically includes: Step 4-1: Place it above the mid-line and record the position and whether the label line is affected. Step 4-2: Place it below the mid-line and record the position and whether the label line is affected. Step 4-3: Select the one that has no impact and is close to the mid-line.
7. The automatic layout method for waveform recordings and event labels based on a force-guided algorithm according to claim 1, characterized in that, In step 5, when adjusting the drawing order, first draw the labels that affect other labels.
Citation Information
Patent Citations
Tag layout optimization engineering investigation map automatic drawing method
CN108536883A
A topological placement algorithm for irregular regions based on force guidance
CN109145462A