Primary main wiring diagram on-site configuration method based on microcomputer protection

By pre-setting a graphic element dictionary and double-page mirror mapping in the microcomputer protection device, and combining adaptive algorithms and dynamic redrawing strategies, the problems of on-site modification of primary wiring diagrams and screen stability in the prior art are solved, and fast and reliable graphic element management and interface refresh are achieved.

CN120879458AActive Publication Date: 2025-10-31ANHUI PUERDUN ELECTRIC CO LTD

Patent Information

Application Number
CN202510943025.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-10-31
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

The primary wiring diagram of the existing microcomputer protection device needs to be returned to the factory for re-flashing when adding or removing field equipment or upgrading firmware. Limited storage/computing power leads to screen distortion and refresh flickering, and it cannot be used with LCDs of different sizes in a plug-and-play manner.

Method used

A preset primitive dictionary is used to generate primitive identifiers, a two-page mirror mapping relationship is established, and a residual pixel adaptive algorithm and global coordinate transformation are combined to dynamically adjust the redrawing strategy, thereby achieving dynamic allocation and efficient refreshing of primitives.

Benefits of technology

It enables rapid modification of the main wiring diagram without power outages or return to the factory, reducing maintenance costs, avoiding screen distortion and flickering, and ensuring interface readability and operational reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120879458A_ABST
    Figure CN120879458A_ABST
Patent Text Reader

Abstract

The invention discloses a primary main wiring diagram on-site configuration method based on microcomputer protection, and relates to the technical field of power system microcomputer protection. Two-stage mapping from a grid position to a primitive identifier and two-stage mapping from the primitive identifier to a rendering handle are maintained in parallel in a nonvolatile memory through a double-page mirroring transaction; reading screen resolution, adaptively calculating blank space and grid scaling according to a residual pixel threshold value, and outputting global coordinates; monitoring virtual switching value change in an operation period, dynamically selecting local or whole-screen refreshing according to a dirty rectangle merging algorithm, and triggering a degradation strategy in combination with a comprehensive load score; the protection device can be safely and rapidly rearranged in a low-resource mode on site, a main wiring diagram is refreshed in real time, and the problems of factory returning upgrading, resolution ratio adaptation and refreshing lagging are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system microprocessor protection technology, and more specifically, to a method for local configuration based on the primary main wiring diagram of microprocessor protection. Background Technology

[0002] Microcomputer-based power system protection refers to automated protection equipment that utilizes microcomputer technology, such as digital signal processors and embedded systems, to perform real-time monitoring, fault detection, and rapid disconnection of power system equipment, such as transmission lines, transformers, generators, and busbars. Microcomputer-based protection systems typically feature buttons and an LCD display interface. The primary wiring diagram, also called the main wiring diagram, represents the wiring routes for power transmission and distribution. Electrical equipment directly connected to the primary wiring is called primary equipment or primary components. The primary wiring diagram reflects the topology between substations and lines and is a commonly used reference for power grid dispatching, maintenance, and planning departments. It has numerous applications in actual real-time dispatching and production management. Currently, to more clearly and intuitively reflect the operating status of power equipment, many microcomputer-based protection manufacturers are adopting large-screen LCD displays to enhance their product's market competitiveness. Large-screen LCD displays integrate the on-site primary main wiring diagram, dynamically displaying the status of primary equipment circuit breakers, energy storage, trolley positions, and grounding switch positions, providing a direct reflection of the primary equipment's operation and is welcomed by equipment maintenance and commissioning personnel. However, many limitations were also discovered during application. The preset main wiring diagram of the equipment did not match the actual equipment, and the association between switch quantities and graphical dynamic elements was incorrect. On-site modifications were required based on the actual situation on site.

[0003] The existing technology has the following shortcomings:

[0004] Most primary wiring diagrams in existing microcomputer protection devices are configured and burned once in the factory using a PC. If equipment is added, removed, or firmware is upgraded in the field, the entire device must be returned to the factory or the entire HMI interface must be re-flashed. Furthermore, protection units generally have limited storage / computing power, and static bit... Figure 1 If multiple resolutions are adapted or real-time status is refreshed, screen distortion, refresh flickering, or even screen distortion due to power failure and corrupted configuration can easily occur.

[0005] To address the above problems, this invention proposes a solution. Summary of the Invention

[0006] The purpose of this invention is to provide a local configuration method based on the primary wiring diagram of a microcomputer protection system.

[0007] The objective of this invention can be achieved through the following technical solutions:

[0008] A method for local configuration of a primary main wiring diagram for microcomputer protection includes: generating element identifiers based on a preset element dictionary, and establishing a two-level mapping relationship in the non-volatile memory of the device using a double-page mirroring method, namely, the first mapping page is used to store the mapping relationship between grid positions and element identifiers, and the second mapping page is used to store the mapping relationship between element identifiers and rendering handles;

[0009] Read the LCD screen resolution and calculate the horizontal and vertical remaining pixel ratios of the screen. Determine the corresponding white space strategy based on the range of the corresponding remaining pixel ratios, and output the global coordinate transformation parameters of the grid cells based on the determined white space strategy.

[0010] The system monitors changes in the virtual switch status and identifies the corresponding affected grid cells, converting them into an initial dirty rectangle list. This initial dirty rectangle list is then sorted in ascending order of ordinate and then abscissa. Starting with the first rectangle in the sorted list, each rectangle is compared sequentially with the next. Adjacent rectangles are merged when the difference in their ordinates does not exceed a preset number of pixels and the distance between their abscissas does not exceed the width of one grid cell. This process continues until all rectangles have been compared, resulting in an optimized dirty rectangle list. When the number of optimized dirty rectangles exceeds a preset maximum local update rectangle count threshold or the percentage of pixels covered by dirty rectangles exceeds a preset coverage percentage threshold, a full-screen redraw mode is activated; otherwise, a partial redraw mode is activated. After maintaining the same redraw mode decision for multiple consecutive refresh cycles, the refresh interval is extended or restored.

[0011] As a further aspect of the present invention, the structure of the graphic element identifier includes: firmware major version number, graphic element category code, and serial number.

[0012] As a further aspect of the present invention: the establishment of a two-level mapping relationship using a double-page mirroring method specifically involves using atomic write transactions: the first mapping page structure includes the number of grid rows M, the number of columns N, and M×N primitive identifiers; the second mapping page constructs an open address hash table to accelerate queries, and when a match is not found, the resource data is parsed through the primitive identifiers to generate a rendering handle.

[0013] As a further aspect of the present invention: the selection of the white space strategy includes: based on a preset set of incremental residual pixel ratio thresholds. Four residual pixel ratio threshold intervals are defined; among them, , ;

[0014] interval Interval Interval Interval Corresponding to white space strategies , , , The dominant strategy is determined based on the proportions of horizontal and vertical residuals.

[0015] As a further aspect of the present invention: the logic for determining the horizontal residual ratio and the vertical residual ratio includes: obtaining the screen width W and screen height H based on the resolution of the current device's LCD screen, and accurately locating the pixels occupied by each grid unit according to their corresponding grid column number N and row number M; thereby obtaining the horizontally used pixels and the vertically used pixels; further subtracting the horizontally used pixels from the screen width W to obtain the remaining horizontal pixels, subtracting the vertically used pixels from the screen height H to obtain the remaining vertical pixels, and using the ratio of the remaining horizontal pixels to the screen width W as the horizontal residual ratio, and the ratio of the remaining vertical pixels to the screen height H as the vertical residual ratio.

[0016] As a further aspect of the present invention: determining the dominant strategy based on the horizontal residual ratio and the vertical residual ratio includes: comparing the horizontal residual ratio, the vertical residual ratio, and a preset residual pixel ratio threshold range to obtain the horizontal white space strategy. and vertical white space strategy ;

[0017] like Then the dominant strategy is to leave blank space. Otherwise, calculate the difference in the dominant direction. ; and the difference in the dominant direction Compare with a preset sensitivity threshold δ;

[0018] When the difference in the dominant direction When the sensitivity threshold δ is greater than the preset sensitivity threshold, the corresponding white space strategy is taken as the dominant white space strategy S; otherwise, the smaller white space strategy number is taken as the dominant white space strategy S.

[0019] Based on the dominant white space strategy S and its corresponding remaining horizontal and vertical pixels, the white space distance around the perimeter is calculated; the calculation methods for each white space strategy are as follows:

[0020] When the dominant white space strategy S is the white space strategy At this time, the left and right margins are equal, and the top and bottom margins are equal; specifically, the remaining horizontal pixels are divided equally and used as the left and right margins, and the remaining vertical pixels are divided equally and used as the top and bottom margins.

[0021] When the dominant white space strategy S is the white space strategy When the left margin is left, the remaining horizontal pixels are multiplied by the preset weight α and the preset weight β are used as the left margin distance, and the right margin distance is the remaining horizontal pixels minus the left margin distance; similarly, the remaining vertical pixels are multiplied by the preset weight β as the upper margin distance and the rest are used as the lower margin distance.

[0022] When the dominant white space strategy S is the white space strategy Time, and the strategy of leaving white space Correspondingly, it is a strategy of using white space. The allocation of supplementary quantities;

[0023] When the dominant white space strategy S is the white space strategy Similarly, the strategy of leaving blank space. The remaining horizontal and vertical pixels are symmetrically allocated to obtain the basic margin; then, the margin is subtracted from the left and top margins respectively according to the preset fine-tuning coefficient γ. The remaining horizontal pixels times The remaining vertical pixels are multiplied by a factor of 1, and the remaining pixels are added to the right and bottom margins.

[0024] As a further aspect of the present invention: the logic for forming the global coordinate transformation parameters is as follows: based on the screen width W and the screen height H, subtract the left margin distance from the screen width W, and then subtract the right margin distance to obtain the internal usable width; similarly, subtract the top margin distance from the screen height H, and then subtract the bottom margin distance to obtain the vertical internal usable height.

[0025] Based on the number of grid rows M, the number of columns N, and the base grid width and height before scaling, the internal available width is divided by the base grid width to obtain the horizontal scaling ratio; the internal available height is divided by the base grid height to obtain the vertical scaling ratio.

[0026] After applying the above scaling ratio, the actual pixel width occupied by the grid cell becomes the base grid width multiplied by the horizontal scaling ratio, and the actual pixel height occupied becomes the base grid height multiplied by the vertical scaling ratio. The horizontal and vertical fine-tuning offsets inside the grid cell are calculated. In the horizontal direction, the difference between the base grid width and the scaled width is divided equally between the left and right sides of the cell to obtain the internal horizontal offset. In the vertical direction, the difference between the base grid height and the scaled height is divided equally between the top and bottom of the cell to obtain the internal vertical offset.

[0027] Use the left margin distance plus the inner horizontal offset to obtain the final horizontal coordinates of the grid origin in the screen coordinate system; use the top margin distance plus the inner vertical offset to obtain the final vertical coordinates of the grid origin in the screen coordinate system.

[0028] The screen width, screen height, number of grid rows M, number of grid columns N, basic grid width, basic grid height, left margin, right margin, top margin, bottom margin, horizontal scaling ratio, vertical scaling ratio, horizontal coordinate of grid origin, and vertical coordinate of grid origin are uniformly encapsulated to form global coordinate transformation parameters for grid cells.

[0029] As a further aspect of the present invention: the condition for enabling the full-screen redraw mode is as follows: based on a preset period, the optimized dirty region list is first subjected to a union calculation at the pixel level, then the total pixel area covered by the dirty rectangle on the screen is calculated, and the ratio is calculated with the total pixel area of ​​the screen to obtain the dirty region coverage ratio.

[0030] The number of dirty rectangles and the coverage ratio of dirty regions in the optimized dirty region list are compared with the preset maximum local update rectangle number threshold and the preset dirty region coverage ratio threshold, respectively.

[0031] If the number of dirty regions after optimization exceeds the preset maximum number of local update rectangles or the dirty region coverage ratio exceeds the preset dirty region coverage ratio threshold, then the full screen redraw mode will be used in this cycle.

[0032] Otherwise, a partial redraw mode will be used, and the optimized list of dirty regions will be cached.

[0033] As a further aspect of the present invention: the extension or restoration of the refresh interval specifically means that mode downgrading or mode restoration is only initiated after multiple consecutive refresh cycles have been in the same redraw mode.

[0034] When multiple consecutive refresh cycles are judged to be full-screen redraw, the trigger mode downgrade redraw will extend the refresh cycle to twice the original length.

[0035] If multiple consecutive refresh cycles are subsequently determined to be partial redraws, the default refresh interval will be restored.

[0036] As a further aspect of the present invention, the performance degradation process also includes the following: after each redraw, the following performance indicators are collected: redraw time in this cycle, total area of ​​updated pixels in this cycle, and system memory usage.

[0037] The above performance indicators are weighted to obtain a comprehensive load score, which is then compared with a preset score threshold.

[0038] If the number of times the overall load score is greater than 1 within the last K refresh cycles is greater than or equal to the preset score threshold, then the downgraded redraw mode is triggered, which means extending the refresh interval to Q times the original and forcing a full screen redraw; in the downgraded state, if the number of times the overall load score is less than or equal to 1 within the last K refresh cycles is greater than or equal to the preset score threshold, then the normal redraw mode is restored and the redraw mode is re-determined.

[0039] The beneficial effects of this invention are:

[0040] (1) This invention, by pre-setting a primitive dictionary inside the device and generating a unified bit primitive identifier for each electrical symbol, and then using an idle linked list + bitmap to complete dynamic allocation, allows field personnel to directly add, delete, and replace symbols on the protection device without ID conflicts; at the same time, in NVM, a two-level mapping page is maintained by using double-page mirror transactions to maintain the grid position → primitive identifier and primitive identifier → rendering handle, and any write operation has atomic commit and power-off rollback capabilities. Thus, a main wiring diagram reorganization can be completed without power interruption or return to the factory, realizing on-site deployment within minutes for engineering change or version upgrade, greatly reducing maintenance costs and avoiding the risk of downtime caused by program rewrite;

[0041] (2) This invention introduces a residual pixel-white space adaptive algorithm to automatically calculate the white space distance, grid scaling factor and origin coordinates according to the screen resolution, ensuring that the same firmware can be used with different sizes of LCDs without distortion; during operation, it is based on dirty rectangle merging + full screen / partial refresh judgment and load score degradation mechanism, only redrawing in necessary areas, and automatically lengthening the refresh cycle and forcing full screen redrawing when under high load, and then returning to normal mode after the load recovers, effectively alleviating screen tearing and flickering in alarm storm scenarios, and significantly improving the interface readability and operational reliability of the protection device. Attached Figure Description

[0042] The invention will now be further described with reference to the accompanying drawings.

[0043] Figure 1 This is a schematic flowchart of a local configuration method for a primary main wiring diagram of microcomputer protection according to the present invention;

[0044] Figure 2 This is a schematic diagram of element selection for a local configuration method of a primary main wiring diagram for microcomputer protection according to the present invention;

[0045] Figure 3 This is a schematic diagram of element editing for a local configuration method of a primary main wiring diagram for microcomputer protection based on the present invention;

[0046] Figure 4 This is a schematic diagram of the liquid crystal area division of a local configuration method based on the primary main wiring diagram of microcomputer protection according to the present invention;

[0047] Figure 5 This is a schematic diagram of virtual switch quantity association based on the local configuration method of the primary main wiring diagram of microcomputer protection according to the present invention;

[0048] Figure 6 This is a schematic diagram of the operation of the equipment based on the local configuration method of the primary main wiring diagram of microcomputer protection according to the present invention. Detailed Implementation

[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0050] Example 1

[0051] Please see Figure 1 As shown, this invention is a local configuration method based on the primary main wiring diagram of a microcomputer protection system, comprising the following steps:

[0052] like Figures 2-3 As shown, step one: Based on the preset primitive dictionary, generate primitive identifiers corresponding to each type of electrical symbol according to the firmware main version, primitive category and sequence number combination, and construct a free linked list and corresponding bitmap with the primitive identifiers; at the same time, create and establish a two-level mapping relationship in an internal non-volatile memory using mirror write transactions, namely a first mapping page and a second mapping page. The index relationship of the first mapping page is grid position-primitive identifier, and the index relationship of the second mapping page is primitive identifier-rendering handle;

[0053] Based on the pre-built primitive dictionary stored in the device's internal read-only memory, a unified primitive identification encoding method is defined for each primitive category. The primitive identification structure includes three fields: firmware major version number, primitive category code, and sequence number.

[0054] A two-level index table is constructed in the read-only memory inside the device: the first version index table uses the firmware major version number as the key to indicate the index area address of each version corresponding to the category; the second category index table maintains a continuous array of index records for each graphic element category and records the maximum sequence number value of that category.

[0055] The firmware major version number is used to ensure compatibility of multiple versions of graphic elements, such as 0100 for V1.0 and 0201 for V2.1; the graphic element category code is used to distinguish different types of electrical components, such as 0001 for circuit breakers, 0010 for disconnectors, and 0011 for grounding switches; the serial number increments gradually within each category to uniquely identify a specific graphic element.

[0056] In this embodiment, a 64-bit integer format is used to generate the primitive identifier. The high 16 bits are the firmware major version number, the middle 8 bits are the primitive category, the lower 16 bits are the primitive sequence number, the last 8 bits are the CRC8 check code calculated from the above 48 bits of data, and the lowest 16 bits are kept as zero.

[0057] The primitive identifier generation logic includes: shifting the firmware main version number left by 48 bits, shifting the primitive category left by 40 bits, shifting the primitive sequence number left by 24 bits, and merging them into a 48-bit original value; performing a CRC8 operation of polynomial 0x31 on the original value to obtain a 1-byte checksum; filling the checksum into bits 16 to 23 of the primitive identifier to form a complete 64-bit identifier; for example, when the firmware version is V1.0, the category is circuit breaker, and the sequence number is 3, the primitive identifier is 0100000100000011;

[0058] It should be noted that the preset graphic element dictionary lists the basic information of each electrical symbol graphic element in tabular form. The table contains three columns: the first column, ID, is the sequential identifier of the graphic element, which corresponds to a 64-bit graphic element identifier generated by the firmware main version number, graphic element category, and serial number in the actual firmware; the second column, name, is the function or semantic description of each graphic element; and the third column, graphic element, is a preview of the corresponding bitmap or vector graphic. In the prior art, the above graphic element dictionary is usually pre-made by professional electrical drawing or human-machine interface engineers according to industry standards and project requirements. All resource files, such as PNG bitmaps, SVG vector data, and their metadata such as storage offset and length in Flash are also organized and archived together. After undergoing version management CRC verification, the dictionary is packaged into the firmware and stored in read-only mode in on-chip Flash or external non-volatile memory. When the device starts up, the preset primitive dictionary is loaded into the device's internal read-only memory, and a firmware version index table and a category index table are constructed for subsequent steps to automatically select and generate corresponding primitive identifiers based on the firmware major version number. Therefore, the preset primitive dictionary described in this embodiment is a well-designed, stable, and reliable electrical symbol resource and its management method in the prior art, providing basic data support for further dynamic allocation and rendering mechanisms. It will not be elaborated further in this example.

[0059] When the device receives a primitive allocation request during operation, it first retrieves a primitive identifier to be allocated from the head of the free list in the device's internal read-only memory, and sets the corresponding bit value from 0 to 1 in the bitmap to indicate that the primitive has been occupied; if the free list is empty, it triggers a dictionary rescan and rebuilds the free list.

[0060] The initialization process of the free list is as follows: traverse all legal primitive categories and sequence number combinations in the dictionary, call the primitive identifier generation logic to generate identifiers; for each generated primitive identifier, if the corresponding bit in the bitmap is 0, encapsulate it as a linked list node and insert it into the tail of the free list in sequence; after traversal, the initial free list and the initial bitmap are formed.

[0061] To reduce the overhead of frequent allocation / release, this embodiment maintains an additional 64-entry Level 1 release cache L1 in the device's internal read-only memory. When releasing, the released primitives are first marked in Level 1 release cache L1. When Level 1 release cache L1 is full or the system is idle, all nodes in Level 1 release cache L1 are returned to the free list in batches, and the corresponding bits in the initial bitmap are cleared synchronously.

[0062] In this embodiment, a two-page mirror write transaction mechanism is used in the internal non-volatile memory (NVM) to create and maintain two types of mapping pages: the first mapping page is used to store the mapping relationship between grid position and primitive identifier, and the second mapping page is used to store the mapping relationship between primitive identifier and rendering handle.

[0063] Specifically, the first mapped page body structure is as follows: 16-bit grid row number M, 16-bit grid column number N, followed by storing M×N 64-bit primitive identifiers in row-major order; the value of unallocated units is 0; the page body can optionally be supplemented with a row-level CRC of 2 bytes per row to accelerate verification;

[0064] The loading logic for the first mapped page is as follows: After the system starts or the transaction is committed, the headers of page A and page B are read first, the transaction sequence number is compared with the validity flag, the mapped page with the larger transaction sequence number and the validity flag is set to be valid is selected, and its entire page body is loaded into the internal read-only memory buffer of the device.

[0065] If the row index and column index are in the range [0, M−1] and [0, N−1] respectively, then calculate the offset address: header size + 4 bytes + ((row × N + col) × 8 bytes), and directly read 8 bytes to return the primitive identifier; if the return value is 0, it means that the grid cell has not been allocated a primitive.

[0066] The second mapping page body structure is: a 32-bit unsigned integer, followed by a record of unsigned integers stored sequentially. Each record contains a 64-bit primitive identifier, a 32-bit rendering handle, a 16-bit attribute flag, and a 16-bit LRU timestamp.

[0067] To accelerate queries, the system constructs an open address hash table for the second mapped page in the device's internal read-only memory.

[0068] And probe in the open address hash table: if a record is found whose primitive identifier matches the input primitive identifier exactly, return the rendering handle; if no empty slot or deleted slot is found, execute the resource loading process, append the new record to the backup page and commit the transaction.

[0069] The resource loading process described above includes: parsing the firmware major version number, primitive category, and sequence number from the primitive identifier; obtaining the resource offset and length through a two-level index of a pre-set primitive dictionary; if the resource is a vector combination, calling the geometry engine to generate a texture; if it is a bitmap, directly decoding it; calling the GPU interface to create a rendering handle, and appending the handle, primitive identifier, attribute tag, and LRU initialization value to the backup page record; the mirror write transaction of the second mapping page is the same as that of the first mapping page, ensuring that any write operation is completed atomically, and at least one valid page is retained after power failure; at the same time, for records that have been deleted or evicted by LRU, the primitive identifier is set to 0 and the record of the unsigned integer is updated, and then the transaction is committed.

[0070] like Figure 4 As shown, step two: read the resolution of the device's LCD screen and calculate the horizontal and vertical margin pixels of the screen. Dynamically select the corresponding white space strategy based on the remaining pixels of the screen, and calculate the corresponding white space distance and grid scaling factor based on the selected white space strategy, and generate global coordinate transformation parameters.

[0071] Read the resolution of the current device's LCD screen to obtain the screen width W and height H; if either W or H is less than a preset minimum value... , If an error occurs, the error will be logged and the system will revert to the default resolution. , Based on the defined number of grid rows M and columns N, which are consistent with the mapping page structure, the configuration file sets the remaining pixel ratio and whitespace strategy mapping table, including: a set of preset incremental residual pixel ratio thresholds. Four residual pixel ratio threshold intervals are defined; among them, , ;

[0072] interval Interval Interval Interval And the above interval , interval , interval , interval ; corresponding to white space strategies , , , ;

[0073] Calculate the base grid width Basic grid height This is used to precisely locate the pixels occupied by each grid cell; thus, the horizontally used pixels are obtained. Vertical pixels used ;

[0074] Further calculate the remaining horizontal pixels Remaining vertical pixels The ratio of the remaining horizontal pixels to the screen width W is used as the horizontal residual ratio. The ratio of the remaining vertical pixels to the screen height H is used as the vertical residual ratio. ;

[0075] Based on the horizontal residual ratio respectively Longitudinal residual ratio The horizontal white space strategy is obtained by comparing it with the preset residual pixel ratio threshold range. and vertical white space strategy The horizontal white space strategy and vertical white space strategy Determined based on the following formula:

[0076] ;

[0077] According to the above formula, if Then the dominant strategy is to leave blank space. Otherwise, calculate the difference in the dominant direction. ; and the difference in the dominant direction Compare with a preset sensitivity threshold δ;

[0078] When the difference in the dominant direction When the sensitivity threshold δ is greater than the preset sensitivity threshold, the corresponding white space strategy is taken as the dominant white space strategy S; otherwise, the smaller white space strategy number is taken as the dominant white space strategy S.

[0079] Based on the dominant white space strategy S and its corresponding remaining horizontal pixels and remaining vertical pixels Calculate the surrounding white space distance; the calculation methods for each strategy are as follows:

[0080] When the dominant white space strategy S is the white space strategy At that time, the left and right margins are equal, and the top and bottom margins are equal; specifically, the remaining horizontal pixels... After dividing into equal parts, use the space for left and right margins, and then use the remaining vertical pixels. Divide into equal parts and use the top and bottom margins;

[0081] When the dominant white space strategy S is the white space strategy At that time, the remaining horizontal pixels are adjusted using preset weights α and β. The left margin distance is calculated by multiplying by a preset weight α, and the right margin distance is the remaining horizontal pixels. Subtract the left margin distance; similarly, subtract the remaining vertical pixels. Multiply the value by the preset weight β to get the upper margin distance, and use the rest as the lower margin distance;

[0082] When the dominant white space strategy S is the white space strategy Time, and the strategy of leaving white space Correspondingly, the white space is mainly concentrated on the right or bottom, which will not be elaborated on further here; it can be regarded as a strategy of white space. The allocation of supplementary quantities;

[0083] When the dominant white space strategy S is the white space strategy At the same time, the white space strategy Remove the remaining horizontal pixels and remaining vertical pixels The basic margins are symmetrically allocated; then, based on the preset fine-tuning coefficient γ, the margins are subtracted from the left margin distance and the top margin distance respectively. , Add the remaining pixels to the right and bottom margins;

[0084] Given the screen width W and height H, as well as the left and right margins, first calculate the width that can actually be used to draw the grid in the horizontal direction; that is, subtract the left margin from the total screen width, and then subtract the right margin to get the usable internal width; similarly, in the vertical direction, subtract the top margin from the screen height, and then subtract the bottom margin to get the usable internal height.

[0085] Based on base grid width Basic grid height And the number of grid rows M and the number of columns N; divide the internal available width by the base grid width. To obtain the horizontal scaling ratio Divide the available internal height by the base grid height. To obtain the vertical scaling ratio Where x and y correspond to the horizontal and vertical screen coordinates, respectively;

[0086] After applying the corresponding scaling ratio, the actual pixel width occupied by a grid cell will become the base width multiplied by the scaling factor, and the height will also change accordingly. In order to center each cell in its original base grid, the remaining horizontal pixel space needs to be calculated: subtract the scaling width from the base width, and divide the remaining space equally on the left and right sides inside the cell.

[0087] Similarly, calculate the remaining vertical space, subtract the scaled height from the base height, and divide the remaining space vertically within the unit; this gives the internal horizontal space of each unit. and internal longitudinal offset The starting point of the grid on the screen should be located after the white space area, plus the fine-tuning offset within the unit. Therefore, by adding the left white space distance to the horizontal offset within the unit, we obtain the final horizontal X position of the grid in the screen coordinate system. Similarly, by adding the upper white space distance to the vertical offset within the unit, we obtain the final vertical Y position of the grid in the screen coordinate system. The final horizontal X coordinate and the final vertical Y coordinate are then marked as the absolute position of the grid origin on the screen.

[0088] The final encapsulated output grid cell global coordinate transformation parameter structure includes: screen width, screen height, number of grid rows M, number of grid columns N, basic grid width, basic grid height, left margin distance, right margin distance, top margin distance, bottom margin distance, horizontal scaling ratio, vertical scaling ratio, horizontal coordinate of grid origin, and vertical coordinate of grid origin.

[0089] like Figures 5-6 As shown, step three: monitor the virtual switch status changes of the device's operating status, locate the affected grid cells and generate an initial dirty rectangle list; merge the initial dirty rectangle list according to the row priority principle. If the number of dirty rectangles after merging exceeds a preset threshold, set the redraw mode to full-screen redraw; otherwise, set it to partial redraw and save the optimized dirty rectangle set.

[0090] Within a preset screen refresh cycle, the current state of all virtual switches is read, compared with the state of the previous cycle, and state flip events are identified; each event is pre-mapped to several grid cell areas.

[0091] It should be noted that the virtual switch used to drive the display and update of various graphic element identifiers in the interface is a Boolean value with only two possible values: off (0) or on (1); each virtual switch corresponds to one or a group of graphic element identifiers on the interface; for example, when the circuit breaker closing virtual switch is 1, the interface displays the icon of the circuit breaker closing status; when it is 0, the icon of the open status is displayed; it is associated with each graphic element identifier one by one.

[0092] For each state change event, the initial dirty region list is calculated using the grid starting coordinates, grid cell width and height, and whitespace distances determined in the global coordinate transformation parameter structure. Specifically, the grid row and column numbers corresponding to the state change event are converted into pixel positions to obtain their corresponding x and y coordinates; the width and height of the pixel rectangle are obtained by multiplying the corresponding grid span by the width and height of the grid cell; the pixel rectangles are added to the initial dirty region list; the initial dirty region list is sorted in ascending order by the y coordinates of the rectangles, and then in ascending order by the x coordinates; adjacent rectangles in the initial dirty region list are compared sequentially. If the difference in their y coordinates does not exceed 2 pixels, and the distance between their x coordinates does not exceed the width of one grid cell, then their minimum left boundary and maximum right boundary are merged into a new rectangle; otherwise, the current rectangle is added as a new item to obtain the optimized dirty region list.

[0093] Based on a preset period, the optimized dirty region list is first subjected to a union calculation at the pixel level, then the total pixel area covered by the dirty rectangle on the screen is calculated, and the ratio is calculated with the total pixel area of ​​the screen to obtain the dirty region coverage ratio.

[0094] The number of dirty rectangles and the coverage ratio of dirty regions in the optimized dirty region list are compared with the preset maximum local update rectangle number threshold and the preset dirty region coverage ratio threshold, respectively.

[0095] If the number of dirty regions after optimization exceeds the preset maximum number of local update rectangles or the dirty region coverage ratio exceeds the preset dirty region coverage ratio threshold, then the full screen redraw mode will be used in this cycle.

[0096] Otherwise, a partial redraw mode is used, and the optimized list of dirty areas is cached so that only these areas are redrawn in this refresh. To avoid frequent mode switching, mode degradation or mode recovery is only initiated after several consecutive refresh cycles, such as three refresh cycles, in the same redraw mode.

[0097] When three consecutive refresh cycles are judged to be full-screen redraw, the mode downgrade redraw will be triggered, which will extend the refresh cycle to twice the original.

[0098] If the subsequent three consecutive refresh cycles are judged as partial redrawing, the default refresh interval will be restored.

[0099] After completing the redraw based on the corresponding redraw mode, clear the dirty area list to prepare for the next cycle.

[0100] The local redraw involves submitting the optimized dirty areas to the rendering engine and calling the area redraw interface one by one to update only these areas; the full-screen redraw involves ignoring all dirty areas and directly calling the full-screen refresh interface.

[0101] After each dirty region completes redrawing according to its corresponding redraw mode, the dirty rectangle markers are cleared and the next redraw cycle is prepared. Based on the redrawing time of this cycle, the total area of ​​updated pixels in this cycle, and system memory usage at the end of each screen redraw cycle, it is determined whether the threshold has been exceeded. If the threshold is exceeded consecutively, a degraded redrawing strategy is switched and the refresh interval is increased. After the indicators return to normal, the system gradually returns to the normal redrawing mode, specifically:

[0102] After each redraw, the following performance metrics are collected: redraw time for this cycle, total area of ​​updated pixels for this cycle, and system memory usage.

[0103] The above performance indicators are weighted to obtain a comprehensive load score, which is then compared with a preset score threshold. If the number of times the comprehensive load score is greater than 1 in the last K refresh cycles is greater than or equal to the preset score threshold, a downgraded redraw mode is triggered, which extends the refresh cycle to Q times the original and forces a full-screen redraw. In the downgraded state, if the number of times the comprehensive load score is less than or equal to 1 in the last K refresh cycles is greater than or equal to the preset score threshold, the normal redraw mode is restored, and the partial redraw mode or the full-screen redraw mode is re-determined according to step three.

[0104] In this embodiment, a primitive identifier containing version number, category, serial number, and CRC is generated using a preset primitive dictionary. A two-level mapping of "grid position → primitive identifier" and "primitive identifier → rendering handle" is maintained in parallel in non-volatile memory via double-page mirror transactions. The screen resolution is read, and whitespace and grid scaling are adaptively calculated based on residual pixel thresholds to output global coordinates. During runtime, changes in virtual switch quantities are monitored, and local or full-screen refresh is dynamically selected according to the dirty rectangle merging algorithm, combined with a comprehensive load score to trigger a degradation strategy. This method enables the protection device to be safely, quickly, and with low resources redeployed in the field and refresh the main wiring diagram in real time, solving the problems of factory upgrades, resolution adaptation, and refresh stuttering. It has advantages such as power-off safety, high-resolution compatibility, and strong real-time performance.

[0105] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0106] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.

[0107] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and inventive constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0108] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0109] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0110] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A local configuration method based on the primary main wiring diagram of microcomputer protection, characterized in that, include: Primitive identifiers are generated based on a preset primitive dictionary, and a two-level mapping relationship is established in the device's non-volatile memory using a double-page mirroring method. The first mapping page is used to store the mapping relationship between grid positions and primitive identifiers, and the second mapping page is used to store the mapping relationship between primitive identifiers and rendering handles. Read the LCD screen resolution and calculate the horizontal and vertical remaining pixel ratios of the screen. Determine the corresponding white space strategy based on the range of the corresponding remaining pixel ratios, and output the global coordinate transformation parameters of the grid cells based on the determined white space strategy. The system monitors changes in the virtual switch status and identifies the corresponding affected grid cells, converting them into an initial dirty rectangle list. This initial dirty rectangle list is then sorted in ascending order of ordinate and then abscissa. Starting with the first rectangle in the sorted list, each rectangle is compared sequentially with the next. Adjacent rectangles are merged when the difference in their ordinates does not exceed a preset number of pixels and the distance between their abscissas does not exceed the width of one grid cell. This process continues until all rectangles have been compared, resulting in an optimized dirty rectangle list. When the number of optimized dirty rectangles exceeds a preset maximum local update rectangle count threshold or the percentage of pixels covered by dirty rectangles exceeds a preset coverage percentage threshold, a full-screen redraw mode is activated; otherwise, a partial redraw mode is activated. After maintaining the same redraw mode decision for multiple consecutive refresh cycles, the refresh interval is extended or restored.

2. The method for local configuration of a microcomputer-based primary main wiring diagram for protection according to claim 1, characterized in that, The structure of the graphic element identifier includes: firmware major version number, graphic element category code, and serial number.

3. The method for local configuration of a microcomputer-based primary main wiring diagram for protection according to claim 1, characterized in that, The establishment of a two-level mapping relationship using a double-page mirroring method specifically involves using atomic write transactions: the first mapping page structure contains M grid rows, N columns, and M×N primitive identifiers; The second mapping page constructs an open address hash table to accelerate queries. When a match is not found, resource data is parsed using primitive identifiers to generate a rendering handle.

4. The method for local configuration of a microcomputer-based primary main wiring diagram for protection according to claim 1, characterized in that, The selection of the white space strategy includes: based on a preset incremental residual pixel ratio threshold. Four residual pixel ratio threshold intervals are defined; among them, , ; interval Interval Interval Interval Corresponding to white space strategies , , , The dominant strategy is determined based on the proportions of horizontal and vertical residuals.

5. A method for local configuration of a microcomputer-based primary main wiring diagram for protection according to claim 4, characterized in that, The logic for determining the horizontal and vertical residual ratios includes: obtaining the screen width W and screen height H based on the resolution of the current device's LCD screen, and accurately locating the pixels occupied by each grid unit according to their corresponding grid column number N and row number M; thereby obtaining the horizontally used pixels and the vertically used pixels; further subtracting the horizontally used pixels from the screen width W to obtain the remaining horizontal pixels, and subtracting the vertically used pixels from the screen height H to obtain the remaining vertical pixels, and using the ratio of the remaining horizontal pixels to the screen width W as the horizontal residual ratio, and the ratio of the remaining vertical pixels to the screen height H as the vertical residual ratio.

6. The method for local configuration of a microcomputer-based primary main wiring diagram for protection according to claim 4, characterized in that, The dominant strategy is determined based on the horizontal and vertical residual ratios, including comparing the horizontal and vertical residual ratios with preset residual pixel ratio threshold ranges to obtain the horizontal whitespace strategy. and vertical white space strategy ; like The dominant strategy is to leave blank space. Otherwise, calculate the difference in the dominant direction. ; and the difference in the dominant direction Compare with a preset sensitivity threshold δ; When the difference in the dominant direction When the sensitivity threshold δ is greater than the preset sensitivity threshold, the corresponding white space strategy is taken as the dominant white space strategy S; otherwise, the smaller white space strategy number is taken as the dominant white space strategy S. Based on the dominant white space strategy S and its corresponding remaining horizontal and vertical pixels, the white space distance around the perimeter is calculated; the calculation methods for each white space strategy are as follows: When the dominant white space strategy S is the white space strategy At this time, the left and right margins are equal, and the top and bottom margins are equal; specifically, the remaining horizontal pixels are divided equally and used as the left and right margins, and the remaining vertical pixels are divided equally and used as the top and bottom margins. When the dominant white space strategy S is the white space strategy When the left margin is left, the remaining horizontal pixels are multiplied by the preset weight α and the preset weight β are used as the left margin distance, and the right margin distance is the remaining horizontal pixels minus the left margin distance; similarly, the remaining vertical pixels are multiplied by the preset weight β as the upper margin distance and the rest are used as the lower margin distance. When the dominant white space strategy S is the white space strategy Time, and the strategy of leaving white space Correspondingly, it is a strategy of using white space. The allocation of supplementary quantities; When the dominant white space strategy S is the white space strategy Similarly, the strategy of leaving blank space. The remaining horizontal and vertical pixels are symmetrically allocated to obtain the basic margin; then, the margin is subtracted from the left and top margins respectively according to the preset fine-tuning coefficient γ. The remaining horizontal pixels times The remaining vertical pixels are multiplied by a factor of 1, and the remaining pixels are added to the right and bottom margins.

7. A method for local configuration of a microcomputer-based primary main wiring diagram for protection according to claim 1, characterized in that, The logic for forming the global coordinate transformation parameters is as follows: Based on the screen width W and screen height H, subtract the left margin distance from the screen width W, and then subtract the right margin distance to obtain the internal usable width; similarly, subtract the top margin distance from the screen height H, and then subtract the bottom margin distance to obtain the vertical internal usable height. Based on the number of grid rows M, the number of columns N, and the base grid width and height before scaling, the internal available width is divided by the base grid width to obtain the horizontal scaling ratio; the internal available height is divided by the base grid height to obtain the vertical scaling ratio. After applying the above scaling ratio, the actual pixel width occupied by the grid cell becomes the base grid width multiplied by the horizontal scaling ratio, and the actual pixel height occupied becomes the base grid height multiplied by the vertical scaling ratio. The horizontal and vertical fine-tuning offsets inside the grid cell are calculated. In the horizontal direction, the difference between the base grid width and the scaled width is divided equally between the left and right sides of the cell to obtain the internal horizontal offset. In the vertical direction, the difference between the base grid height and the scaled height is divided equally between the top and bottom of the cell to obtain the internal vertical offset. Use the left margin distance plus the inner horizontal offset to obtain the final horizontal coordinates of the grid origin in the screen coordinate system; use the top margin distance plus the inner vertical offset to obtain the final vertical coordinates of the grid origin in the screen coordinate system. The screen width, screen height, number of grid rows M, number of grid columns N, basic grid width, basic grid height, left margin, right margin, top margin, bottom margin, horizontal scaling ratio, vertical scaling ratio, horizontal coordinate of grid origin, and vertical coordinate of grid origin are uniformly encapsulated to form global coordinate transformation parameters for grid cells.

8. A method for local configuration of a microcomputer-based primary main wiring diagram for protection according to claim 1, characterized in that, The conditions for enabling the full-screen redraw mode are as follows: based on a preset period, the optimized dirty region list is first subjected to a union calculation at the pixel level, then the total pixel area covered by the dirty rectangle on the screen is calculated, and the ratio is calculated with the total pixel area of ​​the screen to obtain the dirty region coverage ratio. The number of dirty rectangles and the coverage ratio of dirty regions in the optimized dirty region list are compared with the preset maximum local update rectangle number threshold and the preset dirty region coverage ratio threshold, respectively. If the number of dirty regions after optimization exceeds the preset maximum number of local update rectangles or the dirty region coverage ratio exceeds the preset dirty region coverage ratio threshold, then the full screen redraw mode will be used in this cycle. Otherwise, a partial redraw mode will be used, and the optimized list of dirty regions will be cached.

9. A method for local configuration of a microcomputer-based primary main wiring diagram for protection according to claim 1, characterized in that, Specifically, extending or restoring the refresh interval means that mode downgrading or mode restoration is only initiated after multiple consecutive refresh cycles have been in the same redraw mode. When multiple consecutive refresh cycles are judged to be full-screen redraw, the trigger mode downgrade redraw will extend the refresh cycle to twice the original length. If multiple consecutive refresh cycles are subsequently determined to be partial redraws, the default refresh interval will be restored.

10. A method for local configuration of a microcomputer-based primary main wiring diagram for protection according to claim 9, characterized in that, The performance degradation process also includes: after each redraw, the following performance metrics are collected: redraw time in this cycle, total area of ​​updated pixels in this cycle, and system memory usage; The above performance indicators are weighted to obtain a comprehensive load score, which is then compared with a preset score threshold. If the number of times the overall load score is greater than 1 within the last K refresh cycles is greater than or equal to the preset score threshold, then the downgraded redraw mode is triggered, which means extending the refresh interval to Q times the original and forcing a full screen redraw; in the downgraded state, if the number of times the overall load score is less than or equal to 1 within the last K refresh cycles is greater than or equal to the preset score threshold, then the normal redraw mode is restored and the redraw mode is re-determined.

Citation Information

Patent Citations

  • Image generation method and device and storage medium

    CN111415396A

  • Image display method and device, computer equipment and storage medium

    CN114996618A

  • Monitoring picture power primitive automatic identification and correction method and system and storage medium

    CN115116083A

  • Production control method and system of UV makeup machine and storage medium

    CN119078363A

  • Display device and multi-channel screen mirroring control method

    WO2025102986A1

Cited By

  • Electro-digital data processing and visualization system for hot working process data

    CN122332307A

  • Electronic digital data processing and visualization system for hot working process data

    CN122332307B