Power grid thematic map generation method and device, equipment and storage medium
By calculating the point marking and line marking positions of power grid equipment, the problem of unreasonable grid special icons in the prior art has been solved, and the readability and layout quality of the drawings are improved.
Patent Information
- Application Number
- CN202410146315.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-01
- Publication Date
- 2025-02-14
AI Technical Summary
The existing grid special map-forming algorithm has unreasonable labeling when layout, resulting in poor readability of the drawings and unable to meet the needs of users.
By obtaining the location information and marking data of the device, determining the connection lines between the devices, calculating the point marking and line marking positions of the device, adding marking data according to the marking type, and generating a special grid map.
Reasonable calculation of the labeling position is realized, overlap and intersection of the labeling information is avoided, the layout quality of the grid special map is improved, and problems such as overlap of graphics, unreasonable layout, and overlapping of connection lines are solved.
Smart Images

Figure CN119442373A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power grid technology, and in particular to a method, device, equipment and storage medium for generating a thematic map of a power grid. Background Art
[0002] Due to the wide distribution of power grid equipment and its strong dependence on geographical location, it has become a consensus and commonly adopted management solution in my country's power grid industry to draw power grid thematic maps for power grid topology and realize graphical and visual management.
[0003] At present, the automatic generation of power grid thematic maps mainly involves extracting the data required for various styles of power grid thematic maps through the PMS2.0 system and the business center; then, the extracted data is processed through the mapping algorithm module to generate power grid thematic maps of different styles.
[0004] However, the current mapping algorithm has unreasonable labeling when laying out thematic maps, which results in poor readability of the drawings and cannot meet user needs. Summary of the invention
[0005] The purpose of this application is to provide a method, device, equipment and storage medium for generating a power grid thematic map in order to solve the technical problems existing in the prior art.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for generating a power grid thematic map, the method comprising:
[0008] Obtain the location information and marking data of each device in the area to be marked;
[0009] Determining a connection line between at least one associated device connected to each of the devices;
[0010] Determine the point marking position of each device according to the position information of each device and the connection line between at least one associated device connected to each device, and determine the line marking position of each device according to the connection line between at least one associated device connected to each device;
[0011] According to the marking type of the marking data of each device, the marking data of each device is added to the point marking position or line marking position of each device to generate a power grid thematic map.
[0012] Optionally, determining the point marking position of each device according to the position information of each device and a connection line between at least one associated device connected to each device includes:
[0013] Determine the priority of each optional angle according to the location information of the device and the connection line between at least one associated device connected to the device, wherein the optional angle is an eight-azimuth angle between the device and the associated device;
[0014] Determining the marking angle of the device according to the priority of each optional angle;
[0015] The point marking position of the device is determined according to the position information of the device, the marking angle and a preset marking radius.
[0016] Optionally, the priority of the optional angle includes: an overlapping area between the point marking box of the optional angle and each of the associated devices, and a line segment length of a connection line between each of the associated devices passing through the point marking box of the optional angle;
[0017] Determining the marking angle of the device according to the priority of each optional angle includes:
[0018] If there is no overlapping area between the point marking box of the optional angle and each of the associated devices, and the length of the line segment of the connecting line between each of the associated devices passing through the point marking box of the optional angle is zero, the optional angle is compared with multiple preset first preferred angles in turn, and the marking angle of the device is determined based on the first comparison result.
[0019] Optionally, determining the marking angle of the device according to the priority of each optional angle includes:
[0020] If there is no overlapping area between the point marking box of the optional angle and each of the associated devices, and the length of the line segment of the connecting line between each of the associated devices passing through the point marking box of the optional angle is the shortest, the optional angle is compared with multiple preset second priority angles in turn, and the marking angle of the device is determined based on the second comparison result.
[0021] Optionally, determining the line marking position of the device according to the connection line between at least one associated device connected to each of the devices includes:
[0022] Determine a maximum length of a guaranteed line segment in a connection line between at least one associated device connected to the device;
[0023] Determine at least one markable line segment according to the bottom line segment and the connection lines between the bottom line segment and the associated devices, where the markable line segment is any marked position on the bottom line segment;
[0024] The line marking position of the device is determined according to the priority of each markable line segment.
[0025] Optionally, the priority of the labelable line segment includes: an overlapping area between the line labeling frame of the labelable line segment and each of the associated devices, and a line segment length of a connection line between each of the associated devices passing through the line labeling frame of the labelable line segment;
[0026] The step of determining the line marking position of the device according to the priority of each markable line segment includes:
[0027] If there is no overlapping area between the line marking frame of the line segment that can be marked and each of the associated devices, and the length of the line segment of the connection line between each of the associated devices passing through the line marking frame of the line segment that can be marked is zero, the center point of the line segment with the guaranteed bottom line is used as the line marking position of the device;
[0028] If there is no overlapping area between the line marking frame of the labelable line segment and each of the associated devices, and the length of the line segment of the connection line between each of the associated devices passing through the line marking frame of the labelable line segment is the shortest, then the line marking position of the device is determined according to the distance between the center point of the labelable line segment and the center point of the bottom line segment;
[0029] If the overlapping area between the line marking box of the labelable line segment and each of the associated devices is the smallest, and the length of the line segment of the connecting line between each of the associated devices passing through the line marking box of the labelable line segment is the shortest, then the line marking position of the device is determined according to the distance between the center point of the labelable line segment and the center point of the bottom line segment.
[0030] Optionally, adding the marking data of each device to a point marking position or a line marking position of each device according to the marking type of the marking data of each device includes:
[0031] If the marking type of the marking data of the device is point device marking, adding the marking data to the point marking position of the device;
[0032] If the marking type of the marking data of the device is a line device marking, the marking data is added to the line marking position of the device.
[0033] In a second aspect, an embodiment of the present application further provides a power grid thematic map generating device, the device comprising:
[0034] An acquisition module is used to obtain the location information and marking data of each device in the area to be marked;
[0035] a determination module, configured to determine a connection line between at least one associated device connected to each of the devices; determine a point marking position of each of the devices according to the position information of each of the devices and a connection line between at least one associated device connected to each of the devices, and determine a line marking position of each of the devices according to a connection line between at least one associated device connected to each of the devices;
[0036] The generating module is used to add the marking data of each device to the point marking position or line marking position of each device according to the marking type of the marking data of each device, so as to generate a power grid thematic map.
[0037] Optionally, the determining module is further used to:
[0038] Determine the priority of each optional angle according to the location information of the device and the connection line between at least one associated device connected to the device, wherein the optional angle is an eight-azimuth angle between the device and the associated device;
[0039] Determining the marking angle of the device according to the priority of each optional angle;
[0040] The point marking position of the device is determined according to the position information of the device, the marking angle and a preset marking radius.
[0041] Optionally, the priority of the optional angle includes: an overlapping area between the point marking box of the optional angle and each of the associated devices, and a line segment length of a connection line between each of the associated devices passing through the point marking box of the optional angle;
[0042] The determining module is further used for:
[0043] If there is no overlapping area between the point marking box of the optional angle and each of the associated devices, and the length of the line segment of the connecting line between each of the associated devices passing through the point marking box of the optional angle is zero, the optional angle is compared with multiple preset first preferred angles in turn, and the marking angle of the device is determined based on the first comparison result.
[0044] Optionally, the determining module is further used to:
[0045] If there is no overlapping area between the point marking box of the optional angle and each of the associated devices, and the length of the line segment of the connecting line between each of the associated devices passing through the point marking box of the optional angle is the shortest, the optional angle is compared with multiple preset second priority angles in turn, and the marking angle of the device is determined based on the second comparison result.
[0046] Optionally, the determining module is further used to:
[0047] Determine a maximum length of a guaranteed line segment in a connection line between at least one associated device connected to the device;
[0048] Determine at least one markable line segment according to the bottom line segment and the connection lines between the bottom line segment and the associated devices, where the markable line segment is any marked position on the bottom line segment;
[0049] The line marking position of the device is determined according to the priority of each markable line segment.
[0050] Optionally, the priority of the labelable line segment includes: an overlapping area between the line labeling frame of the labelable line segment and each of the associated devices, and a line segment length of a connection line between each of the associated devices passing through the line labeling frame of the labelable line segment;
[0051] The determining module is further used for:
[0052] If there is no overlapping area between the line marking frame of the line segment that can be marked and each of the associated devices, and the length of the line segment of the connection line between each of the associated devices passing through the line marking frame of the line segment that can be marked is zero, the center point of the line segment with the guaranteed bottom line is used as the line marking position of the device;
[0053] If there is no overlapping area between the line marking frame of the labelable line segment and each of the associated devices, and the length of the line segment of the connection line between each of the associated devices passing through the line marking frame of the labelable line segment is the shortest, then the line marking position of the device is determined according to the distance between the center point of the labelable line segment and the center point of the bottom line segment;
[0054] If the overlapping area between the line marking box of the labelable line segment and each of the associated devices is the smallest, and the length of the line segment of the connecting line between each of the associated devices passing through the line marking box of the labelable line segment is the shortest, then the line marking position of the device is determined according to the distance between the center point of the labelable line segment and the center point of the bottom line segment.
[0055] Optionally, the generating module is used to:
[0056] If the marking type of the marking data of the device is point device marking, adding the marking data to the point marking position of the device;
[0057] If the marking type of the marking data of the device is a line device marking, the marking data is added to the line marking position of the device.
[0058] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the method provided in the first aspect.
[0059] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, and the computer program is executed by a processor to perform the steps of the method provided in the first aspect.
[0060] The beneficial effects of this application are:
[0061] The embodiment of the present application provides a method, device, equipment and storage medium for generating a power grid thematic map. The scheme proposes a method for calculating the annotation position in the process of thematic map layout to meet the user's requirements for non-overlapping annotations and non-pressure of equipment, that is, an optimal point annotation position can be determined based on the location information of each device and the connection line between at least one associated device connected to each device; then, an optimal line annotation position is determined based on the connection line between at least one associated device connected to each device. In this way, when annotating based on the point annotation position and line annotation position finally determined and calculated, overlap and partial intersection between annotation information can be avoided, thereby making the layout of the power grid thematic map optimal, and solving the problems of graphic overlap, unreasonable layout, and overlapping connection lines when generating power grid thematic maps using the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0063] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0064] Figure 2 Schematic diagram of the process of generating a power grid thematic map provided in the embodiment of the present application Figure 1 ;
[0065] Figure 3 Schematic diagram of the process of generating a power grid thematic map provided in the embodiment of the present application Figure 2 ;
[0066] Figure 4A schematic diagram of the overlapping area between the point annotation box of the device and each associated device in the power grid thematic map generation method provided in an embodiment of the present application;
[0067] Figure 5 Schematic diagram of the connection lines of each associated device passing through the marked box in the power grid thematic map generation method provided in the embodiment of the present application Figure 1 ;
[0068] Figure 6 Schematic diagram of the connection lines of each associated device passing through the marked box in the power grid thematic map generation method provided in the embodiment of the present application Figure 2 ;
[0069] Figure 7 Schematic diagram of the connection lines of each associated device passing through the marked box in the power grid thematic map generation method provided in the embodiment of the present application Figure 3 ;
[0070] Figure 8 Schematic diagram of the process of generating a power grid thematic map provided in the embodiment of the present application Figure 3 ;
[0071] Fig. 9 A schematic diagram of connection lines between devices in the method for generating a thematic power grid map provided in an embodiment of the present application;
[0072] Fig.10 Schematic diagram of the process of generating a power grid thematic map provided in the embodiment of the present application Figure 4 ;
[0073] Fig.11 Schematic diagram of the process of generating a power grid thematic map provided in the embodiment of the present application Figure 5 ;
[0074] Fig.12 Adding a marked schematic diagram to the method for generating a thematic power grid map provided in an embodiment of the present application;
[0075] Fig.13 A schematic diagram of the structure of a power grid thematic map generating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0076] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0077] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0078] In order to enable those skilled in the art to use the contents of this application, the following implementation method is provided in conjunction with the specific application scenario "point labeling and line labeling in power grid thematic maps". For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around how to determine the point labeling positions and line labeling positions in power grid thematic maps, it should be understood that this is only an exemplary embodiment. This application can be applied to any other scenario.
[0079] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0080] Figure 1 The following is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application; the electronic device may be a processing device such as a computer or a server, and is used to implement the method for generating a thematic power grid map provided in the present application. Figure 1 As shown, the electronic device includes: a processor 101 and a memory 102.
[0081] The processor 101 and the memory 102 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, the electrical connection can be achieved through one or more communication buses or signal lines.
[0082] The processor 101 may be an integrated circuit chip having the ability to process signals. The processor 101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. The methods, steps, and logic block diagrams disclosed in the embodiments of the present invention may be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor.
[0083] The memory 102 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0084] Understandably, Figure 1 The structure is only for illustration, and the electronic device may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0085] The memory 102 is used to store programs, and the processor 101 calls the programs stored in the memory 102 to execute the power grid thematic map generation method provided in the following embodiment.
[0086] The following will illustrate the power grid thematic map generation method provided by the present application and the corresponding beneficial effects through multiple embodiments.
[0087] Figure 2 A flowchart of a method for generating a thematic map of a power grid provided in an embodiment of the present application is provided. Optionally, the execution subject of the method may be an electronic device such as a server or a computer having a data processing function.
[0088] It should be understood that in other embodiments, the order of some steps in the method for generating the power grid thematic map can be interchanged according to actual needs, or some steps can be omitted or deleted. Figure 2 As shown, the method includes:
[0089] S201, obtaining location information and marking data of each device in the area to be marked.
[0090] The area to be marked may refer to a certain area in the power operation network. For example, the area to be marked includes 8 devices, and each device is distributed at a different location. For example, each device may be a converter station, a UHV AC station, a 500KV substation, and a power plant.
[0091] Tag data can refer to the operation and maintenance information in the power operation network. Generally, the power grid operation and maintenance information can be obtained from the power grid resource business middle-end operation management center. The operation and maintenance information includes: dangerous points, inspection records, equipment defects, equipment failures, equipment hidden dangers, maintenance plans, power outage plans, live operations, etc. Since the operation and maintenance status of the power operation network is constantly changing, the tag data of each device can be added to the best annotation position to generate a power grid thematic map, realizing the graphical dynamic tag display of operation and maintenance information.
[0092] S202: Determine a connection line between at least one associated device connected to each device.
[0093] For example, referring to Figure 3 As shown, device 1 is connected to device 2, device 3, and device 4, that is, device 2, device 3, and device 4 are associated devices of device 1. Therefore, the connection lines between device 1 and device 2, device 3, and device 4 can be determined respectively according to the topological structure between the devices in the power operation network.
[0094] S203, determining the point marking position of each device according to the position information of each device and the connection line between at least one associated device connected to each device, and determining the line marking position of each device according to the connection line between at least one associated device connected to each device.
[0095] In this embodiment, in order to solve the problem of unreasonable annotation when laying out thematic maps in the prior art, a method of calculating the annotation position during the layout process is proposed to achieve the user's requirements for non-overlapping annotations and non-pressure on devices. Specifically, first determine an optimal point annotation position based on the location information of each device and the connection line between at least one associated device connected to each device; then, determine an optimal line annotation position based on the connection line between at least one associated device connected to each device. In this way, when annotating based on the point annotation position and line annotation position finally determined and calculated, overlap and partial intersection between annotation information can be avoided, thereby making the layout of the power grid thematic map optimal, solving the problems of graphic overlap, unreasonable layout, and overlapping connection lines when generating power grid thematic maps using the prior art.
[0096] S204 . According to the marking type of the marking data of each device, the marking data of each device is added to the point marking position or line marking position of each device to generate a power grid thematic map.
[0097] The annotation type of the marked data is set according to the business type. For example, dangerous points and live working points are point annotation types.
[0098] In this embodiment, mainly based on the annotation type of the device's tag data, it is determined to add the device's tag data to the point annotation position or line annotation position, generate a power grid thematic map, realize the visualization and graphical presentation of the power grid's operation and maintenance information, and significantly improve the readability and comprehensibility of the data.
[0099] For example, if the marking data of device 1 is a dangerous point, a dangerous point symbol can be added to the point marking position of device 1 to remind users. That is, users can timely understand the operation and maintenance status of device 1 based on the generated power grid thematic map, thereby improving the readability of the power grid thematic map.
[0100] In summary, the embodiment of the present application provides a method for generating a power grid thematic map. The scheme proposes a method for calculating the annotation position in the process of thematic map layout to meet the user's requirements for non-overlapping annotations and non-pressure equipment, that is, first, based on the location information of each device and the connection line between at least one associated device connected to each device, an optimal point annotation position can be determined; then, based on the connection line between at least one associated device connected to each device, an optimal line annotation position can be determined. In this way, when annotating based on the point annotation position and line annotation position finally determined and calculated, overlap and partial intersection between the annotation information can be avoided, thereby making the layout of the power grid thematic map optimal, and solving the problems of graphic overlap, unreasonable layout, and overlapping connection lines when generating power grid thematic maps using the existing technology.
[0101] How to determine the marked position of each device will be explained in detail through the following embodiments.
[0102] First, mark the location.
[0103] Optionally, refer to Figure 3 As shown, in the above step S203, the point marking position of each device is determined according to the position information of each device and the connection line between at least one associated device connected to each device, including:
[0104] S301: Determine the priority of each optional angle according to location information of the device, location information of at least one associated device connected to the device, and connection lines between the associated devices.
[0105] The optional angles are eight azimuth angles between the device and the associated device. It should be understood that the eight azimuth angles include: 0, PI / 4, PI / 2, 3PI / 4, PI, 5PI / 4, 3PI / 2, and 7PI / 4.
[0106] In this embodiment, for example, after respectively determining the connection lines between device 1 and each associated device, it is possible to determine whether the point marking boxes of optional angles in various directions overlap with each associated device, and whether the connection lines between each associated device intersect, based on the location information of device 1, the location information of each associated device, and the connection lines between the device 1 and each associated device.
[0107] Usually, the optional angles with no overlap and no crossing are preferred; the optional angles with no overlap and crossing are second best selected; the optional angles with as little overlap as possible and as few crossings as possible are selected by default.
[0108] S302: Determine the marking angle of the device according to the priority of each optional angle.
[0109] In this embodiment, the optional angles are sorted according to their priorities, and the optional angle with the highest priority is used as the best marking angle. That is, when marking based on the optional angle with the highest priority, it is possible to avoid intersection and overlap of the marking information.
[0110] S303: Determine the point marking position of the device according to the location information of the device, the marking angle and the preset marking radius.
[0111] In one achievable manner, after determining the optimal annotation angle of the device, the point annotation position can be calculated based on the device position information and the preset annotation radius R. The size of the point annotation box is: annotation width l_w, annotation height l_h, that is, the point annotation position is the position point of the upper left corner of the point annotation box.
[0112] For example, the device position information is P(x,y), that is, the position on the x-axis is px, and the position on the y-axis is py. For example, when the marking angle is 0, the point marking position is l(x,y), that is, the position on the x-axis is lx, and the position on the y-axis is ly, lx = px + R; ly = py.
[0113] Optionally, the priority of the optional angle includes: the overlapping area between the point marking box of the optional angle and each associated device, and the length of the line segment of the connection line between each associated device passing through the point marking box of the optional angle; the above step S302 includes:
[0114] If there is no overlapping area between the point marking box of the optional angle and each associated device, and the length of the line segment passing through the point marking box of the optional angle between the connecting lines between each associated device is zero, the optional angle will be compared with the preset multiple first preferred angles in turn, and the marking angle of the device will be determined based on the first comparison result.
[0115] In this embodiment, the point marking box of the optional angle can be calculated according to the location information of the device, the optional angle and the preset marking radius point; then, based on the point marking box of the optional angle and the location information of each associated device, it is determined whether there is an overlapping area between the point marking box of the optional angle and each associated device; if the size of the overlapping area is zero, it is determined that there is no overlapping area between the point marking box of the optional angle and each associated device.
[0116] At the same time, the position points on the connection line between the device and the associated devices can be obtained based on the position information of the device and the position information of the associated devices. Then, it is determined whether the position points on the connection line between the device and the associated devices fall into the point marking box of the optional angle or cross the point marking box of the optional angle. If they do not fall into or cross, it is determined that the length of the line segment of the connection line between the associated devices that crosses the point marking box of the optional angle is zero.
[0117] In order to ensure the rationality of the layout, it is also necessary to compare the selected optional angles with the preset multiple first preferred angles in turn, and determine the marking angle of the equipment according to the first comparison result.
[0118] Specifically, the final device marked angle is a multiple of the basic angle. The multiples are binary coded; the number of consecutive zeros is recorded starting from the lowest bit of each binary code, and the binary code with the largest number of consecutive zeros starting from the lowest bit is taken as the optimal angle. When recording the number of consecutive zeros starting from the lowest bit of each binary code, if a non-zero bit is encountered, the recording is stopped.
[0119] For example, the four angles of 0, 0.5PI, PI, and 1.5PI, with 0.5PI as the basic unit, can be converted into corresponding binary values: 00, 01, 10, and 11.
[0120] According to the above algorithm, the number of corresponding 0 values is: 2, 0, 1, 0. Therefore, the optimal angle is 0, the second optimal is PI, and the third optimal is 0.5PI and 1.5PI. Among them, the preset multiple first preferred angles include: 0, PI, 0.5PI, 1.5PI.
[0121] Therefore, the above selected optional angles are compared with 0, PI, 0.5PI, and 1.5PI in sequence. If the optional angle is consistent with PI in the first preferred angle, the best orientation is the PI degree direction, that is, the marked angle is PI. That is, when marking in orientation, there will be no overlap, intersection, etc.
[0122] Optionally, the above step S302 includes:
[0123] If there is no overlapping area between the point marking box of the optional angle and each associated device, and the length of the line segment passing through the point marking box of the optional angle between the associated devices is the shortest, the optional angle will be compared with multiple preset second priority angles in turn, and the marking angle of the device will be determined based on the second comparison result.
[0124] In another achievable manner, if the overlapping area between the point annotation box of the optional angle and each associated device is zero, it is determined that there is no overlapping area between the point annotation box of the optional angle and each associated device; if the length of the line segment of the connecting line between each associated device passing through the point annotation box of the optional angle is the shortest. In this case, no overlap can be satisfied, but threading cannot be avoided, therefore, the optional angle is sequentially compared with the preset multiple second priority angles, and the device annotation angle is determined according to the second comparison result.
[0125] For example, the eight angles of 0, 0.25PI, 0.5PI, 0.75PI, PI, 1.25PI, 1.5PI, and 1.75PI, with 0.25PI as the basic unit, can be converted into corresponding binary values: 000, 001, 010, 011, 100, 101, 110, and 111.
[0126] According to the above algorithm, the corresponding number of 0 values is: 3, 0, 1, 0, 2, 0, 1, 0. Therefore, the optimal angle is 0, the second optimal PI, the next 0.5PI, 1.5PI, the worst 0.25PI, 0.75PI, 1.25PI, 1.75PI. Among them, the preset multiple second preferred angles include: 0.25PI, 0.75PI, 1.25PI, 1.75PI.
[0127] Therefore, the above selected optional angles are compared with 0.25PI, 0.75PI, 1.25PI, and 1.75PI in sequence. If the optional angle is consistent with 0.25PI in the second preferred angle, the best orientation is the 0.25PI direction, that is, the marked angle is 0.25PI. That is, when marking in orientation, there will be no overlap, excessive intersection, etc.
[0128] The following embodiments will explain in detail how to calculate the size of the overlapping area between the point marking box of the optional angle and each associated device.
[0129] refer to Figure 4 As shown, the first rectangular box is a point marking box with selectable angles, and the second rectangular box is the area where the associated device is located.
[0130] Take the two horizontal coordinates of the first rectangular box, and then take the two horizontal coordinates of the second rectangular box. Sort the four quantities. The absolute value of the difference between the two middle quantities is the width of the overlapping part. Use a similar method to calculate the height of the overlapping part, and you can calculate the overlapping area.
[0131] The following example will explain in detail how to calculate the length of the line segment where the connecting line passes through the annotation box.
[0132] Usually, the line is generally a broken line. For simplicity, only the case of a line segment and a label box is considered. Three cases are discussed. Assume that the rectangular box is the label box and the connecting line L1 is a line segment passing through the label box.
[0133] The first one: reference Figure 5 As shown, the two points of the connecting line L1 are both within the marked box, and the distance between the two points is the length of the line segment.
[0134] The second type: reference Figure 6 As shown, one endpoint P1 on the connecting line L1 is inside the marked box, and the other endpoint P2 is outside the marked box. The intersection point P3 of the connecting line L1 and the marked box is calculated, and the length between the intersection point P3 and the point P1 inside the marked box is the line segment length.
[0135] The third type: reference Figure 7 As shown, the connecting line L1 and the annotation box have two intersection points P4 and P5. The distance between the two intersection points is the line segment length.
[0136] Second, mark the line position.
[0137] Optionally, refer to Figure 8 As shown, in the above step S203, determining the line marking position of the device according to the connection line between at least one associated device connected to each of the devices includes:
[0138] S801: Determine a maximum-length guaranteed line segment in a connection line between at least one associated device connected to a device.
[0139] For example, referring to Fig. 9 As shown, the connection line between device 1 and device 2 includes line segment L2, line segment L3 and line segment L4, where line segment L3 is the line segment with the longest connection line length, that is, line segment L3 can be used as the bottom line segment, that is, a markable position point can be determined on the bottom line segment. Fig. 9 It is shown that the connection line between device 1 and device 2 includes two lines, an upper line and a lower line.
[0140] S802: Determine at least one markable line segment according to the line guaranteeing line segment and the connection lines between the line guaranteeing line segment and the associated devices.
[0141] Among them, the marked line segment can be any marked position on the bottom line segment.
[0142] In this embodiment, an optimal marking line segment can be determined on the bottom line segment according to the bottom line segment and the connection lines between the associated devices. That is, when marking based on the optimal marking line segment, it is possible to avoid intersection and overlap of the marking information.
[0143] S803: Determine the line marking position of the device according to the priority of each markable line segment.
[0144] In this embodiment, the labelable line segments are sorted according to their priorities, and the labelable line segment with the highest priority is used as the best labeling line segment. That is, when labeling based on the labeling line segment with the highest priority, the rationality of the layout can be improved and the phenomenon of cross-overlapping of line labeling information can be avoided.
[0145] Optionally, the priority of the labelable line segment includes: an overlapping area between the line labeling frame of the labelable line segment and each of the associated devices, and a line segment length of a connection line between each of the associated devices passing through the line labeling frame of the labelable line segment;
[0146] refer to Fig.10 As shown, the above step S803 includes:
[0147] S1001. If there is no overlapping area between the line marking box of the labelable line segment and each associated device, and the length of the line segment of the connecting line between each associated device passing through the line marking box of the labelable line segment is zero, then determine the line marking position of the device according to the distance between the center point of the labelable line segment and the center point of the bottom line segment.
[0148] In this embodiment, the labelable line segment is parallel to the bottom line segment. When selecting the labelable line segment from the bottom line segment, slide from the initial point of the bottom line segment to the end point. During the sliding process, when sliding to the current labelable line segment, based on the position information of the line labeling box of the labelable line segment and each associated device, determine whether there is an overlapping area between the line labeling box of the labelable line segment and each associated device. If not, it can be determined that there is no overlapping area between the line labeling box of the labelable line segment and each associated device.
[0149] At the same time, it is also possible to obtain the position points on the connection lines between the device and the associated devices based on the location information of the device and the location information of the associated devices, and then determine whether the position points on the connection lines between the device and the associated devices fall into the line marking box of the labelable line segments, or cross the line marking box of the labelable line segments. If they do not fall into or do not cross, it is determined that the connection lines between the associated devices do not cross the line marking box of the labelable line segments.
[0150] At this time, the line marking position of the device can be determined according to the distance between the center point of the markable line segment and the center point of the bottom line segment. In this way, it can be ensured that the line marking position of the final device is as close to the center point of the bottom line segment as possible.
[0151] S1002. If there is no overlapping area between the line marking box of the labelable line segment and each associated device, and the length of the line segment of the connection line between each associated device passing through the line marking box of the labelable line segment is the shortest, then determine the line marking position of the device according to the distance between the center point of the labelable line segment and the center point of the bottom line segment.
[0152] In another achievable manner, if there is no overlapping area between the line annotation box of the annotable line segment and each associated device, and the length of the line segment of the connection line between each associated device passing through the line annotation box of the annotable line segment is the shortest. In this case, no overlap can be satisfied, but threading cannot be avoided. Therefore, the line annotation position of the device can be calculated based on the distance between the center point of the annotable line segment and the center point of the bottom line segment, so as to ensure that the final line annotation position of the device is as close as possible to the center point of the bottom line segment.
[0153] S1003. If the overlapping area between the line marking frame of the labelable line segment and each associated device is the smallest, and the length of the line segment of the connecting line between each associated device passing through the line marking frame of the labelable line segment is the shortest, then determine the line marking position of the device according to the distance between the center point of the labelable line segment and the center point of the bottom line segment.
[0154] In another feasible method, if the overlapping area between the line annotation box of the labelable line segment and each associated device is the smallest, and the length of the line segment of the connecting line between each associated device passing through the line annotation box of the labelable line segment is the shortest. In this case, both overlap and threading are unavoidable, so the overlap is as small as possible and the crossing is as few as possible. Finally, according to the distance between the center point of the labelable line segment and the center point of the bottom line segment, the line annotation position of the device is calculated to ensure that the final line annotation position of the device is as close to the center point of the bottom line segment as possible.
[0155] Optionally, refer to Fig.11 As shown, the above step S204 includes:
[0156] S1101. If the marking type of the marking data of the device is point device marking, then the marking data is added to the point marking position of the device.
[0157] S1102: If the marking type of the marking data of the device is line device marking, then add the marking data to the line marking position of the device.
[0158] For example, referring to Fig.12 As shown, the marking data currently obtained for device 1 includes: equipment failure and maintenance plan A, wherein equipment failure refers to the current fault condition of device 1, that is, the marking type of equipment failure is point device marking, and the equipment failure can be added to the point marking position of device 1; at the same time, maintenance plan A refers to the maintenance time for the power grid line from device 1 to device 2, that is, the marking type of maintenance plan A is line device marking, and maintenance plan A can be added to the line marking position of device 1.
[0159] For example, suppose the device 1 is marked at an angle of 0.5PI, i.e. 90 degrees. Fig.12 It can be observed that the point annotation position corresponding to the 90-degree direction overlaps and crosses with the two connecting lines, that is, when the point annotation position corresponding to the 90-degree direction is used, the annotation will be unreasonable. When the point annotation position and line annotation position determined by this solution are used for annotation, the user's requirements for non-overlapping and non-pressure annotation can be met, and the optimal annotation layout position can be achieved, with good drawing effect.
[0160] The following describes the device and storage medium used to execute the power grid thematic map generation method provided by the present application. The specific implementation process and technical effects are described above and will not be repeated below.
[0161] Fig.13 This is a schematic diagram of a power grid thematic map generating device according to an embodiment of the present application. The functions implemented by the power grid thematic map generating device correspond to the steps performed by the above method. The device can be understood as the above server, or a processor of the server, or can be understood as a component independent of the above server or processor that implements the functions of the present application under the control of the server. The device includes:
[0162] The acquisition module 1301 acquires the location information and marking data of each device in the area to be marked;
[0163] The determination module 1302 is used to determine the connection line between at least one associated device connected to each of the devices; determine the point marking position of each of the devices according to the position information of each of the devices and the connection line between at least one associated device connected to each of the devices, and determine the line marking position of each of the devices according to the connection line between at least one associated device connected to each of the devices;
[0164] The generating module 1303 is used to add the marking data of each device to the point marking position or line marking position of each device according to the marking type of the marking data of each device, so as to generate a power grid thematic map.
[0165] Optionally, the determining module 1302 is further configured to:
[0166] Determine the priority of each optional angle according to the location information of the device and the connection line between at least one associated device connected to the device, wherein the optional angle is an eight-azimuth angle between the device and the associated device;
[0167] Determining the marking angle of the device according to the priority of each optional angle;
[0168] The point marking position of the device is determined according to the position information of the device, the marking angle and a preset marking radius.
[0169] Optionally, the priority of the optional angle includes: an overlapping area between the point marking box of the optional angle and each of the associated devices, and a line segment length of a connection line between each of the associated devices passing through the point marking box of the optional angle;
[0170] The determining module 1302 is further configured to:
[0171] If there is no overlapping area between the point marking box of the optional angle and each of the associated devices, and the length of the line segment of the connecting line between each of the associated devices passing through the point marking box of the optional angle is zero, the optional angle is compared with multiple preset first preferred angles in turn, and the marking angle of the device is determined based on the first comparison result.
[0172] Optionally, the determining module 1302 is further configured to:
[0173] If there is no overlapping area between the point marking box of the optional angle and each of the associated devices, and the length of the line segment of the connecting line between each of the associated devices passing through the point marking box of the optional angle is the shortest, the optional angle is compared with multiple preset second priority angles in turn, and the marking angle of the device is determined based on the second comparison result.
[0174] Optionally, the determining module 1302 is further configured to:
[0175] Determine a maximum length of a guaranteed line segment in a connection line between at least one associated device connected to the device;
[0176] Determine at least one markable line segment according to the bottom line segment and the connection lines between the bottom line segment and the associated devices, where the markable line segment is any marked position on the bottom line segment;
[0177] The line marking position of the device is determined according to the priority of each markable line segment.
[0178] Optionally, the priority of the labelable line segment includes: an overlapping area between the line labeling frame of the labelable line segment and each of the associated devices, and a line segment length of a connection line between each of the associated devices passing through the line labeling frame of the labelable line segment;
[0179] The determining module 1302 is further configured to:
[0180] If there is no overlapping area between the line marking frame of the line segment that can be marked and each of the associated devices, and the length of the line segment of the connection line between each of the associated devices passing through the line marking frame of the line segment that can be marked is zero, the center point of the line segment with the guaranteed bottom line is used as the line marking position of the device;
[0181] If there is no overlapping area between the line marking frame of the labelable line segment and each of the associated devices, and the length of the line segment of the connection line between each of the associated devices passing through the line marking frame of the labelable line segment is the shortest, then the line marking position of the device is determined according to the distance between the center point of the labelable line segment and the center point of the bottom line segment;
[0182] If the overlapping area between the line marking box of the labelable line segment and each of the associated devices is the smallest, and the length of the line segment of the connecting line between each of the associated devices passing through the line marking box of the labelable line segment is the shortest, then the line marking position of the device is determined according to the distance between the center point of the labelable line segment and the center point of the bottom line segment.
[0183] Optionally, the generating module 1303 is used to:
[0184] If the marking type of the marking data of the device is point device marking, adding the marking data to the point marking position of the device;
[0185] If the marking type of the marking data of the device is a line device marking, the marking data is added to the line marking position of the device.
[0186] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0187] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0188] The above modules can be connected or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may include a connection in the form of a LAN, a WAN, Bluetooth, a ZigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art will clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application.
[0189] It should be noted that the above modules can be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0190] Optionally, the present application also provides a program product, such as a computer-readable storage medium, including a program, which is used to execute the above method embodiment when executed by a processor.
[0191] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0192] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0193] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0194] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
Claims
1. A method for generating a thematic power grid map, characterized in that: The method comprises: Obtain the location information and marking data of each device in the area to be marked; Determining a connection line between at least one associated device connected to each of the devices; Determine the point marking position of each device according to the position information of each device and the connection line between at least one associated device connected to each device, and determine the line marking position of each device according to the connection line between at least one associated device connected to each device; According to the marking type of the marking data of each device, the marking data of each device is added to the point marking position or line marking position of each device to generate a power grid thematic map.
2. The method according to claim 1, characterized in that The step of determining the point marking position of each device according to the position information of each device and the connection line between at least one associated device connected to each device includes: Determine the priority of each optional angle according to the location information of the device and the connection line between at least one associated device connected to the device, wherein the optional angle is an eight-azimuth angle between the device and the associated device; Determining the marking angle of the device according to the priority of each optional angle; The point marking position of the device is determined according to the position information of the device, the marking angle and a preset marking radius.
3. The method according to claim 2, characterized in that The priority of the optional angle includes: the overlapping area between the point marking box of the optional angle and each of the associated devices, and the length of the line segment of the connecting line between each of the associated devices passing through the point marking box of the optional angle; Determining the marking angle of the device according to the priority of each optional angle includes: If there is no overlapping area between the point marking box of the optional angle and each of the associated devices, and the length of the line segment of the connecting line between each of the associated devices passing through the point marking box of the optional angle is zero, the optional angle is compared with multiple preset first preferred angles in turn, and the marking angle of the device is determined based on the first comparison result.
4. The method according to claim 3, characterized in that Determining the marking angle of the device according to the priority of each optional angle includes: If there is no overlapping area between the point marking box of the optional angle and each of the associated devices, and the length of the line segment of the connecting line between each of the associated devices passing through the point marking box of the optional angle is the shortest, the optional angle is compared with multiple preset second priority angles in turn, and the marking angle of the device is determined based on the second comparison result.
5. The method according to claim 1, characterized in that: The step of determining the line marking position of the device according to the connection line between at least one associated device connected to each of the devices comprises: Determine a maximum length of a guaranteed line segment in a connection line between at least one associated device connected to the device; Determine at least one markable line segment according to the bottom line segment and the connection lines between the bottom line segment and the associated devices, where the markable line segment is any marked position on the bottom line segment; The line marking position of the device is determined according to the priority of each markable line segment.
6. The method according to claim 5, characterized in that The priority of the labelable line segment includes: the overlapping area of the line labeling frame of the labelable line segment and each of the associated devices, and the length of the line segment of the connection line between each of the associated devices passing through the line labeling frame of the labelable line segment; The step of determining the line marking position of the device according to the priority of each markable line segment includes: If there is no overlapping area between the line marking frame of the line segment that can be marked and each of the associated devices, and the length of the line segment of the connection line between each of the associated devices passing through the line marking frame of the line segment that can be marked is zero, the center point of the line segment with the guaranteed bottom line is used as the line marking position of the device; If there is no overlapping area between the line marking frame of the labelable line segment and each of the associated devices, and the length of the line segment of the connection line between each of the associated devices passing through the line marking frame of the labelable line segment is the shortest, then the line marking position of the device is determined according to the distance between the center point of the labelable line segment and the center point of the bottom line segment; If the overlapping area between the line marking box of the labelable line segment and each of the associated devices is the smallest, and the length of the line segment of the connecting line between each of the associated devices passing through the line marking box of the labelable line segment is the shortest, then the line marking position of the device is determined according to the distance between the center point of the labelable line segment and the center point of the bottom line segment.
7. The method according to claim 1, characterized in that The adding the marking data of each device to the point marking position or line marking position of each device according to the marking type of the marking data of each device includes: If the marking type of the marking data of the device is point device marking, adding the marking data to the point marking position of the device; If the marking type of the marking data of the device is a line device marking, the marking data is added to the line marking position of the device.
8. A power grid thematic map generating device, characterized in that: The device comprises: An acquisition module is used to obtain the location information and marking data of each device in the area to be marked; a determination module, configured to determine a connection line between at least one associated device connected to each of the devices; determine a point marking position of each of the devices according to the position information of each of the devices and a connection line between at least one associated device connected to each of the devices, and determine a line marking position of each of the devices according to a connection line between at least one associated device connected to each of the devices; The generating module is used to add the marking data of each device to the point marking position or line marking position of each device according to the marking type of the marking data of each device, so as to generate a power grid thematic map.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the method for generating a power grid thematic map as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for generating a power grid thematic map according to any one of claims 1 to 7 are executed.