A method for configuring primary wiring diagram on site based on microcomputer protection

By pre-setting a graphic element dictionary and double-page mirror mapping in the microcomputer protection device, combined with adaptive algorithms and dynamic redrawing strategies, the problems of rapid on-site replacement of the primary wiring diagram and screen stability in the microcomputer protection device are solved, achieving plug-and-play efficient maintenance and reliable display.

CN120879458BActive Publication Date: 2026-03-24ANHUI PUERDUN ELECTRIC CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2026-03-24

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

The system generates primitive identifiers using a pre-defined primitive dictionary, establishes a two-page mirror mapping relationship, and combines a residual pixel adaptive algorithm and global coordinate transformation parameters to realize grid scaling and local/full-screen refresh decisions, dynamically adjusting the redrawing strategy.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120879458B_ABST
    Figure CN120879458B_ABST
Patent Text Reader

Abstract

The application discloses a microcomputer protection primary main wiring diagram on-site configuration method, relates to the technical field of microcomputer protection of a power system, and comprises the following steps: generating a graphic element identifier by using a preset graphic element dictionary, maintaining two-level mappings of a grid position to the graphic element identifier and the graphic element identifier to a rendering handle in a nonvolatile memory through a double-page mirror transaction, reading a screen resolution, adaptively calculating a margin and a grid scaling according to a residual pixel threshold value, and outputting a global coordinate, monitoring virtual switch quantity changes in a running period, dynamically selecting local or full-screen refreshing according to a dirty rectangle merging algorithm, and triggering a degradation strategy in combination with a comprehensive load score, and achieving the re-arrangement and real-time refreshing of the main wiring diagram of the protection device on the site in a safe, fast and low-resource manner, so that the problems of returning to a factory for upgrading, resolution adaptation and refreshing lag are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of microcomputer protection of power system, and more particularly, to a method for configuring primary main wiring diagram on site based on microcomputer protection. BACKGROUND

[0002] The microcomputer protection of power system refers to an automatic protection device for real-time monitoring, fault detection and fast removal of power system equipment such as power transmission lines, transformers, generators and busbars by using microcomputer technology such as digital signal processors and embedded systems. The microcomputer protection has a button and a liquid crystal display interface. The primary wiring diagram, also known as the main wiring diagram, is a wiring diagram indicating the route of power transmission and power distribution. The electrical equipment directly connected to the primary wiring is called primary equipment or primary element. The primary wiring diagram can reflect the topology between the plant station and the line and is commonly used by the dispatching, maintenance and planning departments of the power grid as a reference. It has more applications in actual real-time dispatching and production management. In the current era, in order to more clearly and intuitively reflect the operating status of power equipment, many microcomputer protection manufacturers use large-screen liquid crystal displays to improve the market competitiveness of their products. The large-screen liquid crystal integrates the display of the primary main wiring diagram on site, dynamically displays the status of the primary equipment circuit breaker, energy storage, handcart position and grounding knife position, and intuitively reflects the operation of the primary equipment, which is welcomed by equipment operation and maintenance personnel and debugging personnel. However, many limitations have been found in the application process. The primary main wiring diagram preset by the equipment does not match the actual equipment, and the switch quantity and the dynamic element of the graphic are not correctly associated. It is necessary to modify it on site according to the actual situation.

[0003] The prior art has the following disadvantages:

[0004] The primary main wiring diagram in the existing microcomputer protection device is mostly burned after being configured by a PC in the factory. If the primary equipment is increased or reduced or the firmware is upgraded, the whole machine needs to be returned to the factory or the entire HMI interface needs to be re-flashed. At the same time, the storage / calculation power of the protection machine is limited, and the static bit Figure One If the multi-resolution adaptation or real-time state refresh is performed, picture distortion, refresh flicker, and even screen full of flowers due to power failure and configuration damage may occur.

[0005] In view of the above problems, the present application provides a solution. SUMMARY

[0006] The purpose of the present application is to provide a method for configuring primary main wiring diagram on site based on microcomputer protection.

[0007] The purpose of the present application can be achieved by the following technical solutions:

[0008] A microcomputer-based protection primary main wiring diagram on-site configuration method, comprising: generating a graphic element identifier based on a preset graphic element dictionary, and establishing a two-level mapping relationship in a dual-page mirror mode in a nonvolatile memory of a device, namely, a first mapping page is used for storing the mapping relationship between a grid position and the graphic element identifier, and a second mapping page is used for storing the mapping relationship between the graphic element identifier and a rendering handle;

[0009] read the liquid crystal screen resolution and calculate the horizontal and vertical residual pixel proportions of the screen, determine the corresponding blanking strategy according to the interval range of the corresponding residual pixel proportion, and output the global coordinate conversion parameters of the grid unit based on the determined blanking strategy;

[0010] monitoring the state change of the virtual switch quantity and determining the corresponding affected grid unit, converting it into an initial dirty rectangle list; sorting the initial dirty rectangle list in ascending order of the vertical coordinate of the rectangle and then in ascending order of the horizontal coordinate; starting from the first rectangle of the sorted rectangle list, comparing it with the rectangles after it one by one; when the vertical coordinate difference of adjacent rectangles does not exceed a preset pixel amount and the horizontal coordinate position interval of the two does not exceed one grid unit width, merging them; after the comparison of all rectangles is completed, forming an optimized dirty rectangle list; when the number of optimized dirty rectangles exceeds a preset maximum local update rectangle number threshold or the dirty rectangle coverage pixel proportion exceeds a preset coverage proportion threshold, enabling the full-screen redraw mode, otherwise enabling the local redraw mode; and after maintaining the same redraw mode decision for a plurality of consecutive refresh cycles, executing the extension or restoration of the refresh interval.

[0011] As a further scheme of the application: the structure of the graphic element identifier comprises: a firmware main version number, a graphic element category code and a serial number.

[0012] As a further scheme of the application: the two-level mapping relationship established in the dual-page mirror mode specifically adopts atomic write transactions: the first mapping page structure contains the number of grid rows M, the number of columns N and MxN graphic element identifiers; the second mapping page constructs an open address hash table to accelerate query, and when a miss occurs, a rendering handle is generated by analyzing resource data based on the graphic element identifier.

[0013] As a further scheme of the application: the selection of the blanking strategy comprises: based on a preset set of increasing residual pixel proportion thresholds , four residual pixel proportion threshold intervals are divided; wherein, , ;

[0014] interval , interval , interval , interval corresponds to the blanking strategy , , , , the leading strategy is determined according to the transverse residual proportion and the longitudinal residual proportion.

[0015] As a further scheme of the present application, the transverse residual proportion and the longitudinal residual proportion determining logic comprises: based on the resolution of the current device liquid crystal screen, the screen width W and the screen height H are obtained, and the corresponding grid column number N and row number M are used to accurately position each grid unit pixel; the transverse used pixels and the longitudinal used pixels are obtained; further, the screen width W is subtracted by the transverse used pixels to obtain the remaining transverse pixels, and the screen height H is subtracted by the longitudinal used pixels to obtain the remaining longitudinal pixels, and the ratio of the remaining transverse pixels to the screen width W is taken as the transverse residual proportion, and the ratio of the remaining longitudinal pixels to the screen height H is taken as the longitudinal residual proportion.

[0016] As a further scheme of the present application: according to the transverse residual proportion and the longitudinal residual proportion to determine the leading strategy, comprising: respectively according to the transverse residual proportion, the longitudinal residual proportion and the preset residual pixel proportion threshold interval comparison, that is, the transverse white space strategy and the longitudinal white space strategy ;

[0017] If , the leading white space strategy ; otherwise, the leading direction difference value is calculated; and the leading direction difference value is compared with the preset sensitivity threshold δ;

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

[0019] Based on the leading white space strategy S and the corresponding remaining transverse pixels and the remaining longitudinal pixels, the four white space distances are calculated; the calculation method of each white space strategy is as follows:

[0020] When the leading white space strategy S is the white space strategy , the left and right white space distances are equal, and the upper and lower white space distances are equal; specifically, the remaining transverse pixels are equally divided as the left and right white space distances, and the remaining longitudinal pixels are equally divided as the upper and lower white space distances;

[0021] When the leading white space strategy S is the white space strategy , the remaining transverse pixels are multiplied by the preset weight α value as the left white space distance, and the right white space distance is the remaining transverse pixels minus the left white space distance; similarly, the remaining longitudinal pixels are multiplied by the preset weight β value as the upper white space distance and the rest as the lower white space distance;

[0022] When the leading white space strategy S is the white space strategy When the dominant margin strategy S is the margin strategy , it is the supplement of the margin strategy ;

[0023] When the dominant margin strategy S is the margin strategy , the margin strategy symmetrically allocates the remaining horizontal pixels and the remaining vertical pixels to obtain the basic margin; then, according to a preset fine-tuning coefficient γ, the remaining horizontal pixels times the remaining vertical pixels times the remaining horizontal pixels times the remaining vertical pixels are subtracted from the left margin distance and the top margin distance respectively, and the remaining pixels are added to the right margin distance and the bottom margin distance.

[0024] As a further scheme of the present application: the formation logic of the global coordinate conversion parameter is: based on the screen width W and the screen height H, the screen width W is subtracted by the left margin distance, and then subtracted by the right margin distance to obtain the internal available width; similarly, the screen height H is subtracted by the top margin distance, and then subtracted by the bottom margin distance to obtain the internal available height in the vertical direction.

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

[0026] After the grid unit applies the above scaling ratio, the actual occupied pixel width becomes the basic grid width multiplied by the horizontal scaling ratio, and the actual occupied pixel height becomes the basic grid height multiplied by the vertical scaling ratio; and the horizontal and vertical fine-tuning offsets inside the grid unit are calculated, that is, in the horizontal direction, the basic grid width is subtracted by the scaled width, and the obtained difference is evenly divided left and right inside the unit to obtain the internal horizontal offset; in the vertical direction, the basic grid height is subtracted by the scaled height, and the obtained difference is evenly divided up and down inside the unit to obtain the internal vertical offset.

[0027] The left margin distance is added to the internal horizontal offset to obtain the final horizontal coordinate of the grid origin in the screen coordinate system; the top margin distance is added to the internal vertical offset to obtain the final vertical coordinate of the grid origin in the screen coordinate system.

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

[0029] ​​As a further scheme of the present application, the condition for enabling the full-screen redrawing mode is: based on the optimized dirty region list, first performing a union calculation based on the pixel level, then calculating the total dirty rectangle coverage pixel area on the screen, and performing a ratio calculation with the total pixel area of the screen to obtain a dirty region coverage ratio.

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

[0031] If the number of optimized dirty regions exceeds the preset maximum local update rectangle number threshold or the dirty region coverage ratio exceeds the preset dirty region coverage ratio threshold, the full-screen redrawing mode is used in the current period.

[0032] Otherwise, the local redrawing mode is used, and the optimized dirty region list is cached.

[0033] As a further scheme of the present application, the execution of the extension or restoration of the refresh interval is specifically: after a plurality of consecutive refresh periods are the same redrawing mode, the mode degradation or mode restoration is actually started:

[0034] When a plurality of consecutive refresh periods are judged to be full-screen redrawing, the mode degradation redrawing is triggered, i.e., the refresh period is extended to one time of the original.

[0035] When a plurality of consecutive refresh periods are subsequently judged to be local redrawing, the default refresh interval is restored.

[0036] As a further scheme of the present application, it further includes a performance degradation process: after each redrawing is completed, the following performance indicators are collected: the redrawing time in the current period, the total updated pixel area in the current period, and the system memory usage;

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

[0038] If the number of times that the comprehensive load score is greater than 1 in the last K refresh periods is greater than or equal to the preset score threshold, the degradation redrawing mode is triggered, i.e., the refresh interval is extended to Q times of the original and forced full-screen redrawing; in the degradation state, if the number of times that the comprehensive load score is less than or equal to 1 in the last K refresh periods is greater than or equal to the preset score threshold, the normal redrawing mode is restored, and the determination of the redrawing mode is re-performed.

[0039] The present application has the following advantages:

[0040] (1) The present application, by presetting the graphic element dictionary in the device and generating a unified bit graphic element identification for each electrical symbol, and then cooperating with the idle linked list+bitmap to complete dynamic allocation, so that the field personnel can directly add, delete and replace symbols on the protection device without ID conflict; meanwhile, the two-level mapping pages of grid position→graphic element identification and graphic element identification→rendering handle are maintained in NVM by using double-page mirror transaction, and any write operation has the ability of atomic commit and power-off rollback. Therefore, the main wiring diagram reorganization can be completed without power failure and returning to the factory, realizing the minute-level on-site deployment of engineering type change or version upgrade, greatly reducing the maintenance cost and avoiding the shutdown risk caused by program backwash;

[0041] (2) The present application, by introducing the residual pixel-marginal adaptive algorithm, automatically calculates the blank distance, grid scaling coefficient and origin coordinates according to the screen resolution, so that the same firmware can be used for different size LCDs without distortion; during operation, based on the dirty rectangle merging+full screen / local refresh judgment and load score degradation mechanism, only the necessary area is redrawn, and when the load is high, the refresh cycle is automatically lengthened, the full screen redraw is forced, and then the normal mode is returned after the load is restored, effectively alleviating the picture tearing and flickering phenomenon in the alarm storm scene, and significantly improving the interface readability and operation reliability of the protection device. BRIEF DESCRIPTION OF DRAWINGS

[0042] The present application will be further described below in conjunction with the drawings.

[0043] Figure 1 is a flowchart of a one-time main wiring diagram on-site configuration method based on microcomputer protection of the present application;

[0044] Figure 2 is a graphic element selection schematic diagram of a one-time main wiring diagram on-site configuration method based on microcomputer protection of the present application;

[0045] Figure 3 is a graphic element editing schematic diagram of a one-time main wiring diagram on-site configuration method based on microcomputer protection of the present application;

[0046] Figure 4 is a liquid crystal area division schematic diagram of a one-time main wiring diagram on-site configuration method based on microcomputer protection of the present application;

[0047] Figure 5 is a virtual switch quantity association schematic diagram of a one-time main wiring diagram on-site configuration method based on microcomputer protection of the present application;

[0048] Figure 6 is a running schematic diagram of the device of a one-time main wiring diagram on-site configuration method based on microcomputer protection of the present application. DETAILED DESCRIPTION

[0049] With reference to the accompanying drawings on the basis of the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0050] Embodiment one

[0051] Please refer to Figure 1 The present application is a microcomputer-based primary main wiring diagram configuration method, comprising the following steps:

[0052] As Figures 2-3 shown, step one: based on the preset primitive dictionary, the electrical symbol corresponding to the primitive identifier is generated according to the firmware main version, the primitive category and the serial number combination, and an empty linked list and the corresponding bitmap are constructed by the primitive identifier; meanwhile, a two-level mapping relationship, i.e. a first mapping page and a second mapping page, is created and established in an internal non-volatile memory by using a mirror writing transaction, 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 preset primitive dictionary stored in the internal read-only memory of the device, a unified primitive identifier coding method is formulated for each primitive category, and the primitive identifier structure includes three fields: firmware main version number, primitive category code and serial number;

[0054] And a two-level index table is constructed in the internal read-only memory of the device: the first version index table takes the firmware main version number as the key, and indicates the address of the category index area corresponding to each version; the second category index table maintains a continuous index record array for each primitive category, and records the maximum serial number value of the category;

[0055] The firmware main version number is used to ensure the compatibility of multiple versions of primitives, such as V1.0 representing 0100 and V2.1 representing 0201; the primitive category code is used to distinguish different types of electrical elements, such as 0001 representing a circuit breaker, 0010 representing a knife switch, and 0011 representing a grounding knife; and the serial number is gradually increased within each category to uniquely identify a specific primitive;

[0056] This embodiment generates the primitive identifier in 64-bit integer format, the high 16 bits of which are the firmware main version number, the middle 8 bits are the primitive category, the lower 16 bits are the primitive serial number, the next 8 bits are the CRC8 check code calculated based on the above 48 bits of data, and the lowest 16 bits are reserved as zero;

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

[0058] It should be noted that the preset primitive dictionary lists the basic information of each electrical symbol primitive in a table form; the table contains three columns: the first column ID is the sequential identification of the primitive, which corresponds to the 64-bit primitive identification generated by the firmware major version number, the primitive category, and the serial number in the actual firmware; the second column name is the function or semantic description of each primitive; the third column primitive is the corresponding bitmap or vector diagram preview; in the prior art, the above-mentioned primitive dictionary is usually pre-made by professional electrical drawing or human-computer interface engineers according to industry standards and project requirements, and all resource files such as PNG bitmap, SVG vector data, and their storage offset and length metadata in Flash are also sorted and archived. After the dictionary is checked by version management CRC, it is packaged into the firmware and read-only stored in the on-chip Flash or external non-volatile memory; when the device starts, the preset primitive dictionary is loaded into the internal read-only memory of the device, and a firmware version index table and a category index table are constructed, which are used for automatically selecting and generating the corresponding primitive identification according to the firmware major version number in the subsequent steps; therefore, the preset primitive dictionary in the embodiment is an electrical symbol resource and its management method that has been designed and perfected in the prior art, which is stable and reliable, and provides basic data support for further dynamic allocation and rendering mechanism, and will not be described in detail in this embodiment;

[0059] When the device receives a primitive allocation request during operation, a to-be-allocated primitive identification is taken out from the head of the free list in the internal read-only memory of the device, and the corresponding bit position value in the bitmap is set from 0 to 1, indicating that the primitive has been occupied; if the free list is empty, the free list is reconstructed after dictionary rescan is triggered;

[0060] The initialization process of the free list is: traversing all legal primitive category and serial number combinations in the dictionary, calling the above-mentioned primitive identification generation logic to generate the identification; for each generated primitive identification, if the corresponding bit in the bitmap is 0, it is encapsulated as a list node and inserted into the tail of the free list in turn; after the traversal is completed, the initial free list and the initial bitmap are formed;

[0061] To reduce the frequent allocation / release overhead, the embodiment additionally maintains a first-level release cache L1 release cache with a capacity of 64 entries in the device internal read-only memory. When released, the released primitive identifier is first written into the first-level release cache L1. When the first-level release cache L1 is full or the system is idle, all nodes in the first-level release cache L1 are returned to the idle linked list in batches, and the corresponding bit in the initial bitmap is cleared synchronously;

[0062] The embodiment creates and maintains two mapping pages in the internal non-volatile memory (NVM) using a double-page mirror writing transaction mechanism: the first mapping page is used to store the mapping relationship of the grid position→primitive identifier, and the second mapping page is used to store the mapping relationship of the primitive identifier→render handle;

[0063] Specifically, the first mapping page page body structure is: 16-bit grid row number M, 16-bit grid column number N, and then M×N 64-bit primitive identifiers are stored in row priority order; the unallocated unit corresponds to a value of 0; the page body can optionally add a row-level CRC of 2 bytes per row to accelerate verification;

[0064] The loading logic of the first mapping page is: after system startup or transaction submission, the page header of page A and page B is first read, the transaction sequence number and the effective flag are compared, the mapping page with the larger transaction sequence number and the effective flag set to valid is selected, and the entire page body is loaded to the device internal read-only memory buffer;

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

[0066] The second mapping page page body structure is: 32-bit unsigned integer, and then the records of unsigned integers are stored in order, each record containing a 64-bit primitive identifier, a 32-bit render handle, a 16-bit attribute flag, and a 16-bit LRU timestamp;

[0067] To accelerate the query, the system constructs an open address hash table for the second mapping page in the device internal read-only memory,

[0068] and performs detection in the open address hash table: if the primitive identifier of the corresponding unsigned integer record is found to be completely matched with the input primitive identifier, the render handle is returned; if the detection reaches an empty slot or a deleted slot and still does not hit, the resource loading process is executed, and after a new record is appended in the backup page, the transaction is submitted;

[0069] The resource loading procedure includes: resolving firmware main version number, figure element category and serial number from figure element identification, obtaining resource offset and length through preset figure element dictionary two-level index; if the resource is a vector combination, calling a geometry engine to generate a texture; if it is a bitmap, directly decoding; calling a GPU interface to create a rendering handle, and appending the handle to backup page records together with figure element identification, attribute mark and LRU initialization value; mirror writing transaction of the second mapping page is the same as 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 LRU eliminated, setting figure element identification to 0 and updating the unsigned integer record, and then submitting the transaction.

[0070] As shown in Figure 4 Step 2: read the resolution of the device liquid crystal screen and calculate the horizontal and vertical excess pixels of the screen, dynamically select the corresponding blank strategy according to the remaining pixels of the screen, and calculate the corresponding blank distance and grid scaling factor based on the selected blank strategy, and generate global coordinate conversion parameters;

[0071] Read the resolution of the current device liquid crystal screen to get the screen width W and height H; if any of W, H is less than the preset minimum value , , record an error and fall back to the default resolution , ; and based on the defined number of grid rows M and columns N, both of which are consistent with the mapping page structure; at the same time, set the remaining pixel ratio and the blank strategy mapping table in the configuration file, including: based on a set of preset increasing residual pixel ratio thresholds , divide the four residual pixel ratio threshold intervals; wherein , ;

[0072] Interval , interval , interval , interval ; and the above interval , interval , interval , interval ; correspond to blank strategies , , , ;

[0073] Calculate the base grid width , the base grid height , which is used to accurately position the pixels occupied by each grid unit; thus the horizontal used pixels , the vertical used pixels ;

[0074] Further calculate the remaining horizontal pixels , the remaining vertical pixels , and the ratio of the remaining horizontal pixels to the screen width W as the horizontal residual proportion , and the ratio of the remaining vertical pixels to the screen height H as the vertical residual proportion ;

[0075] According to the horizontal residual proportion , the vertical residual proportion , and the preset residual pixel proportion threshold interval, the horizontal blanking strategy and the vertical blanking strategy are obtained, and the horizontal blanking strategy and the vertical blanking strategy are determined according to the following formula:

[0076] ;

[0077] According to the above formula, if , the dominant blanking strategy ; otherwise, the dominant direction difference value is calculated, and the dominant direction difference value is compared with the preset sensitivity threshold value δ.

[0078] When the dominant direction difference value is greater than the preset sensitivity threshold value δ, the corresponding blanking strategy is taken as the dominant blanking strategy S, otherwise, the blanking strategy with the smaller number is taken as the dominant blanking strategy S.

[0079] Based on the dominant blanking strategy S and the corresponding remaining horizontal pixels and the remaining vertical pixels , the four-side blanking distances are calculated, and the calculation methods of the strategies are as follows:

[0080] When the dominant blanking strategy S is the blanking strategy , the left and right blanking distances are equal, and the upper and lower blanking distances are equal; specifically, the remaining horizontal pixels are equally divided as the left and right blanking distances, and the remaining vertical pixels are equally divided as the upper and lower blanking distances.

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

[0082] When the dominant blanking strategy S is the blanking strategy , the blanking is mainly concentrated on the right side or the lower side. Details are not described here; it can be considered as a supplementary distribution of the blanking strategy ;

[0083] When the dominant blanking strategy S is the blanking strategy , the blanking is mainly concentrated on the right side or the lower side. Details are not described here; it can be considered as a supplementary distribution of the blanking strategy ; The remaining horizontal pixels and the remaining vertical pixels are symmetrically distributed to the base margin; then, according to the preset fine-tuning coefficient γ, the remaining pixels are added to the right blanking distance and the lower blanking distance from the left blanking distance and the upper blanking distance, respectively. 、

[0084] After the known screen width W and height H, and the left blanking distance and the right blanking distance, the width that can be actually used for drawing the grid in the horizontal direction is calculated first; that is, the total width of the screen is subtracted by the left blanking distance, and then subtracted by the right blanking distance, to obtain the internal available width; similarly, in the vertical direction, the screen height is subtracted by the upper blanking distance, and then subtracted by the lower blanking distance, to obtain the internal available height.

[0085] Based on the base grid width , the base grid height , and the grid row number M and column number N; 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 ; wherein x and y correspond to the horizontal and vertical directions of the screen coordinates, respectively.

[0086] After the grid unit applies the corresponding scaling ratio, the actual pixel width occupied by the grid unit will become the base width multiplied by the scaling coefficient, and the height will also change accordingly. In order to center each unit in its original base grid, the horizontal remaining pixel space is calculated: the base width is subtracted by the scaled width, and the remaining space is evenly divided in the unit.

[0087] Similarly, the vertical remaining space is calculated: the base height is subtracted by the scaled height, and the remaining space is evenly divided in the unit. In this way, the internal horizontal and internal vertical offset of each unit are obtained ​​​The grid origin on the screen should be located after the white space area, plus the fine adjustment offset inside the unit; therefore, the final horizontal X position of the grid in the screen coordinate system is obtained by adding the left white space distance to the horizontal offset inside the unit; similarly, the final vertical Y position of the grid in the screen coordinate system is obtained by adding the upper white space distance to the vertical offset inside the unit; and the final horizontal X coordinate and the final vertical Y coordinate are marked as the absolute position of the grid origin in the screen.

[0088] The final encapsulation output grid unit global coordinate conversion parameter structure includes: screen width, screen height, grid row number M, grid column number N, basic grid width, basic grid height, left white space distance, right white space distance, upper white space distance, lower white space distance, horizontal scaling ratio, vertical scaling ratio, grid origin horizontal coordinate and grid origin vertical coordinate.

[0089] As shown in Figures 5-6 Step three: monitoring the virtual switch quantity state change of the device running state, positioning the affected grid unit and generating an initial dirty rectangle list; merging the dirty rectangle list according to the row priority principle, if the number of dirty rectangles after merging exceeds the preset threshold, setting the redraw mode to full-screen redraw, otherwise setting to local redraw and saving the optimized dirty rectangle set;

[0090] In the preset screen refresh cycle, read the current state of all virtual switches, compare with the state of the last cycle, and identify the state flip event; each event is mapped to a number of grid unit regions in advance;

[0091] It should be noted that the virtual switch is used to drive the display and update of each graphic element identifier in the interface, which is a Boolean quantity, and only has two 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 state; when it is 0, the icon of the open state is displayed; it is one-to-one associated with the graphic element identifier;

[0092] For each state change event, the initial dirty region list is obtained by calculating the corresponding screen pixel rectangular area using the grid start coordinates, grid cell width and height, and the blank distance determined in the global coordinate conversion parameter structure, specifically: the grid row and column numbers corresponding to the state change event are converted into pixel positions to obtain the corresponding horizontal and vertical 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 rectangle is added to the initial dirty region list; and the initial dirty region list is sorted in ascending order of the vertical coordinates of the rectangles and then in ascending order of the horizontal coordinates; the adjacent two rectangles in the initial dirty region list are compared in turn, if the difference between the vertical coordinates of the two rectangles is not more than 2 pixels and the interval between the horizontal coordinate positions of the two is not more than one grid cell width, the minimum left boundary and the maximum right boundary of the two are taken as a new rectangle; otherwise, the current rectangle is added as a new item to obtain the optimized dirty region list.

[0093] The optimized dirty region list is calculated based on a preset period, a union calculation is first performed based on the pixel level, then the total coverage pixel area of the dirty rectangle on the screen is calculated, and a ratio calculation is performed with the total pixel area of the screen to obtain the dirty region coverage ratio.

[0094] The number of dirty rectangles in the optimized dirty region list and the dirty region coverage ratio 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 optimized dirty regions exceeds the preset maximum local update rectangle number threshold or the dirty region coverage ratio exceeds the preset dirty region coverage ratio threshold, the full-screen redraw mode is adopted in the current period.

[0096] Otherwise, the local redraw mode is adopted, and the optimized dirty region list is cached for the current refresh to redraw only these regions. To avoid frequent mode switching, the mode degradation or mode recovery is actually started only after the same redraw mode is adopted for a plurality of consecutive refresh periods, such as three refresh periods:

[0097] When the full-screen redraw is judged for three consecutive refresh periods, the mode degradation redraw is triggered, that is, the refresh period is extended to one time of the original;

[0098] When the local redraw is judged for three consecutive refresh periods subsequently, the default refresh interval is restored;

[0099] After the redraw is completed based on the corresponding redraw mode, the dirty region list is emptied for the next period;

[0100] The local redraw is to submit the optimized dirty region to the rendering engine and call the region redraw interface one by one to update only these regions; the full-screen redraw is to ignore all dirty regions and directly call the full-screen refresh interface.

[0101] After each dirty region is redrawn based on its corresponding redraw mode, the dirty rectangle mark is cleared and the next redraw cycle is prepared; and based on the current cycle redraw time consumption, the total area of updated pixels in the current cycle and the system memory usage at the end of each screen redraw cycle, it is determined whether the threshold is exceeded; if the threshold is exceeded continuously, the degraded redraw strategy is switched and the refresh interval is relaxed; and when the indicators return to normal, the regular redraw mode is gradually returned, specifically:

[0102] After each redraw, the following performance indicators are collected: current cycle redraw time consumption, total area of updated pixels in the current cycle and system memory usage;

[0103] The above performance indicators are weighted to obtain a comprehensive load score, and the comprehensive load score is compared with a preset score threshold; if the number of times that the comprehensive load score is greater than 1 in the last K refresh cycles is greater than or equal to the preset score threshold, the degraded redraw mode is triggered, i.e., the refresh cycle is extended to Q times of the original and forced full-screen redraw; in the degraded state, if the number of times that 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 regular redraw mode is restored, and the local redraw mode or the full-screen redraw mode is determined again according to step three.

[0104] In the embodiment, the preset primitive dictionary is used to generate a primitive identifier containing a version number-category-number-CRC, and a two-level mapping of grid position-primitive identifier and primitive identifier-rendering handle is maintained in the non-volatile memory through a double-page mirror transaction; the screen resolution is read, the margin and grid scaling are adaptively calculated according to the residual pixel threshold, and the global coordinates are output; the virtual switch change is monitored during runtime, the local or full-screen refresh is dynamically selected according to the dirty rectangle merging algorithm, and the degraded strategy is triggered in combination with the comprehensive load score. The method realizes the on-site safe, fast and low-resource rearrangement and real-time refresh of the main wiring diagram of the protection device, solves the problems of factory upgrade, resolution adaptation and refresh lag, and has the advantages of power failure safety, high resolution compatibility, strong real-time performance and the like.

[0105] The above formulas are dimensionless numerical calculations, the formulas are obtained by software simulation of a large amount of data to obtain the latest real situation, and the preset parameters in the formulas are set by a person skilled in the art according to the actual situation.

[0106] The above embodiments can be realized wholly or partially by software, hardware, firmware or any other combination. When realized by software, the above embodiments can be realized wholly or partially in the form of a computer program product.

[0107] Those skilled in the art can understand that the modules and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software manner depends on the specific application of the technical solution and the constraints of the invention. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0108] In addition, each functional module in each embodiment of the present application can be integrated in one processing module, or each module can exist physically alone, or two or more modules can be integrated in one module.

[0109] The above is merely specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0110] Finally: the above is only the preferred embodiment of the present application, and is not used to limit the present application, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for configuring a primary wiring diagram on site based on microcomputer protection, characterized in that, The method comprises the following steps: Based on the preset primitive dictionary, a primitive identifier is generated, and a two-level mapping relationship is established in the non-volatile memory of the device in a double-page mirror image manner, that is, a first mapping page is used to store the mapping relationship between the grid position and the primitive identifier, and a second mapping page is used to store the mapping relationship between the primitive identifier and the rendering handle; The resolution of the liquid crystal screen is read, and the horizontal residual pixel ratio and the vertical residual pixel ratio are calculated, the corresponding blanking strategy is determined according to the interval range of the corresponding residual pixel ratio, and the global coordinate conversion parameter of the grid unit is output based on the determined blanking strategy; The selection of the blanking strategy comprises: dividing four residual pixel proportion threshold intervals based on a preset increasing residual pixel proportion threshold , wherein , ; interval , interval , interval , interval corresponding to the blanking strategy , , , , according to the horizontal residual ratio and the vertical residual ratio to determine the dominant strategy; The virtual switch state change is monitored, and the corresponding affected grid unit is determined, which is converted into an initial dirty rectangle list; the initial dirty rectangle list is sorted in ascending order of the vertical coordinate of the rectangle and then in ascending order of the horizontal coordinate; starting from the first rectangle of the sorted rectangle list, the rectangles are compared one by one; when the vertical coordinate difference of adjacent rectangles does not exceed the preset pixel amount and the horizontal coordinate position interval of the two does not exceed the width of a grid unit, they are merged; after the comparison of all rectangles is completed, an optimized dirty rectangle list is formed; when the number of optimized dirty rectangles exceeds the preset maximum local update rectangle threshold or the dirty rectangle coverage pixel ratio exceeds the preset coverage ratio threshold, the full-screen redraw mode is enabled, otherwise the local redraw mode is enabled; and after the same redraw mode decision is maintained for a plurality of refresh cycles, the refresh interval is extended or restored.

2. The method as claimed in claim 1, wherein the primary wiring diagram configuration method is based on microcomputer protection. The structure of the primitive identifier comprises: a firmware major version number, a primitive category code, and a serial number.

3. The method as claimed in claim 1, wherein the primary wiring diagram configuration method based on microcomputer protection is characterized in that, The two-level mapping relationship is established in a double-page mirror image manner, specifically by using an atomic write transaction: the first mapping page structure contains the number of grid rows M, the number of grid columns N, and M*N primitive identifiers; The second mapping page constructs an open address hash table to accelerate query, and when a miss occurs, a rendering handle is generated by analyzing resource data based on the primitive identifier.

4. The method as claimed in claim 1, wherein the method is characterized in that, The horizontal residual ratio and the vertical residual ratio determination logic comprises: based on the resolution of the current device liquid crystal screen, the screen width W and the screen height H are obtained, and the grid column number N and the grid row number M are used to accurately position each grid unit; from which the horizontal used pixels and the vertical used pixels are obtained; further, the remaining horizontal pixels are obtained by subtracting the horizontal used pixels from the screen width W, and the remaining vertical pixels are obtained by subtracting the vertical used pixels from the screen height H; the ratio of the remaining horizontal pixels to the screen width W is taken as the horizontal residual ratio, and the ratio of the remaining vertical pixels to the screen height H is taken as the vertical residual ratio.

5. The method as claimed in claim 1, wherein the method is based on a microcomputer protection primary wiring diagram configuration method, characterized in that, The dominant strategy is determined according to the transverse residual proportion and the longitudinal residual proportion, and includes: comparing the transverse residual proportion, the longitudinal residual proportion and a preset residual pixel proportion threshold interval respectively, so as to obtain a transverse blanking strategy and a longitudinal blanking strategy ​ 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 δ; When the dominant direction difference If the difference is greater than a preset sensitivity threshold δ, the corresponding white space strategy is taken as the dominant white space strategy S, otherwise the smaller one of the two white space strategies is taken as the dominant white space strategy S. Based on the dominant blanking strategy S and its corresponding remaining horizontal pixels and remaining vertical pixels, the four blanking distances are calculated; the calculation method of each blanking strategy is as follows: When the dominant blanking strategy S is the blanking strategy , the left and right blanking distances are equal, and the upper and lower blanking distances are equal; specifically, the remaining horizontal pixels are equally divided as the left and right blanking distances, and the remaining vertical pixels are equally divided as the upper and lower blanking distances. When the dominant blanking strategy S is the blanking strategy When the dominant blanking strategy S is the blanking strategy When the dominant blanking strategy S is the blanking strategy When the dominant blanking strategy S is a blanking strategy corresponding to the blanking strategy a complementary allocation to the blanking strategy ​ 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.

6. The method of claim 1, wherein the one-line diagram configuration method is based on microcomputer protection. The formation logic of the global coordinate conversion parameter is: based on the screen width W and the screen height H, the internal available width is obtained by subtracting the left blanking distance from the screen width W and then subtracting the right blanking distance; similarly, the internal available height in the vertical direction is obtained by subtracting the upper blanking distance from the screen height H and then subtracting the lower blanking distance. And based on the number of grid rows M, the number of grid columns N, and the base grid width and the base grid height when not scaled, the internal available width is divided by the base grid width to obtain the horizontal scaling ratio, and the internal available height is divided by the base grid height to obtain the vertical scaling ratio; After the grid unit applies the scaling ratio, the actual pixel width occupied by the grid unit becomes the base grid width multiplied by the horizontal scaling ratio, and the actual pixel height occupied by the grid unit becomes the base grid height multiplied by the vertical scaling ratio; and the horizontal and vertical fine adjustment offsets inside the grid unit are calculated, that is, in the horizontal direction, the base grid width is subtracted from the scaled width, and the resulting difference is evenly divided left and right inside the unit to obtain the internal horizontal offset; in the vertical direction, the base grid height is subtracted from the scaled height, and the resulting difference is evenly divided up and down inside the unit to obtain the internal vertical offset; The final horizontal coordinate of the grid origin in the screen coordinate system is obtained by adding the internal horizontal offset to the left margin distance; and the final vertical coordinate of the grid origin in the screen coordinate system is obtained by adding the internal vertical offset to the top margin distance; The screen width, screen height, number of grid rows M, number of grid columns N, base grid width, base grid height, left margin distance, right margin distance, top margin distance, bottom margin distance, horizontal scaling ratio, vertical scaling ratio, grid origin horizontal coordinate, and grid origin vertical coordinate parameters are uniformly packaged to form the grid unit global coordinate conversion parameters.

7. The method of claim 1, wherein the one-line diagram configuration method is based on microcomputer protection. The condition for enabling the full-screen redrawing mode is that based on the optimized dirty region list, a union calculation is first performed based on the pixel level, then the total coverage pixel area of the dirty rectangle on the screen is calculated, and a ratio calculation is performed with the total pixel area of the screen to obtain the dirty region coverage ratio; The number of dirty rectangles in the optimized dirty region list and the dirty region coverage ratio are compared with the preset maximum local update rectangle number threshold and the preset dirty region coverage ratio threshold, respectively; If the number of optimized dirty regions exceeds the preset maximum local update rectangle number threshold or the dirty region coverage ratio exceeds the preset dirty region coverage ratio threshold, the full-screen redrawing mode is used in this period; Otherwise, the local redrawing mode is used, and the optimized dirty region list is cached.

8. The method of claim 1, wherein the one-line diagram configuration method is based on microcomputer protection. The execution of the extension or restoration of the refresh interval is specifically: after a plurality of consecutive refresh periods are the same redrawing mode, the mode degradation or mode restoration is actually started: When a plurality of consecutive refresh periods are judged as full-screen redrawing, mode degradation redrawing is triggered, that is, the refresh period is extended to one time of the original; When the subsequent consecutive plurality of consecutive refresh periods are judged as local redrawing, the default refresh interval is restored.

9. The method of claim 8, wherein the method further comprises: generating a main wiring diagram of the power system; and displaying the main wiring diagram on the display unit. It also includes a performance degradation process: after each redrawing is completed, the following performance indicators are collected: the redrawing time in this period, the total pixel area updated in this period, and the system memory usage; And the above performance indicators are weighted to obtain a comprehensive load score, and the comprehensive load score is compared with the preset score threshold; If the number of times that the comprehensive load score is greater than 1 in the last K refresh cycles is greater than or equal to a preset score threshold, a degraded redraw mode is triggered, that is, the refresh interval is extended to Q times the original refresh interval and a full-screen redraw is forced; in the degraded state, if the number of times that 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 determination of the redraw mode is re-performed.

Citation Information

Patent Citations

  • Image generation method and device and storage medium

    CN111415396A

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

    CN114996618A