CN114925127A - Two-dimensional graph generation method and device for cascade structure data and storage medium - Google Patents
Two-dimensional graph generation method and device for cascade structure data and storage medium Download PDFInfo
- Publication number
- CN114925127A CN114925127A CN202210373391.6A CN202210373391A CN114925127A CN 114925127 A CN114925127 A CN 114925127A CN 202210373391 A CN202210373391 A CN 202210373391A CN 114925127 A CN114925127 A CN 114925127A
- Authority
- CN
- China
- Prior art keywords
- node
- attribute information
- dimensional graph
- cascade structure
- nodes
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/26—Visual data mining; Browsing structured data
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Image Generation (AREA)
Abstract
The embodiment of the disclosure discloses a method and a device for generating a two-dimensional graph of cascade structure data, a storage medium and an electronic device, wherein the method for generating the two-dimensional graph of the cascade structure data comprises the following steps: acquiring cascade structure data; determining an abscissa interval corresponding to each node according to the transverse attribute information of each node, wherein the abscissa interval corresponding to one node represents cells occupied by the node in a corresponding row of the two-dimensional graph; determining a longitudinal coordinate corresponding to each node according to the longitudinal attribute information of each node; the nodes are sequenced according to the vertical coordinates corresponding to each node to obtain corresponding node sequences; and filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph according to the abscissa interval corresponding to each node to generate the two-dimensional graph of the cascade structure data, wherein the rows of the two-dimensional graph correspond to the transverse attribute information of the nodes in the table, and the columns of the two-dimensional graph correspond to the longitudinal attribute information of the nodes in the table.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a two-dimensional graph of cascade structure data, a storage medium, an electronic device, and a computer program product.
Background
In an actual business scenario, it is often necessary to expose data of a cascaded structure, e.g., subdivided different age groups, organizational hierarchy, etc.
The existing display mode of the cascade structure data is often displayed through a transverse tree diagram or a longitudinal tree diagram. The existing display mode is not only single, but also cannot display more node information of each node in the cascade structure data and node association information among each node because the cascade relation among each node in the cascade structure data is simply presented.
How to enrich the existing display mode of the cascade structure data, and display more node information of each node in the cascade structure data and node association information among each node is a technical problem to be solved.
Disclosure of Invention
Based on this, it is necessary to provide a method and an apparatus for generating a two-dimensional graph of concatenated structure data, a storage medium, and an electronic device, for solving the problems that the existing concatenated structure data-based display method is single, and more node information of each node and node association information between nodes cannot be displayed.
In a first aspect, an embodiment of the present disclosure provides a method for generating a two-dimensional graph of cascade structure data, including:
acquiring cascade structure data, wherein the cascade structure data comprises node information corresponding to each node in a cascade structure, and the node information comprises transverse attribute information and longitudinal attribute information;
determining an abscissa interval corresponding to each node according to the transverse attribute information of each node, wherein the abscissa interval corresponding to one node represents cells occupied by the node in a corresponding row of the two-dimensional graph;
determining a longitudinal coordinate corresponding to each node according to the longitudinal attribute information of each node;
sequencing the nodes according to the vertical coordinates corresponding to each node to obtain a corresponding node sequence;
and filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph according to the abscissa interval corresponding to each node to generate the two-dimensional graph of the cascade structure data, wherein the rows of the two-dimensional graph correspond to the transverse attribute information of the nodes in the table, and the columns of the two-dimensional graph correspond to the longitudinal attribute information of the nodes in the table.
In one embodiment, further comprising:
outputting the two-dimensional graph for graph presentation of the cascade structure data.
In one embodiment, determining an abscissa interval corresponding to each node according to the lateral attribute information of each node includes:
performing depth-first traversal on the cascade structure to determine the node width of each node according to the transverse attribute information of each node in the cascade structure;
acquiring an initial abscissa of a root node in the cascade structure;
and determining an abscissa interval corresponding to each node in the cascade structure according to the initial abscissa of the root node and the node width of each node in the cascade structure.
In one embodiment, the method further comprises:
determining the node width of the root node according to the node width of each node; and
and pre-configuring the initial two-dimensional graph by taking the node width of the root node as the lateral width of the graph.
In one embodiment, determining the vertical coordinate corresponding to each node according to the vertical attribute information of each node includes performing a depth-first traversal on the cascade structure to:
determining a longitudinal coordinate corresponding to each node directly according to the longitudinal attribute information of each node; or
Determining an initial longitudinal coordinate corresponding to each node according to the longitudinal attribute information of each node, determining the layering number of the cascade structure according to the longitudinal attribute information of each node, and resetting the initial longitudinal coordinate corresponding to each node according to the layering data volume.
In one embodiment, further comprising:
and pre-configuring the initial two-dimensional graph by taking the number of layers represented by the layering number as the longitudinal width of the graph.
In one embodiment, the method further comprises:
and after filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph, generating blank nodes and filling the blank nodes into the rest blank cells in the two-dimensional graph.
In a second aspect, an embodiment of the present disclosure provides a two-dimensional graph generating apparatus for generating cascade structure data, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring cascade structure data, the cascade structure data comprises node information corresponding to each node in a cascade structure, and the node information comprises transverse attribute information and longitudinal attribute information;
the determining unit is used for determining an abscissa interval corresponding to each node according to the transverse attribute information of each node, wherein the abscissa interval corresponding to one node represents the cells occupied by the node in the corresponding row of the two-dimensional graph; and
determining a longitudinal coordinate corresponding to each node according to the longitudinal attribute information of each node;
the sorting unit is used for sorting the nodes according to the vertical coordinates corresponding to each node to obtain a corresponding node sequence;
and the filling unit is used for filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph according to the abscissa interval corresponding to each node so as to generate the two-dimensional graph of the cascade structure data, wherein the rows of the two-dimensional graph correspond to the transverse attribute information of the nodes in the table, and the columns of the two-dimensional graph correspond to the longitudinal attribute information of the nodes in the table.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the above-mentioned method steps.
In a fourth aspect, the present disclosure provides a computer-readable storage medium storing a computer program for performing the above-mentioned method steps.
In a fifth aspect, the embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the above-mentioned method steps.
In the embodiment of the disclosure, the nodes are sorted according to the ordinate corresponding to each node to obtain a corresponding node sequence; and filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph according to the abscissa interval corresponding to each node to generate the two-dimensional graph of the cascade structure data, wherein the rows of the two-dimensional graph correspond to the transverse attribute information of the nodes in the table, and the columns of the two-dimensional graph correspond to the longitudinal attribute information of the nodes in the table. According to the two-dimensional graph generation method for the cascade structure data, the nodes in the node sequence can be filled to the corresponding positions of the initial two-dimensional graph according to the abscissa interval corresponding to each node to generate the two-dimensional graph of the cascade structure data, wherein the rows of the two-dimensional graph correspond to the transverse attribute information of the nodes in the table, and the columns of the two-dimensional graph correspond to the longitudinal attribute information of the nodes in the table; in this way, compared with the conventional single display mode of the cascade structure data, the generated two-dimensional graph of the cascade structure data can display more node attribute information through the horizontal attribute information and the vertical attribute information.
Drawings
Exemplary embodiments of the present invention may be more completely understood in consideration of the following drawings. The accompanying drawings are included to provide a further understanding of the disclosed embodiments and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings, like reference numbers generally represent like parts or steps.
FIG. 1 is a flowchart of a method for generating a two-dimensional graph of concatenated structural data according to an exemplary embodiment of the present disclosure;
FIG. 2 is a diagram illustrating a conventional data structure of a cascade connection;
fig. 3 is a schematic diagram of a two-dimensional graph generated by a two-dimensional graph generation method for cascade structure data in a specific application scenario according to an exemplary embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a two-dimensional graph generating apparatus 400 for generating cascaded structural data according to an exemplary embodiment of the present disclosure;
FIG. 5 illustrates a schematic diagram of an electronic device provided by an exemplary embodiment of the present disclosure;
fig. 6 shows a schematic diagram of a computer-readable medium provided by an exemplary embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It is to be noted that, unless otherwise specified, technical or scientific terms used herein shall have the ordinary meaning as understood by those skilled in the art to which this application belongs.
In addition, the terms "first" and "second", etc. are used to distinguish different objects, and are not used to describe a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Referring to fig. 1, which illustrates a flowchart of a two-dimensional graph generating method of concatenated structure data according to some embodiments of the present disclosure, as shown in fig. 1, the two-dimensional graph generating method of concatenated structure data may include the following steps:
step S101: acquiring cascade structure data, wherein the cascade structure data comprises node information corresponding to each node in a cascade structure, and the node information comprises transverse attribute information and longitudinal attribute information.
In the two-dimensional graph generating method provided by the embodiment of the present disclosure, the node information includes horizontal attribute information and vertical attribute information, which may represent different meanings.
Illustratively, in a specific application scenario, rows of the generated two-dimensional graph correspond to horizontal attribute information of nodes in the graph, and the horizontal attribute information may represent subdivided different age groups; and the columns of the generated two-dimensional graph correspond to the vertical attribute information of the nodes in the graph, and the vertical attribute information can represent the organization level of the subdivisions or the number level of the subdivisions.
Step S102: and determining an abscissa interval corresponding to each node according to the transverse attribute information of each node, wherein the abscissa interval corresponding to one node represents the cells occupied by the node in the corresponding row of the two-dimensional graph.
In a possible implementation manner, determining the abscissa interval corresponding to each node according to the transverse attribute information of each node includes the following steps:
performing depth-first traversal on the cascade structure to determine the node width of each node according to the transverse attribute information of each node in the cascade structure;
acquiring an initial abscissa of a root node in a cascade structure;
and determining the abscissa interval corresponding to each node in the cascade structure according to the initial abscissa of the root node and the node width of each node in the cascade structure.
In a possible implementation manner, the two-dimensional graph generating method provided in the embodiment of the present disclosure further includes the following steps:
determining the node width of the root node according to the node width of each node; and
and taking the node width of the root node as the transverse width of the graph to pre-configure the initial two-dimensional graph.
In a possible implementation manner, the process of determining the node width of each node is specifically as follows:
step a 1: performing depth-first traversal on the data;
step a 2: when the leaf node is reached, setting the width of the leaf node to be 1; returning to the upper node, and repeating the operation on the width + 1;
step a 3: by adopting the mode, the width of the root node is set, wherein the width of the root node is the width of the abscissa of the coordinate axis.
In a possible implementation manner, the process of calculating the node abscissa interval according to the node width is specifically as follows:
step b 1: performing depth-first traversal on the data;
step b 2: setting a horizontal axis coordinate interval of the current node: the initial coordinate is a parameter transmitted by an upper layer, the initial value is 1, and the termination coordinate is the initial coordinate + the node width. The coordinate interval is a set of horizontal cells occupied by the node.
Step b 3: the start coordinate is passed into the child node, for which the algorithm of step b2 described above is applied, up to the leaf node.
Step b 4: and after the calculation of the child nodes is finished, setting the initial coordinate as the initial coordinate plus the node width, and then calculating the adjacent nodes.
Step b 5: and finally, calculating the abscissa interval of the root node.
Step S103: and determining a longitudinal coordinate corresponding to each node according to the longitudinal attribute information of each node.
In one possible implementation, determining a vertical coordinate corresponding to each node according to the longitudinal attribute information of each node includes performing depth-first traversal on the cascade structure to:
determining a longitudinal coordinate corresponding to each node directly according to the longitudinal attribute information of each node; in this way, the vertical coordinate corresponding to each node can be quickly determined.
In one possible implementation, determining a vertical coordinate corresponding to each node according to the vertical attribute information of each node includes performing depth-first traversal on the cascade structure to:
the method comprises the steps of determining an initial longitudinal coordinate corresponding to each node according to longitudinal attribute information of each node, determining the layering number of a cascade structure according to the longitudinal attribute information of each node, and resetting the initial longitudinal coordinate corresponding to each node according to the layering data volume.
In a possible implementation manner, the process of determining the ordinate corresponding to each node is specifically as follows:
step c 1: performing depth-first traversal on the data;
step c 2: preliminarily setting the ordinate of the current node: the data is transmitted from the upper layer, when the data is transmitted into the child node, the +1 is used, the initial value is 1, and meanwhile, the layering number of the dimension value is recorded;
step c 3: resetting the longitudinal coordinate value according to the maximum layering quantity, and ensuring that each layer occupies one cell;
step c 4: returning to the upper node, and accumulating the layering quantity;
step c 5: and returning to the root node, and finishing the layering.
In a possible implementation manner, the two-dimensional graph generating method provided in the embodiment of the present disclosure further includes the following steps:
and pre-configuring an initial two-dimensional chart by taking the number of layers represented by the number of layers as the longitudinal width of the chart.
Step S104: and sequencing the nodes according to the vertical coordinates corresponding to each node to obtain a corresponding node sequence.
Step S105: and filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph according to the abscissa interval corresponding to each node to generate the two-dimensional graph of the cascade structure data, wherein the rows of the two-dimensional graph correspond to the transverse attribute information of the nodes in the table, and the columns of the two-dimensional graph correspond to the longitudinal attribute information of the nodes in the table.
The two-dimensional graph generation method provided in the embodiment of the present disclosure further includes the following steps:
and after filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph, generating blank nodes and filling the blank nodes into the rest blank cells in the two-dimensional graph.
In a possible implementation manner, the method for generating a two-dimensional graph of cascade structure data provided in the embodiment of the present disclosure further includes the following steps:
and outputting a two-dimensional chart so as to chart the cascade structure data.
Compared with the existing single display mode of the cascade structure data, the two-dimensional graph of the cascade structure data generated by the two-dimensional graph generation method provided by the embodiment of the disclosure can display more node attribute information through the transverse attribute information and the longitudinal attribute information.
Illustratively, in a specific application scenario, rows of the generated two-dimensional graph correspond to horizontal attribute information of nodes in the graph, and the horizontal attribute information may represent subdivided different age groups; and the columns of the generated two-dimensional graph correspond to the longitudinal attribute information of the nodes in the graph, and the longitudinal attribute information can represent the organization level of subdivision or the number level of subdivision.
Fig. 2 is a schematic diagram illustrating a conventional cascade structure data.
As shown in fig. 2, the conventional display method of the cascade structure data is too single to display more attribute information.
Fig. 3 is a schematic diagram of a two-dimensional graph generated by the method for generating a two-dimensional graph of cascade structure data in a specific application scenario according to an exemplary embodiment of the present disclosure.
In a practical application scenario, more attribute information of a node can be shown through a two-dimensional graph as shown in fig. 3.
Illustratively, in a specific application scenario, rows of the generated two-dimensional graph correspond to horizontal attribute information of nodes in the graph, and the horizontal attribute information may represent subdivided different age groups; and the columns of the generated two-dimensional graph correspond to the vertical attribute information of the nodes in the graph, and the vertical attribute information can represent the organization level of the subdivisions or the number level of the subdivisions.
Please refer to fig. 4, which illustrates a schematic diagram of a two-dimensional graph generating apparatus for cascading structure data according to some embodiments of the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
As shown in fig. 4, the two-dimensional graph generating apparatus 400 of cascade structure data may include:
an obtaining unit 401, configured to obtain cascade structure data, where the cascade structure data includes node information corresponding to each node in a cascade structure, and the node information includes horizontal attribute information and vertical attribute information;
a determining unit 402, configured to determine, according to the transverse attribute information of each node, an abscissa interval corresponding to each node, where the abscissa interval corresponding to one node represents a cell occupied by the node in a corresponding row of the two-dimensional graph; and
determining a longitudinal coordinate corresponding to each node according to the longitudinal attribute information of each node;
a sorting unit 403, configured to sort the nodes according to the ordinate corresponding to each node, to obtain a corresponding node sequence;
a filling unit 404, configured to fill the nodes in the node sequence to corresponding positions of the initial two-dimensional graph according to the abscissa interval corresponding to each node, so as to generate a two-dimensional graph of the cascade structure data, where rows of the two-dimensional graph correspond to the horizontal attribute information of the nodes in the table, and columns of the two-dimensional graph correspond to the longitudinal attribute information of the nodes in the table.
In some implementations of embodiments of the present disclosure, the apparatus 400 may further include:
and an output unit (not shown in fig. 4) for outputting a two-dimensional graph to graphically represent the cascade structure data.
In some implementations of embodiments of the present disclosure, the determining unit 402 is specifically configured to:
performing depth-first traversal on the cascade structure to determine the node width of each node according to the transverse attribute information of each node in the cascade structure;
acquiring an initial abscissa of a root node in a cascade structure;
and determining an abscissa interval corresponding to each node in the cascade structure according to the initial abscissa of the root node and the node width of each node in the cascade structure.
In some implementations of embodiments of the present disclosure, the determining unit 402 is further configured to:
determining the node width of the root node according to the node width of each node;
in some implementations of embodiments of the present disclosure, the apparatus 400 may further include:
a first configuration unit (not shown in fig. 4) for configuring the initial two-dimensional graph in advance with the node width of the root node as the graph lateral width.
In some implementations of embodiments of the present disclosure, the determining unit 402 is specifically configured to:
performing a depth-first traversal of the cascade structure to:
determining a longitudinal coordinate corresponding to each node directly according to the longitudinal attribute information of each node; or
The method comprises the steps of determining an initial longitudinal coordinate corresponding to each node according to longitudinal attribute information of each node, determining the layering number of a cascade structure according to the longitudinal attribute information of each node, and resetting the initial longitudinal coordinate corresponding to each node according to the layering data volume.
In some implementations of embodiments of the present disclosure, the apparatus 400 may further include:
and a second configuration unit (not shown in fig. 4) for pre-configuring the initial two-dimensional graph with the number of layers characterized by the number of layers as the longitudinal width of the graph.
In some implementations of embodiments of the present disclosure, the filling unit 404 is further configured to:
and after filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph, generating blank nodes and filling the blank nodes into the rest blank cells in the two-dimensional graph.
In some implementations of the embodiments of the present disclosure, the two-dimensional graph generating apparatus 400 provided in the embodiments of the present disclosure has the same advantages as the two-dimensional graph generating method provided in the previous embodiments of the present disclosure.
The embodiment of the present application further provides an electronic device corresponding to the two-dimensional graph generating method provided in the foregoing embodiment, where the electronic device may be an electronic device for a server, such as a server, and includes an independent server, a distributed server cluster, and the like, so as to execute the two-dimensional graph generating method; the electronic device may also be an electronic device for a client, such as a mobile phone, a notebook computer, a tablet computer, a desktop computer, and the like, to execute the two-dimensional graph generation method.
Please refer to fig. 5, which illustrates a schematic diagram of an electronic device according to some embodiments of the present application. As shown in fig. 5, the electronic device 50 includes: the system comprises a processor 500, a memory 501, a bus 502 and a communication interface 503, wherein the processor 500, the communication interface 503 and the memory 501 are connected through the bus 502; the memory 501 stores a computer program that can be executed on the processor 500, and the processor 500 executes the computer program to execute the two-dimensional graph generating method of the present application.
The Memory 501 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 503 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used.
The processor 500 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 500. The Processor 500 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present disclosure may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 501, and the processor 500 reads the information in the memory 501, and completes the steps of the method in combination with the hardware thereof.
The electronic equipment provided by the embodiment of the disclosure and the two-dimensional chart generation method provided by the embodiment of the disclosure are based on the same inventive concept, and have the same beneficial effects as the method adopted, operated or realized by the electronic equipment.
Referring to fig. 6, a computer-readable storage medium is shown as an optical disc 60, on which a computer program (i.e., a program product) is stored, and when the computer program is executed by a processor, the computer program executes the two-dimensional graph generating method.
It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory, or other optical and magnetic storage media, which are not described in detail herein.
The computer-readable storage medium provided by the above-mentioned embodiment of the present application and the two-dimensional graph generation method provided by the embodiment of the present disclosure are based on the same inventive concept, and have the same beneficial effects as methods adopted, run, or implemented by application programs stored in the computer-readable storage medium.
It should be noted that the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present disclosure, and the present disclosure should be construed as being covered by the claims and the specification.
Claims (11)
1. A two-dimensional graph generation method for cascade structure data comprises the following steps:
acquiring cascade structure data, wherein the cascade structure data comprises node information corresponding to each node in a cascade structure, and the node information comprises transverse attribute information and longitudinal attribute information;
determining an abscissa interval corresponding to each node according to the transverse attribute information of each node, wherein the abscissa interval corresponding to one node represents cells occupied by the node in a corresponding row of the two-dimensional graph;
determining a longitudinal coordinate corresponding to each node according to the longitudinal attribute information of each node;
sequencing the nodes according to the vertical coordinates corresponding to each node to obtain a corresponding node sequence;
and filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph according to the abscissa interval corresponding to each node to generate the two-dimensional graph of the cascade structure data, wherein the rows of the two-dimensional graph correspond to the transverse attribute information of the nodes in the table, and the columns of the two-dimensional graph correspond to the longitudinal attribute information of the nodes in the table.
2. The method of claim 1, further comprising:
outputting the two-dimensional graph for graph presentation of the cascade structure data.
3. The method of claim 1 or 2, wherein determining the abscissa interval corresponding to each node according to the lateral attribute information of each node comprises:
performing depth-first traversal on the cascade structure to determine the node width of each node according to the transverse attribute information of each node in the cascade structure;
acquiring an initial abscissa of a root node in the cascade structure;
and determining an abscissa interval corresponding to each node in the cascade structure according to the initial abscissa of the root node and the node width of each node in the cascade structure.
4. The method of claim 3, further comprising:
determining the node width of the root node according to the node width of each node; and
and pre-configuring the initial two-dimensional graph by taking the node width of the root node as the lateral width of the graph.
5. The method of claim 1 or 2, wherein determining the vertical coordinate corresponding to each node from the vertical attribute information of each node comprises performing a depth-first traversal of the cascaded structure to:
determining a longitudinal coordinate corresponding to each node directly according to the longitudinal attribute information of each node; or
Determining an initial longitudinal coordinate corresponding to each node according to the longitudinal attribute information of each node, determining the layering number of the cascade structure according to the longitudinal attribute information of each node, and resetting the initial longitudinal coordinate corresponding to each node according to the layering data volume.
6. The method of claim 5, further comprising:
and pre-configuring the initial two-dimensional graph by taking the number of layers represented by the layering number as the longitudinal width of the graph.
7. The method of claim 1, further comprising:
and after filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph, generating blank nodes and filling the blank nodes into the rest blank cells in the two-dimensional graph.
8. A two-dimensional chart generating apparatus of cascade structure data, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring cascade structure data, the cascade structure data comprises node information corresponding to each node in a cascade structure, and the node information comprises transverse attribute information and longitudinal attribute information;
the determining unit is used for determining an abscissa interval corresponding to each node according to the transverse attribute information of each node, wherein the abscissa interval corresponding to one node represents cells occupied by the node in a corresponding row of the two-dimensional graph; and
determining a longitudinal coordinate corresponding to each node according to the longitudinal attribute information of each node;
the sorting unit is used for sorting the nodes according to the vertical coordinates corresponding to each node to obtain a corresponding node sequence;
and the filling unit is used for filling the nodes in the node sequence to the corresponding positions of the initial two-dimensional graph according to the abscissa interval corresponding to each node so as to generate the two-dimensional graph of the cascade structure data, wherein the rows of the two-dimensional graph correspond to the transverse attribute information of the nodes in the table, and the columns of the two-dimensional graph correspond to the longitudinal attribute information of the nodes in the table.
9. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is used for reading the executable instructions from the memory and executing the executable instructions to realize the method of any one of the claims 1 to 7.
10. A computer-readable storage medium, characterized in that it stores a computer program for performing the method of any of the preceding claims 1 to 7.
11. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210373391.6A CN114925127A (en) | 2022-04-11 | 2022-04-11 | Two-dimensional graph generation method and device for cascade structure data and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210373391.6A CN114925127A (en) | 2022-04-11 | 2022-04-11 | Two-dimensional graph generation method and device for cascade structure data and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114925127A true CN114925127A (en) | 2022-08-19 |
Family
ID=82804979
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210373391.6A Withdrawn CN114925127A (en) | 2022-04-11 | 2022-04-11 | Two-dimensional graph generation method and device for cascade structure data and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114925127A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116188622A (en) * | 2022-12-08 | 2023-05-30 | 北京国电通网络技术有限公司 | Power index information display method and device, electronic equipment and computer medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102103587A (en) * | 2009-12-17 | 2011-06-22 | 北大方正集团有限公司 | Method and device for converting form |
CN107885713A (en) * | 2017-11-28 | 2018-04-06 | 广州视源电子科技股份有限公司 | File layout change-over method, device, equipment and storage medium |
CN113094288A (en) * | 2021-05-18 | 2021-07-09 | 绿漫科技有限公司 | Method for converting mind map into test case based on Xmind |
CN113468003A (en) * | 2021-06-18 | 2021-10-01 | 上海芷锐电子科技有限公司 | Tree-shaped display and operation system and method for chip test data |
-
2022
- 2022-04-11 CN CN202210373391.6A patent/CN114925127A/en not_active Withdrawn
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102103587A (en) * | 2009-12-17 | 2011-06-22 | 北大方正集团有限公司 | Method and device for converting form |
CN107885713A (en) * | 2017-11-28 | 2018-04-06 | 广州视源电子科技股份有限公司 | File layout change-over method, device, equipment and storage medium |
CN113094288A (en) * | 2021-05-18 | 2021-07-09 | 绿漫科技有限公司 | Method for converting mind map into test case based on Xmind |
CN113468003A (en) * | 2021-06-18 | 2021-10-01 | 上海芷锐电子科技有限公司 | Tree-shaped display and operation system and method for chip test data |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116188622A (en) * | 2022-12-08 | 2023-05-30 | 北京国电通网络技术有限公司 | Power index information display method and device, electronic equipment and computer medium |
CN116188622B (en) * | 2022-12-08 | 2023-09-12 | 北京国电通网络技术有限公司 | Power index information display method and device, electronic equipment and computer medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109614372B (en) | Object storage and reading method and device and service server | |
CN109086126B (en) | Task scheduling processing method and device, server, client and electronic equipment | |
CN104243590A (en) | Resource object recommendation method and device | |
CN110728123A (en) | Report generation method, system and related equipment | |
CN114925127A (en) | Two-dimensional graph generation method and device for cascade structure data and storage medium | |
CN111158650A (en) | Report template, report template and report generation method and device | |
CN112000630B (en) | Log storage method, device, equipment and readable storage medium | |
CN116185545A (en) | Page rendering method and device | |
CN115311399A (en) | Image rendering method and device, electronic equipment and storage medium | |
CN115935917A (en) | Data processing method, device and equipment for visual chart and storage medium | |
CN109144624B (en) | Method, storage medium, device and system for displaying unequal height lists in IOS | |
CN113112084B (en) | Training plane rear body research and development flow optimization method and device | |
CN115794641A (en) | Method, device and equipment for making number based on business process and storage medium | |
CN110992443B (en) | Business flow chart construction method and device and computer readable storage medium | |
CN113377652A (en) | Test data generation method and device | |
CN111228815B (en) | Method, apparatus, storage medium and system for processing configuration table of game | |
CN114662689A (en) | Pruning method, device, equipment and medium for neural network | |
CN114115864A (en) | Interface generation method and device and electronic equipment | |
CN109544664B (en) | Animation data processing method and device, electronic equipment and readable storage medium | |
CN113361220A (en) | Verification environment construction method and device for automatically cutting integrated circuit design | |
CN112463785A (en) | Data quality monitoring method and device, electronic equipment and storage medium | |
CN116150212B (en) | Data processing method and device | |
CN117171211A (en) | Method and related device for acquiring nested paths of bill of materials | |
CN112825567B (en) | Method and system for rapidly displaying broadcast service coverage of positioning system | |
CN108132946B (en) | Serialized data display method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20220819 |