Power distribution diagram rendering method and device, server and computer readable storage medium
By optimizing the grouping and status rendering of SVG power distribution diagrams on the server side, the problem of low rendering efficiency of SVG power distribution diagrams is solved, and efficient rendering and fast response are achieved.
Patent Information
- Application Number
- CN202410784993.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-09-17
AI Technical Summary
The rendering efficiency of power distribution diagrams in SVG format is low, mainly due to the redundant information and computational burden caused by its high precision and complex path description.
By grouping the initial power distribution diagram on the server side, it is divided into a first group of stateless elements and a second group of stateful elements. The second group is modified and rendered according to the received element state change data, and the stored first group is used. Group rendering effects to directly obtain the rendered power distribution diagram, avoid repeated rendering of stateless elements, and adjust rendering accuracy and resolution to improve efficiency.
It improves the efficiency of power distribution diagram rendering, reduces client processing time, improves data response speed and image quality, and reduces file transfer costs and loading times.
Smart Images

Figure CN118657869A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of SVG technology, and in particular to a method, device, server and computer-readable storage medium for rendering a power distribution diagram. Background Art
[0002] With the increasing complexity of power systems and the development of intelligent power grids, Scalable Vector Graphics (SVG) technology has been widely used in the management of power distribution diagrams in the electrical industry. However, due to the high-precision and complex graphic representation requirements, SVG is an XML-based text format that contains a lot of redundant information and complex path descriptions. Therefore, when rendering power distribution diagrams in SVG format, the rendering efficiency is low. Summary of the invention
[0003] The object of the present invention is to provide a method, device, server and computer-readable storage medium for rendering a power distribution diagram to solve the problem of low rendering efficiency.
[0004] In a first aspect, the present invention provides a method for rendering a power distribution diagram, which is applied to a server, wherein the server stores a first grouping, multiple second groups, and a rendering effect corresponding to the first grouping, wherein the first grouping and the second grouping are grouped according to a path corresponding to an initial power distribution diagram, wherein the elements on the path in the first grouping are stateless elements, and the elements on the path in the second grouping are stateful elements, and the types of elements in different second groups are different; the method comprises:
[0005] modifying the status of the elements in the second group accordingly according to the received element status change data;
[0006] Rendering each of the current second groups to obtain rendering effects corresponding to each of the second groups;
[0007] A rendered power distribution diagram is obtained according to the stored rendering effect corresponding to the first grouping and the stored rendering effect corresponding to the second grouping.
[0008] In an optional implementation, the second grouping includes a state-unchanged grouping and a state-changed grouping, the elements in the state-unchanged grouping are elements with fixed states, and the elements in the state-changed grouping are elements with changeable states; the server further stores rendering effects corresponding to the state-unchanged grouping; and modifying the states of the elements in the second grouping according to the received element state change data includes:
[0009] Modify the state of the elements in the state change group accordingly according to the received element state change data;
[0010] The rendering of each of the current second groups to obtain the rendering effects corresponding to each of the second groups includes:
[0011] Render each of the current state change groups to obtain the rendering effects corresponding to each of the state change groups:
[0012] The rendering effects corresponding to the second groups are obtained according to the rendering effects corresponding to the state-changed groups and the stored rendering effects corresponding to the state-unchanged groups.
[0013] In an optional implementation manner, rendering each of the current second groups to obtain a rendering effect corresponding to each of the second groups includes:
[0014] Get the display device resolution;
[0015] According to the resolution of the display device, adjusting the rendering accuracy of each of the second groups;
[0016] The current second groups are rendered according to the adjusted rendering accuracy, and the display ratio of each second group is adjusted according to the resolution of the display device to obtain the rendering effect corresponding to each second group.
[0017] In an optional implementation manner, adjusting the rendering accuracy of each of the second groups according to the resolution of the display device includes:
[0018] If the resolution of the display device is less than the low-resolution rendering threshold, reducing the rendering accuracy of the current second groups;
[0019] If the resolution of the display device is greater than the high-resolution rendering threshold, the rendering accuracy of the current second groups is increased.
[0020] In an optional embodiment, the first grouping and the second grouping are obtained according to the following method:
[0021] Simplifying and grouping unchanged paths in the initial power distribution diagram to obtain the first grouping;
[0022] The same type of change paths in the initial power distribution diagram are simplified and grouped to obtain the second grouping; the types of elements on the same type of change paths are the same.
[0023] In an optional implementation manner, after simplifying and grouping the unchanged paths in the initial power distribution diagram to obtain the first grouping, the method further includes:
[0024] The first grouping is rendered to obtain a rendering effect corresponding to the first grouping, and the rendering effect corresponding to the first grouping is stored.
[0025] In a second aspect, the present invention provides a power distribution diagram rendering device, which is applied to a server, wherein the server stores a first grouping, multiple second groups, and rendering effects corresponding to the first grouping, wherein the first grouping and the second grouping are obtained by grouping according to a path corresponding to an initial power distribution diagram, wherein the elements on the path in the first grouping are stateless elements, and the elements on the path in the second grouping are stateful elements, and the types of elements in different second groups are different; the device comprises:
[0026] A state modification module, used to modify the state of the elements in the second group according to the received element state change data;
[0027] A rendering module, used for rendering each of the current second groups to obtain a rendering effect corresponding to each of the second groups;
[0028] The power distribution diagram obtaining module is used to obtain a rendered power distribution diagram according to the stored rendering effect corresponding to the first grouping and the stored rendering effect corresponding to the second grouping.
[0029] In an optional implementation, the second group includes a state-unchanged group and a state-changed group, the elements in the state-unchanged group are elements with fixed states, and the elements in the state-changed group are elements with changeable states; the server further stores rendering effects corresponding to the state-unchanged group;
[0030] The state modification module is also used to modify the state of the elements in the state change group according to the received element state change data;
[0031] The rendering module is also used to render each of the current state change groups to obtain the rendering effect corresponding to each of the state change groups:
[0032] The power distribution diagram obtaining module is further used to obtain the rendering effects corresponding to each of the second groups according to the rendering effects corresponding to each of the state-changed groups and the stored rendering effects corresponding to the state-unchanged groups.
[0033] In a third aspect, the present invention provides a server, comprising a processor and a memory, wherein the memory stores a computer program executable by the processor, and the computer program executable by the processor is used to implement the power distribution diagram rendering method described in any of the aforementioned embodiments.
[0034] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for rendering a power distribution diagram as described in any one of the aforementioned embodiments is implemented.
[0035] The embodiments of the present invention provide a method, device, server and computer-readable storage medium for rendering a power distribution diagram. The server stores a first group, multiple second groups and a rendering effect corresponding to the first group. The first group and the second group are grouped according to the path corresponding to the initial power distribution diagram. The elements on the path in the first group are stateless elements, and the elements on the path in the second group are stateful elements, and the types of elements in different second groups are different. The method includes: modifying the state of the elements in the second group according to the received element state change data, rendering each current second group, obtaining the rendering effect corresponding to each second group, and obtaining the rendered power distribution diagram according to the stored rendering effect corresponding to the first group and the rendering effect corresponding to the second group. Therefore, when rendering the power distribution diagram, it is only necessary to render the second group including the stateful elements, and the rendering effect of the first group including the stateless elements can be directly obtained without rendering, so the rendering efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention 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 creative work.
[0037] Figure 1 A schematic diagram of a flow chart of a method for rendering a power distribution diagram provided by an embodiment of the present invention is shown;
[0038] Figure 2 Another schematic diagram of the flow of the power distribution diagram rendering method provided by an embodiment of the present invention is shown;
[0039] Figure 3 A module block diagram of a power distribution diagram rendering device provided by an embodiment of the present invention is shown;
[0040] Figure 4 A block diagram of a server provided by an embodiment of the present invention is shown.
[0041] Icons: 100 - server; 200 - power distribution diagram rendering device; 210 - state modification module; 220 - rendering module; 230 - power distribution diagram acquisition module; 110 - memory; 120 - processor; 130 - communication module. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0043] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0045] See also Figure 1 , Figure 1 A schematic diagram of a flow chart of a power distribution diagram rendering method provided by an embodiment of the present invention is shown. The power distribution diagram rendering method can be applied to a server, and the server stores a first grouping, multiple second groups, and rendering effects corresponding to the first grouping. The first grouping and the second grouping are grouped according to the path corresponding to the initial power distribution diagram. The elements on the path in the first grouping are stateless elements, and the elements on the path in the second grouping are stateful elements. The types of elements in different second groups are different. The specific process of this embodiment is explained below by taking a server as an example. Figure 1 The process shown is described in detail, and the power distribution diagram rendering method may specifically include the following steps:
[0046] Step 110: modify the status of the elements in the second group accordingly according to the received element status change data.
[0047] It should be noted that the initial power distribution diagram is in SVG format. Stateless elements are devices or components that do not store historical states or information in the circuit. The elements on the path in the first group can be stateless elements such as connectors and monitoring systems. Stateful elements are devices or components that have memory and state conversion functions and can generate different outputs according to the previous state. The elements on the path in the second group can be stateful elements such as switches, indicator lights, grounding knives, circuit breakers, and trolleys. The types of elements in different second groups can be action change types, color change types, and data display types. Specifically, action change type elements can be switches, circuit breakers, and grounding knives, etc.; color change type elements include indicator lights and control buttons, etc.; data display type elements can include instrument dials and data recorders, etc.
[0048] The power distribution diagram is a diagram used to represent electrical equipment, lines, wiring and other related information in an electrical system. The server can be connected to the electrical system through detection equipment and data acquisition equipment. The detection equipment detects the state changes of elements in the electrical system. The data acquisition equipment converts the detected state changes of the elements into element state change data, and transmits the element state change data to the server through a data interface. Among them, the detection equipment can be a sensor and a monitoring device. Specifically, the sensor can be a temperature sensor, a humidity sensor, a current sensor, a voltage sensor, etc., which are not limited here.
[0049] The server can receive the element state change data fed back by the electrical system through the detection device and the data acquisition device, and modify the state of the element in the second grouping according to the received element state change data. For example, if the state of element 1 in the second grouping A1 is open, and the server receives the element change data that the state of element 1 is closed, then the state of element 1 in the second grouping A1 is modified to closed.
[0050] Step 120: Render each current second grouping to obtain a rendering effect corresponding to each second grouping.
[0051] The server may convert each second grouping into an instruction set that can be directly executed by a graphics processing unit (GPU), and render each current second grouping through the GPU, thereby utilizing the parallel processing capability of the GPU to improve rendering efficiency.
[0052] Step 130: Obtain a rendered power distribution diagram according to the stored rendering effect corresponding to the first grouping and the stored rendering effect corresponding to the second grouping.
[0053] In some implementations, the server may store a correspondence between the identifier of the first group and the rendering effect corresponding to the first group. Therefore, the server may find the rendering effect corresponding to the first group through the identifier of the first group.
[0054] For example, the procedure for obtaining the rendering effect corresponding to the first group stored in the server is as follows:
[0055] function useCachedElement(id)
[0056] {if(cache[id]){ / / directly use the rendering result corresponding to the first stored group return cache[id];}
[0057] else{ / / Render the second group return renderElement(id, / *element* / );}}
[0058] In some embodiments, after obtaining the rendered power distribution diagram, the server may monitor user operations, such as mouse scrolling, touch events, keyboard input, and mouse dragging, to obtain the user operations, and adjust the display ratio of the rendered power distribution diagram according to the user operations. For example, if the user double-clicks the mouse on the rendered power distribution diagram, the rendered power distribution diagram is enlarged.
[0059] The power distribution diagram rendering method provided by the embodiment of the present invention modifies the state of the elements in the second grouping according to the received element state change data, renders each current second grouping, obtains the rendering effect corresponding to each second grouping, and obtains the rendered power distribution diagram according to the stored rendering effect corresponding to the first grouping and the rendering effect corresponding to the second grouping. Therefore, when rendering the power distribution diagram, it is only necessary to render the second group including the stateful elements, and the rendering effect of the first group including the stateless elements can be directly obtained without rendering, so the rendering efficiency can be improved.
[0060] It is understandable that improving rendering efficiency can reduce the time required for the client to process data, convert data into visualization results more quickly, and thus improve the timeliness of data response.
[0061] In order to improve the rendering speed, the second grouping includes a state-unchanged grouping and a state-changed grouping. The elements in the state-unchanged grouping are elements with fixed states, and the elements in the state-changed grouping are elements with changeable states. The server can also store the rendering effects corresponding to the state-unchanged grouping. It can be understood that the elements on the path in the second grouping are stateful elements, but the state of the stateful elements may not change. Therefore, the second grouping includes a state-unchanged grouping and a state-changed grouping to avoid repeated rendering of the state-unchanged grouping. The server stores the rendering effects corresponding to the state-unchanged grouping so that the rendering effects corresponding to the state-unchanged grouping can be directly used later.
[0062] Step 110 may specifically include the following steps: modifying the state of the elements in the state change grouping according to the received element state change data.
[0063] The second grouping includes a grouping with no change in state and a grouping with changed state. The elements in the grouping with no change in state are elements with fixed states. The states of the elements in the grouping with fixed states will not change. The element state change data does not include the states of the elements in the grouping with fixed states. The element state change data includes the states of the elements in the grouping with changed states. Therefore, the server modifies the states of the elements in the grouping with changed states included in the second grouping according to the received element state change data.
[0064] Step 120 may specifically include the following steps: rendering each current state change grouping to obtain a rendering effect corresponding to each state change grouping.
[0065] It is understandable that the server stores rendering effects corresponding to the unchanged state group, and there is no need to render the unchanged state group again, and only the current changed state groups need to be rendered. If the server does not store rendering effects corresponding to the unchanged state group, and only stores rendering effects corresponding to the first group, it is necessary to render both the unchanged state group and the changed state group included in the second group.
[0066] Step 130 may specifically include the following steps: obtaining rendering effects corresponding to each second grouping according to rendering effects corresponding to each state-changed grouping and stored rendering effects corresponding to the state-unchanged grouping.
[0067] In this embodiment, the server stores the rendering effects corresponding to the first grouping and the rendering effects corresponding to the groups with unchanged status included in the second grouping. Subsequently, the server only needs to render the current groups with changed status, without repeatedly rendering the first grouping and the groups with unchanged status, thereby improving rendering efficiency.
[0068] To improve image quality and reduce loading time, the server can adjust the rendering accuracy according to the display device resolution. Figure 2 , the above step 120 may specifically include the following steps:
[0069] Step 121: Obtain the display device resolution.
[0070] As an implementation method, the server can obtain the information of the display device by using the JavaScript window.screen object. The information of the display device includes width, height, pixel ratio, etc. The display device resolution can be obtained according to the width, height and pixel ratio.
[0071] As another implementation, the server may use media queries to detect the screen size and resolution of the display device to obtain the resolution of the display device.
[0072] Step 122: According to the resolution of the display device, adjust the rendering accuracy of each current second grouping.
[0073] If the display device resolution is less than the low-resolution rendering threshold, the rendering accuracy of the current second groups is reduced; if the display device resolution is greater than the high-resolution rendering threshold, the rendering accuracy of the current second groups is increased; if the display device resolution is greater than or equal to the low-resolution rendering threshold, and less than or equal to the high-resolution rendering threshold, the preset rendering accuracy is used.
[0074] The specific execution code can be the following code:
[0075] if(screenWidth <thresholdLowResolution){
[0076] / / Reduce rendering accuracy decreaseRenderingQuality();}
[0077] else if(screenWidth>thresholdHighResolution){
[0078] / / Improve rendering accuracy increaseRenderingQuality();}
[0079] else{
[0080] / / Use the default rendering quality defaultRenderingQuality();}
[0081] In some implementations, the current rendering accuracy may be a preset rendering accuracy, or the current rendering accuracy may be a rendering accuracy adjusted last time, and the specific current rendering accuracy may be set according to actual conditions.
[0082] Step 123: Render each current second grouping according to the adjusted rendering accuracy, and adjust the display ratio of each second grouping according to the resolution of the display device to obtain the rendering effect corresponding to each second grouping.
[0083] In some embodiments, the server may adjust the display ratio of each second group according to the display device resolution. The server has stored the rendering effect corresponding to the first group, and the rendering effect includes adjusting the display ratio of the first group according to the display device resolution.
[0084] As an implementation method, the viewBox attribute of the initial power distribution diagram in SVG format defines the coordinate system of the initial power distribution diagram content, and the size and position of the viewBox can be adjusted according to the resolution of the display device, and the display range and proportion of each second grouping on the display device can be changed.
[0085] As another implementation, each second grouping may be scaled using the transform:scale() attribute of Cascading Style Sheets (CSS) to adapt to different display device resolutions.
[0086] In order to reduce the size of the initial power distribution diagram in SVG format, the first grouping and the second grouping are obtained according to the following method: simplifying and grouping the unchanged paths in the initial power distribution diagram to obtain the first grouping; simplifying and grouping the changed paths of the same type in the initial power distribution diagram to obtain the second grouping; the types of elements on the changed paths of the same type are the same.
[0087] Before obtaining the first group and the second group, the user can check and adjust the color and stroke settings of each element in the initial power distribution diagram in the drawing software to ensure that too many colors or styles are not used. The drawing software may be Adobe illustrator, which is not limited here.
[0088] In some implementations, the user selects an unchanged path in the initial power distribution map in the electronic device, and the electronic device sends the selected unchanged path to the server, which simplifies the selected unchanged path and groups the unchanged paths into a group to obtain a first grouping. The user selects a changed path of the same type in the initial power distribution map in the electronic device, and the electronic device sends the changed path of the same type in the selected initial power distribution map to the server, and the server simplifies and groups the changed paths of the same type, and repeats multiple times to obtain multiple second groups.
[0089] In some implementations, the server may automatically delete redundant anchor points in the unchanged path and the changed path, wherein the redundant anchor points refer to unnecessary connection points or connection lines in the design or drawing process.
[0090] In some implementations, the server may obtain the user's numbering of different second groups, so as to distinguish whether the group is the first group or the second group by whether there is a number, and may also determine the type of the second group and the device corresponding to the second group according to the number.
[0091] For example, the second group is numbered A1B1, A1 indicates that the second group is the second group corresponding to the first electrical cabinet, B1 indicates that the type of elements in the second group is a data change type, and the second group is numbered A1B2, A1 indicates that the second group is the second group corresponding to the first electrical cabinet, and B2 indicates that the type of elements in the second group is a color change type.
[0092] After obtaining the first grouping and the second grouping, the first grouping and the multiple second groups can be exported according to the export settings set by the user. The export style can be set to internal CSS, and the first grouping and the multiple second groups are marked, and the identifiers corresponding to the first grouping and the multiple second groups are obtained, so as to subsequently store the corresponding relationship between the identifier corresponding to the first grouping and the rendering effect, and the corresponding relationship between the identifier corresponding to the state change group in the second group and the rendering effect.
[0093] It should be noted that internal CSS refers to the use of <style>标签来定义元素的样式,可以在SVG格式的初始配电图中轻松定义和管理样式,从而避免了需要引入外部样式表,减小代码量。
[0094] 指将CSS样式表直接嵌入到HTML文档的<style>标签中,而不是作为外部文件进行引用。
[0095] 在对初始配电图中的无变化路径进行简化和编组,得到第一编组之后,该方法还包括以下步骤:对第一编组进行渲染,得到第一编组对应的渲染效果,并对第一编组对应的渲染效果进行存储。
[0096] 在对初始配电图中的无变化路径进行简化和编组,得到第一编组之后,也就是,获得导出的第一编组和第二编组,根据是否有编号区分编组为第一编组还是第二编组,若编组无编号,则为第一编组,对第一编组进行渲染,得到第一编组对应的渲染效果,并对第一编组对应的渲染效果进行存储。
[0097] 在本实施例,对初始配电图中的无变化路径进行简化和编组,得到第一编组,对初始配电图中的相同类型的变化路径进行简化和编组,获得第二编组,减小初始配电图的大小,可以降低文件传输的成本,从而加快初始配电图从服务器到客户端的传输速度,并且较小的初始配电图,当数据发生变化时,客户端能够更快地从服务器中获取更新后的SVG格式的配电图,从而提高数据的响应及时性。
[0098] 为了执行上述实施例及各个可能的方式中的相应步骤,下面给出一种配电图渲染装置的实现方式。进一步地,请参阅图3,图为本发明实施例提供的一种配电图渲染装置的功能模块图。需要说明的是,本实施例所提供的配电图渲染装置,其基本原理及产生的技术效果和上述实施例相同,为简要描述,本实施例部分未提及之处,可参考上述的实施例中相应内容。该配电图渲染装置200包括:状态修改模块210、渲染模块220以及配电图获得模块230,其中:
[0099] 状态修改模块210,用于根据接收到的元素状态变化数据对应修改第二编组中的元素的状态;
[0100] 渲染模块220,用于对当前的各第二编组进行渲染,获得各第二编组对应的渲染效果;
[0101] 配电图获得模块230,用于根据存储的第一编组对应的渲染效果以及第二编组对应的渲染效果,获得渲染后的配电图。
[0102] 可选地,第二编组包括状态无变化编组以及状态变化编组,状态无变化编组中的元素为状态固定的元素,状态变化编组中的元素为状态可变化的元素;服务器还存储有状态无变化编组对应的渲染效果;状态修改模块210还用于根据接收到的元素状态变化数据对应修改状态变化编组中的元素的状态;渲染模块220还用于对当前的各状态变化编组进行渲染,获得各状态变化编组对应的渲染效果:配电图获得模块230还用于根据各状态变化编组对应的渲染效果以及存储的状态无变化编组对应的渲染效果,获得各第二编组对应的渲染效果。
[0103] 可选地,渲染模块220具体还用于获得显示设备分辨率;根据显示设备分辨率,调节对当前的各第二编组进行渲染的渲染精度;根据调节后的渲染精度对当前的各第二编组进行渲染,并根据显示设备分辨率调节各第二编组的显示比例,获得各第二编组对应的渲染效果。
[0104] 可选地,渲染模块220具体还用于若显示设备分辨率小于低分辨率渲染阈值,则降低对当前的各第二编组进行渲染的渲染精度;若显示设备分辨率大于高分辨率渲染阈值,则提高对当前的各第二编组进行渲染的渲染精度。
[0105] 可选地,配电图渲染装置200包括编组获得模块,其中:
[0106] 编组获得模块用于对初始配电图中的无变化路径进行简化和编组,得到第一编组;对初始配电图中的相同类型的变化路径进行简化和编组,获得第二编组;相同类型的变化路径上的元素的类型相同。
[0107] 编组获得模块具体还用于对第一编组进行渲染,得到第一编组对应的渲染效果,并对第一编组对应的渲染效果进行存储。
[0108] 所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
[0109] 在本发明所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。
[0110] 另外,在本发明各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
[0111] 请参照图4,是本发明实施例提供的服务器100的方框示意图。服务器100包括存储器110、处理器120及通信模块130。存储器110、处理器120以及通信模块130各元件相互之间直接或间接地电性连接,以实现数据的传输或交互。例如,这些元件相互之间可通过一条或多条通讯总线或信号线实现电性连接。
[0112] 其中,存储器110用于存储程序或者数据。存储器110可以是,但不限于,随机存取存储器(Random Access Memory,RAM),只读存储器(Read Only Memory,ROM),可编程只读存储器(Programmable Read-Only Memory,PROM),可擦除只读存储器(ErasableProgrammable Read-Only Memory,EPROM),电可擦除只读存储器(Electric ErasableProgrammable Read-Only Memory,EEPROM)等。
[0113] 处理器120用于读 / 写存储器中存储的数据或程序,并执行相应地功能。例如,当存储器110中存储的计算机程序被处理器120执行时,可以实现上述各实施例所揭示的配电图渲染方法。
[0114] 通信模块130用于通过网络建立服务器100与多端电子设备之间的通信连接,并用于通过网络收发数据。
[0115] 应当理解的是,图4所示的结构仅为服务器的结构示意图,服务器还可包括比图4中所示更多或者更少的组件。图4中所示的各组件可以采用硬件、软件或其组合实现。
[0116] 本发明实施例还提供了一种计算机可读存储介质,该计算机可读介质中存储有计算机程序,计算机程序可被处理器执行时实现上述方法实施例中所描述的配电图渲染方法。
[0117] 计算机可读存储介质可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质具有执行上述方法中的任何方法步骤的程序代码的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码可以例如以适当形式进行压缩。
[0118] 在本发明所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本发明的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和 / 或流程图中的每个方框、以及框图和 / 或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
[0119] 功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
[0120] 以上仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。< / style>
Claims
1. A method for rendering a power distribution diagram, characterized in that: Applied to a server, the server stores a first grouping, a plurality of second groups, and a rendering effect corresponding to the first grouping, the first grouping and the second grouping are obtained by grouping according to a path corresponding to an initial power distribution diagram, the elements on the path in the first grouping are stateless elements, the elements on the path in the second grouping are stateful elements, and the types of elements in different second groups are different; the method comprises: modifying the status of the elements in the second group accordingly according to the received element status change data; Rendering each of the current second groups to obtain rendering effects corresponding to each of the second groups; A rendered power distribution diagram is obtained according to the stored rendering effect corresponding to the first grouping and the stored rendering effect corresponding to the second grouping.
2. The method according to claim 1, characterized in that The second grouping includes a state-unchanged grouping and a state-changed grouping, the elements in the state-unchanged grouping are elements with fixed states, and the elements in the state-changed grouping are elements with changeable states; the server further stores rendering effects corresponding to the state-unchanged grouping; and modifying the states of the elements in the second grouping according to the received element state change data includes: Modify the state of the elements in the state change group accordingly according to the received element state change data; The rendering of each of the current second groups to obtain the rendering effects corresponding to each of the second groups includes: Render each of the current state change groups to obtain the rendering effects corresponding to each of the state change groups: The rendering effects corresponding to the second groups are obtained according to the rendering effects corresponding to the state-changed groups and the stored rendering effects corresponding to the state-unchanged groups.
3. The method according to claim 1, characterized in that: The rendering of each of the current second groups to obtain the rendering effects corresponding to each of the second groups includes: Get the display device resolution; According to the resolution of the display device, adjusting the rendering accuracy of each of the second groups; The current second groups are rendered according to the adjusted rendering accuracy, and the display ratio of each second group is adjusted according to the resolution of the display device to obtain the rendering effect corresponding to each second group.
4. The method according to claim 3, characterized in that The adjusting the rendering accuracy of each of the second groups according to the resolution of the display device includes: If the resolution of the display device is less than the low-resolution rendering threshold, reducing the rendering accuracy of the current second groups; If the resolution of the display device is greater than the high-resolution rendering threshold, the rendering accuracy of the current second groups is increased.
5. The method according to claim 1, characterized in that The first grouping and the second grouping are obtained according to the following method: Simplifying and grouping unchanged paths in the initial power distribution diagram to obtain the first grouping; The same type of change paths in the initial power distribution diagram are simplified and grouped to obtain the second grouping; the types of elements on the same type of change paths are the same.
6. The method according to claim 5, characterized in that After simplifying and grouping the unchanged paths in the initial power distribution diagram to obtain the first grouping, the method further includes: The first grouping is rendered to obtain a rendering effect corresponding to the first grouping, and the rendering effect corresponding to the first grouping is stored.
7. A power distribution diagram rendering device, characterized in that: Applied to a server, the server stores a first grouping, a plurality of second groups, and a rendering effect corresponding to the first grouping, the first grouping and the second grouping are obtained by grouping according to a path corresponding to an initial power distribution diagram, the elements on the path in the first grouping are stateless elements, the elements on the path in the second grouping are stateful elements, and the types of elements in different second groups are different; The device comprises: A state modification module, used to modify the state of the elements in the second group according to the received element state change data; A rendering module, used for rendering each of the current second groups to obtain a rendering effect corresponding to each of the second groups; The power distribution diagram obtaining module is used to obtain a rendered power distribution diagram according to the stored rendering effect corresponding to the first grouping and the stored rendering effect corresponding to the second grouping.
8. The device according to claim 7, characterized in that The second grouping includes a state-unchanged grouping and a state-changed grouping, the elements in the state-unchanged grouping are elements with fixed states, and the elements in the state-changed grouping are elements with changeable states; the server also stores rendering effects corresponding to the state-unchanged grouping; The state modification module is also used to modify the state of the elements in the state change group according to the received element state change data; The rendering module is also used to render each of the current state change groups to obtain the rendering effect corresponding to each of the state change groups: The power distribution diagram obtaining module is further used to obtain the rendering effects corresponding to each of the second groups according to the rendering effects corresponding to each of the state-changed groups and the stored rendering effects corresponding to the state-unchanged groups.
9. A server, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and the computer program executable by the processor is used to implement the power distribution diagram rendering method described in any one of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the power distribution diagram rendering method according to any one of claims 1 to 5 is implemented.
