Data relationship display method and device, storage medium and equipment
By parsing the target program code to generate a data relationship diagram, the problem of unclear data production and processing procedures and storage locations in existing technologies is solved, thereby improving the level of data management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, it is difficult to clearly express the data production and processing process and storage location by interpreting program code, and the dependencies between data are unclear.
By parsing the target program code, the data processing nodes and data flow direction are determined, and a data relationship diagram is generated to clearly express the data production and processing process and storage location.
It improves data management and clearly expresses the data production and processing process, storage location, and dependencies between data.
Smart Images

Figure CN116088931B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification relates to the technical field of computer, and particularly relates to a data relationship display method and device, a storage medium and equipment. BACKGROUND
[0002] With the progress of society and the development of technology, technology gradually penetrates into all aspects of people's life. Technology surrounds all aspects of people's life and produces a large amount of data records every day, which records user behavior through data.
[0003] For some data with important use, it is necessary to clearly express the production and processing process and storage location of the data, and the production and processing and storage of the data are mainly realized through the program code written, and it is relatively inconvenient to obtain the data production and processing process and storage location by interpreting the corresponding program code. The program code cannot clearly express the processing logic of the data and the dependency relationship between the data. SUMMARY
[0004] The data relationship display method, device, storage medium and equipment provided by the embodiments of the present specification can clearly express the production and processing process of the data, the storage location of the data and the dependency relationship between the data by analyzing the target program code based on the code syntax of the target program code and generating the data relationship graph corresponding to the target program code. The technical solution is as follows:
[0005] In a first aspect, the embodiments of the present specification provide a data relationship display method, and the method comprises:
[0006] obtaining a target program code;
[0007] code parsing the target program code based on the code syntax corresponding to the target program code, determining each data processing node in the target program code and the data flow direction between each data processing node;
[0008] based on the data flow direction, sequentially connecting each data processing node by using a data flow direction edge to generate a data relationship graph corresponding to the target program code.
[0009] In a second aspect, the embodiments of the present specification provide a data relationship display device, and the device comprises:
[0010] a code obtaining module configured to obtain a target program code;
[0011] a code parsing module configured to code parse the target program code based on the code syntax corresponding to the target program code, and determine each data processing node in the target program code and the data flow direction between each data processing node;
[0012] A relationship graph generation module is configured to sequentially connect each data processing node by using a data flow direction edge based on the data flow direction, and generate a data relationship graph corresponding to the target program code.
[0013] In a third aspect, a computer program product is provided, which stores at least one instruction suitable for being loaded by a processor and performing the method steps described above.
[0014] In a fourth aspect, a storage medium is provided, which stores a computer program suitable for being loaded by a processor and performing the method steps described above.
[0015] In a fifth aspect, an electronic device is provided, which can include a processor and a memory, wherein the memory stores a computer program suitable for being loaded by the processor and performing the method steps described above.
[0016] The technical solutions provided by some embodiments of the present specification have at least the following beneficial effects:
[0017] The data relationship display method provided by the embodiments of the present specification first acquires a target program code, then performs code analysis on the target program code based on the code syntax corresponding to the target program code to determine each data processing node in the target program code and the data flow direction between each data processing node, and finally sequentially connects each data processing node by using a data flow direction edge based on the data flow direction to generate a data relationship graph corresponding to the target program code. The data relationship graph can clearly express the production and processing process of the target program code on data, the data storage location, and the dependency relationship between data, thereby improving the management level of data. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present specification, and those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0019] Figure 1 A flowchart of a data relationship display method provided by an embodiment of the present specification;
[0020] Figure 2 A flowchart of a data relationship display method provided by an embodiment of the present specification;
[0021] Figure 3An example schematic diagram of a storage node provided for an embodiment of the present specification;
[0022] Figure 4 An example schematic diagram of a logical operation node pattern provided for an embodiment of the present specification;
[0023] Figure 5 A flowchart of a data relationship display method provided for an embodiment of the present specification;
[0024] Figure 6 An example schematic diagram of a sub-code display provided for an embodiment of the present specification;
[0025] Figure 7 An example schematic diagram of a data relationship diagram provided for an embodiment of the present specification;
[0026] Figure 8 A flowchart of a data relationship display method provided for an embodiment of the present specification;
[0027] Figure 9 An example schematic diagram of a data relationship diagram provided for an embodiment of the present specification;
[0028] Figure 10 A structural schematic diagram of a data relationship display device provided for an embodiment of the present specification;
[0029] Figure 11 A structural schematic diagram of a code analysis module provided for an embodiment of the present specification;
[0030] Figure 12 A structural schematic diagram of a data relationship display device provided for an embodiment of the present specification
[0031] Figure 13 A structural block diagram of an electronic device provided for an embodiment of the present specification. DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present specification will be described clearly and completely below with reference to the drawings in the embodiments of the present specification. Obviously, the described embodiments are only part of the embodiments of the present specification, rather than all the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present specification.
[0033] In the description of the present specification, it is understood that the terms "first", "second" and the like are only for the purpose of description and cannot be understood as indicating or implying relative importance. In the description of the present specification, it is necessary to explain that "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units not listed, or optionally includes other steps or units inherent to the process, method, product or device. The specific meaning of the above terms in the present specification can be understood by the person skilled in the art. In addition, in the description of the present specification, "a plurality of" means two or more, unless otherwise specified. The association relationship of the associated objects is described, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.
[0034] The embodiments in the present specification will be described in detail below. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. On the contrary, they are only examples of devices and methods consistent with some aspects of the present specification as detailed in the appended claims. The flowchart shown in the accompanying drawings is only an exemplary description and is not necessarily performed in the order shown. For example, some steps are parallel and there is no strict logical sequence, so the actual execution order is variable.
[0035] Please refer to Figure 1 , a flowchart of a data relationship display method provided in an embodiment of the present specification. In the embodiments of the present specification, the data relationship display method is applied to a data relationship display device or an electronic device configured with a data relationship display device. The following will be described in detail with respect to the flowchart shown in Figure 1 The data relationship display method can specifically include the following steps:
[0036] S102, obtaining target program code;
[0037] In the embodiments of the present specification, the target program code is a program code with a purpose, which is a program code for data processing to obtain certain data, and is a program code written by a program engineer to realize a certain function and obtain certain data.
[0038] The target program code can be a program code in any programming language, including but not limited to Python language code, C language code, C++ language code, structured query language code, and Java language code.
[0039] It should be noted that in the embodiments of the present specification, data not only refers to digital data with digital meaning, but also can be text data with literal meaning, and data can be used to represent numerical values, symbols, identifiers, conditions, etc. For example, a student transcript includes student name, student ID, student performance, and other data.
[0040] In S104, code parsing is performed on the target program code based on the code syntax corresponding to the target program code, to determine each data processing node in the target program code and the data flow direction between the data processing nodes.
[0041] In the embodiments of the present specification, after obtaining the target program code, code parsing is performed on the target program code based on the code syntax of the target program code, to determine the code function and data processing flow of the target program code, and to determine each data processing node in the data processing flow and the relationship and data flow direction between the data processing nodes.
[0042] The data processing node is a processing node for data acquisition, data storage, data operation, etc. of the target program code. The data flow direction is used to represent the data flow relationship between the data processing nodes.
[0043] For example, the target program code can be program code for obtaining the maximum value data from a plurality of data. Based on the code syntax of the target program code, three data processing operation steps can be parsed from the target program code: first, obtaining a plurality of data from a storage location of the plurality of data, then performing a maximum value taking logical operation on the plurality of data to obtain the maximum value data, and finally storing the obtained maximum value data in a specified location. The above three data processing operation steps correspond to three data processing nodes, and the data flow direction between them is: the plurality of data storage nodes flow to the maximum value taking logical operation node, and finally flow to the maximum value data storage node.
[0044] In an embodiment of the present specification, the data processing node can be represented by a corresponding node pattern.
[0045] In an embodiment of the present specification, the data processing node includes a storage node and a logical operation node. After obtaining the target program code, code parsing is performed on the target program code based on the code syntax corresponding to the target program code, to determine the data storage code, the logical operation code, and the data flow direction in the target program code. Based on the data storage code and the node pattern corresponding to the storage node, the storage node is generated. Based on the logical operation code and the node pattern corresponding to the logical operation node, the logical operation node is generated.
[0046] In an embodiment of the present disclosure, after the data storage code is obtained by data parsing of the target program code based on the code syntax, the target data corresponding to the data storage code and the storage information corresponding to the target data are extracted based on the code syntax, and the target data storage node is generated based on the target data, the storage information corresponding to the target data, and the node pattern corresponding to the storage node.
[0047] The data storage code is program code used to perform a data storage action. The logic operation code is program code used to perform a logic operation on data, including but not limited to function operation, association operation, filtering operation, combination operation, and decomposition operation.
[0048] It can be understood that each programming language has a fixed code syntax, and the target program code is obtained by a program engineer based on the code syntax. Based on the code syntax, the target program code can be parsed to determine which is the data storage code and which is the logic operation code.
[0049] In an embodiment of the present disclosure, after the logic operation code is obtained by data parsing of the target program code based on the code syntax, the logic operation flow corresponding to the target data is obtained by parsing and processing the logic operation code based on the code syntax, and the logic operation node corresponding to the logic operation flow is generated based on the logic operation flow and the node pattern corresponding to the logic operation node.
[0050] In an embodiment of the present disclosure, after the logic operation code is obtained by data parsing of the target program code based on the code syntax, the logic operation code corresponding to the target data is obtained by data parsing of the target program code based on the code syntax, and the logic operation flow corresponding to the target data is obtained by parsing and processing the logic operation code based on the code syntax, and the logic operation node corresponding to the logic operation flow is generated based on the logic operation flow and the node pattern corresponding to the logic operation node.
[0051] It should be noted that the data processing process is also a process of performing logic operation processing on one type of data to obtain another type of data. In some scenarios, in the process of performing logic operation processing on one type of data to obtain another type of data, not only one type of data is used for logic operation, but also other data is called to participate in the logic operation process. Such data is used as dependent data, and the corresponding dependent data and the storage information corresponding to the dependent data are extracted from the logic operation code to generate the dependent data storage node.
[0052] S106, based on the data flow, sequentially connecting each data processing node using a data flow edge to generate a data relationship graph corresponding to the target program code.
[0053] In the embodiment of the present specification, after code parsing of the target program code based on the code syntax of the target program code is performed, each data processing node and data flow direction in the target program code are obtained, based on the data flow direction, each data processing node is connected in the order indicated by the data flow direction by using the data flow direction edge, and a data relationship graph corresponding to the target program code is generated by the connection, wherein the data processing node can be represented by a corresponding node image.
[0054] In the embodiment of the present specification, first, the target program code is obtained, then the target program code is code parsed based on the code syntax corresponding to the target program code to determine each data processing node and the data flow direction between each data processing node in the target program code, and finally, based on the data flow direction, each data processing node is sequentially connected by using the data flow direction edge to generate a data relationship graph corresponding to the target program code. The data production and processing process of the target program code, the data storage location, and the dependency relationship between data can be clearly expressed through the data relationship graph, and the management level of data is improved.
[0055] Please refer to Figure 2 The flowchart of a data relationship display method provided in the embodiment of the present specification can include the following steps:
[0056] S202, obtaining a target program code;
[0057] In the embodiment of the present specification, the target program code is a program code with a purpose, which is used for data processing of a certain data, and is a program code written by a program engineer to realize a certain function and obtain a certain data.
[0058] The target program code can be a program code in any programming language, including but not limited to Python language code, C language code, C++ language code, structured query language code, and Java language code.
[0059] S204, code parsing of the target program code based on the code syntax corresponding to the target program code to determine data storage code, logical operation code, and data flow direction in the target program code;
[0060] In the embodiment of the present specification, after the target program code is obtained, the target program code is code parsed according to the code syntax corresponding to the target program code to determine the data storage code, the logical operation code, and the data flow direction in the target program code.
[0061] The data storage code is a program code used for performing a data storage action. The logical operation code is a program code used for performing a logical operation on data, and the logical operation includes but is not limited to function operation, association operation, filtering operation, combination operation, and decomposition operation.
[0062] It can be understood that each programming language has a fixed code syntax, and the target program code is obtained by a program engineer based on the code syntax for code programming. Based on the code syntax, the target program code can be parsed to determine which is the data storage code and which is the logic operation code.
[0063] In S206, a storage node is generated based on the data storage code and the node pattern corresponding to the storage node.
[0064] In an embodiment of the present specification, the node pattern is a preset pattern type, and the storage node of the target data is generated according to the target data stored by the data storage code and the storage information corresponding to the target data, and the node pattern corresponding to the preset storage node.
[0065] In an embodiment of the present specification, the target data corresponding to the data storage code and the storage information corresponding to the target data are extracted based on the code syntax of the target program code, and the target data storage node is generated based on the target data, the storage information corresponding to the target data, and the node pattern corresponding to the storage node.
[0066] The storage information can be storage location information of the target data.
[0067] It should be noted that the target program code can include multiple data storage codes, and each data storage code is used to store the corresponding target data. It is not difficult to understand that the process of the target program code for data processing and obtaining the final result data is not a one-time process, but a step-by-step and phased continuous data processing process, and there are many intermediate data to be stored in the process. Therefore, the target program code includes multiple data storage codes.
[0068] In an embodiment of the present specification, according to each data storage code in the execution process of the target program code, the sub-code corresponding to the target data corresponding to each data storage code is extracted from the target program code, and the sub-code is used to represent how the target data corresponding to the data storage code is generated. That is, the sub-code corresponding to the target data is extracted from the target program code based on the code syntax, and the sub-code is a code representing the generation process of the target data, and the target data storage node is generated based on the target data, the sub-code, the storage information corresponding to the target data, and the node pattern corresponding to the storage node.
[0069] Please refer to Figure 3 , an example schematic diagram of a storage node provided in an embodiment of the present specification. As Figure 3 shown, the storage node includes storage information such as storage location and storage directory of the target data.
[0070] S208, generating the logic operation node based on the logic operation code and the node pattern corresponding to the logic operation node;
[0071] In the embodiments of the present specification, the node pattern is a preset pattern type, and the logic operation node is generated according to the logic operation code and the node pattern corresponding to the logic operation code. The logic operation includes but is not limited to function operation, correlation operation, filtering operation, combination operation, and decomposition operation, and each kind of logic operation corresponds to a predefined node pattern. Please refer to Figure 4 An example of a logic operation node pattern provided in the embodiments of the present specification is shown in the following figure.
[0072] It can be understood that the data processing process is also a process of performing logic operation processing on one kind of data to obtain another kind of data, and the logic operation node can be used to represent the processing flow of the data logic operation processing.
[0073] In an embodiment of the present specification, the logic operation code is parsed based on the code syntax of the target program code to obtain the logic operation flow corresponding to the target data, and the logic operation node corresponding to the logic operation flow is generated according to the parsed logic operation flow and the node pattern corresponding to the predefined logic operation node.
[0074] It can be understood that each kind of logic operation node corresponds to a node pattern, and by parsing the logic operation code, the logic operation flow corresponding to the logic operation code can be determined, and the logic operation flow includes each logic operation operation, each kind of logic operation operation corresponds to a logic operation node, and the logic operation node is generated by obtaining the node pattern corresponding to each logic operation node.
[0075] S210, based on the data flow direction, the storage nodes and the logic operation nodes are sequentially connected by using the data flow direction edge to generate the data relationship graph corresponding to the target program code.
[0076] In the embodiments of the present specification, after the code syntax of the target program code is parsed based on the code syntax of the target program code to obtain each storage node, each logic operation node and the data flow direction in the target program code, the storage nodes and the logic operation nodes are sequentially connected according to the indication of the data flow direction by using the data flow direction edge to generate the data relationship graph corresponding to the target program code.
[0077] Optionally, in an embodiment of the present specification, after the code syntax of the target program code is parsed to obtain the logic operation code, the dependent data corresponding to the target data in the logic operation code and the storage information corresponding to the dependent data are obtained, and the dependent data storage node is generated based on the dependent data, the storage information corresponding to the dependent data and the node pattern corresponding to the storage node.
[0078] It should be noted that the data processing process is also the process of obtaining another data by performing logical operation on a data. In some scenarios, in the process of generating another data by performing logical operation on a data, not only a type of data is relied on for logical operation, other data also needs to be called to participate in the logical operation process, and the data is taken as dependent data. The corresponding dependent data and the storage information corresponding to the dependent data are extracted from the logical operation code to generate a dependent data storage node.
[0079] The data relationship graph corresponding to the target program code is generated by sequentially connecting the storage nodes and the logical operation nodes by using the data flow direction edges based on the data flow direction, including:
[0080] The data relationship graph corresponding to the target program code is generated by sequentially connecting the target data storage node, the dependent data storage node and the logical operation node by using the data flow direction edges based on the data flow direction.
[0081] The generated data relationship graph not only includes each target data storage node extracted according to the code syntax, but also includes dependent data in the logical operation process extracted from the logical operation code, and generates a dependent data storage node, which enriches the data relationship graph and clearly shows the dependency relationship of each other data in the target data generation process.
[0082] In the embodiments of the present specification, first, the target program code is obtained, then the target program code is parsed based on the code syntax corresponding to the target program code, the data storage code, the logical operation code and the data flow direction in the target program code are determined, the storage nodes are generated based on the node pattern corresponding to the data storage code and the storage node, the logical operation nodes are generated based on the node pattern corresponding to the logical operation code and the logical operation node, and finally the data relationship graph corresponding to the target program code is generated by sequentially connecting the storage nodes and the logical operation nodes by using the data flow direction edges based on the data flow direction. The production and processing process of the target program code on the data, the data storage position and the dependency relationship between the data can be clearly expressed through the data relationship graph, and the management level of the data is improved.
[0083] Please refer to Figure 5 The flowchart of a data relationship display method provided in the embodiments of the present specification can include the following steps:
[0084] S302, obtaining a target program code;
[0085] In the embodiments of the present disclosure, the target program code is program code with a purpose and performing data processing to obtain certain data, and is program code written by a program engineer to realize a certain function and obtain certain data.
[0086] In S304, code analysis is performed on the target program code based on the code syntax corresponding to the target program code, and data storage code, logic operation code and data flow in the target program code are determined.
[0087] In the embodiments of the present disclosure, S304 can refer to the detailed description of S204 in another embodiment of the present disclosure, and will not be described here.
[0088] In S306, target data corresponding to the data storage code and storage information corresponding to the target data are extracted based on the code syntax.
[0089] In the embodiments of the present disclosure, the data storage code is program code for storing target data generated by performing logic operation processing, and the target data corresponding to the data storage code and the storage information corresponding to the target data are extracted based on the code syntax. The storage information is storage location information of the target data.
[0090] In S308, sub-code corresponding to the target data is extracted from the target program code based on the code syntax, and the sub-code is code representing the generation process of the target data.
[0091] It should be noted that the target program code can include multiple data storage codes, and each data storage code is used to store corresponding target data. It is not difficult to understand that the process of the target program code in data processing and obtaining the final result data is not completed at one time, but needs to be continued in steps and stages, and many intermediate data need to be stored in the process, so the target program code includes multiple data storage codes.
[0092] In S310, a target data storage node is generated based on the target data, the sub-code, the storage information corresponding to the target data, and the node pattern corresponding to the storage node.
[0093] In the embodiments of the present disclosure, the sub-code corresponding to the target data corresponding to each data storage code in the target program code is extracted from the target program code according to the data storage code in the execution process of the target program code. The sub-code is used to represent how the target data corresponding to the data storage code is generated. That is, the sub-code corresponding to the target data is extracted from the target program code based on the code syntax, the sub-code is code representing the generation process of the target data, and the target data storage node is generated based on the target data, the sub-code, the storage information corresponding to the target data, and the node pattern corresponding to the storage node.
[0094] The target data storage node includes a sub-code corresponding to the target data, and the sub-code can be used to view how the target data is generated.
[0095] In an embodiment of the present specification, after the data relationship graph is generated, in response to a selection instruction of the detailed description component in the target data storage node, the sub-code is displayed through a floating window.
[0096] Referring to Figure 6 An example of sub-code display provided by an embodiment of the present specification is shown in FIG. 6. As shown in FIG. 6, the target data storage node includes a detailed description component, and when the user triggers a selection instruction of the detailed description component, the sub-code corresponding to the target data is displayed in a blank area.
[0097] S312, the logic operation code is parsed and processed based on the code syntax, and a logic operation flow corresponding to the target data is obtained;
[0098] S314, a logic operation node corresponding to the logic operation flow is generated based on the logic operation flow and a node pattern corresponding to the logic operation node;
[0099] In an embodiment of the present specification, steps S312-S314 refer to the detailed description of step S208 in another embodiment of the present specification, and will not be described here.
[0100] S316, the dependent data corresponding to the target data in the logic operation code and the storage information corresponding to the dependent data are obtained;
[0101] S318, a dependent data storage node is generated based on the dependent data, the storage information corresponding to the dependent data, and a node pattern corresponding to the storage node;
[0102] It should be noted that the data processing process is also a process of performing logic operation processing on one type of data to obtain another type of data. In some scenarios, in the process of performing logic operation processing on one type of data to obtain another type of data, not only one type of data is used for logic operation, but also other data is called to participate in the logic operation process. The data is used as dependent data, the corresponding dependent data and the storage information corresponding to the dependent data are extracted from the logic operation code, and the dependent data storage node is generated.
[0103] S320, based on the data flow direction, the target data storage node, the dependent data storage node, and the logic operation node are sequentially connected by using a data flow direction edge to generate a data relationship graph corresponding to the target program code.
[0104] The generated data relationship diagram includes not only the target data storage nodes extracted according to the code syntax, but also the dependent data in the logical operation process extracted from the logical operation code, and a dependent data storage node is generated, thereby enriching the data relationship diagram and enabling the dependent relationship of the target data to other data in the target data generation process to be more clearly displayed.
[0105] Please refer to Figure 7 An example of a data relationship diagram provided in an embodiment of the present specification is shown in FIG. 7. As shown, the data relationship diagram shows that target data 1 is obtained through logical operation to obtain target data 2, the target data 1 is stored in the storage library 1 under the directory 1, the dependent data is stored in the storage library 1 under the directory 3, the target data 2 is stored in the storage library 2 under the directory 2, the target data 1 and the dependent data after the function operation are associated, and then the obtained data is filtered to obtain the target data 2.
[0106] In an embodiment of the present specification, first, the target program code is acquired, then the code syntax corresponding to the target program code is parsed based on the target program code to determine the data storage code, the logical operation code and the data flow in the target program code, then the target data corresponding to the data storage code, the storage information of the target data, the sub-code corresponding to the target data are determined, the target data storage node is generated based on the target data, the storage information of the target data, the sub-code corresponding to the target data and the node pattern corresponding to the storage node, the logical operation node is generated based on the logical operation code and the node pattern corresponding to the logical operation node, the dependent data in the logical operation code is acquired, and the dependent data storage node is generated, and finally, the target program code corresponding data relationship diagram is generated by sequentially connecting the target data storage node, the dependent data storage node and the logical operation node using the data flow edge based on the data flow. The production and processing process of the data of the target program code, the data storage location and the dependent relationship between the data can be clearly expressed through the data relationship diagram, the management level of the data is improved, and the target data storage node includes the sub-code corresponding to the target data, which can facilitate relevant personnel to view the generation logic of the target data.
[0107] Please refer to Figure 8 A flowchart of a data relationship display method provided in an embodiment of the present specification is shown. The data relationship display method can specifically include the following steps:
[0108] S402, acquiring the target program code;
[0109] In an embodiment of the present specification, the target program code is a program code with a purpose, which is a program code for data processing to obtain certain data, and is a program code written by a program engineer to achieve a certain function and obtain certain data.
[0110] S404, code parsing is performed on the target program code based on a code syntax corresponding to the target program code, to determine each data processing node in the target program code and a data flow direction between the data processing nodes;
[0111] In the embodiments of the present specification, step S404 can refer to the detailed description of step S104 in another embodiment of the present specification, and will not be described here again.
[0112] S406, text annotations respectively corresponding to each data processing node are extracted from the target program code based on the code syntax;
[0113] In the embodiments of the present specification, based on the code, the target program code is parsed to obtain each data processing node in the target program code, and at the same time, text annotations respectively corresponding to each data processing node are extracted from the target program code.
[0114] The text annotations are text explanations of the data processing nodes, which can assist relevant personnel in understanding the meaning of the data processing nodes or the relationship between the data.
[0115] Optionally, the text annotations can be automatically generated text annotations based on the data processing nodes, or code segments extracted from the target program code.
[0116] S408, the text annotations respectively corresponding to each data processing node are added to the corresponding data processing node respectively, to obtain each data processing annotation node;
[0117] In the embodiments of the present specification, the text annotations are added to the corresponding data processing nodes respectively, to obtain each data processing annotation node.
[0118] S410, based on the data flow direction, each data processing annotation node is sequentially connected by using a data flow direction edge, to generate a data relationship diagram corresponding to the target program code.
[0119] In one embodiment of the present specification, text annotations can also be added to each data flow direction edge, so that the data flow in the data relationship diagram is clearer.
[0120] Please refer to Figure 9This is an example diagram illustrating a data relationship diagram provided in an embodiment of this specification. As shown in Figure 9, the diagram illustrates the data relationship between target data 1 and target data 2 obtained through logical operations. Target data 1 is stored in directory 1 of repository 1, dependent data is stored in directory 3 of repository 1, and target data 2 is stored in directory 2 of repository 2. Target data 1 and dependent data after function operations are correlated, and then the resulting data is filtered to obtain target data 2. Each data processing node in the data relationship diagram includes corresponding text annotations, which can assist relevant personnel in understanding the meaning of the data processing nodes or the relationships between data.
[0121] In the embodiments of this specification, the target program code is first obtained, and then the target program code is parsed based on the code syntax corresponding to the target program code to determine each data processing node in the target program code and the data flow between each data processing node. Text comments corresponding to each data processing node are extracted from the target program code and added to the corresponding data processing node to generate data processing comment nodes. Finally, based on the data flow, each data processing comment node is sequentially connected using data flow edges to generate a data relationship graph corresponding to the target program code. The data relationship graph can clearly express the data production and processing process of the target program code, the data storage location, and the dependencies between data, thereby improving the level of data management.
[0122] Please see Figure 10 This is a schematic diagram of the structure of a data relationship display device provided in an embodiment of this specification. Figure 10 As shown, the data relationship display device 1 can be implemented as all or part of an electronic device through software, hardware, or a combination of both. According to some embodiments, the data relationship display device 1 includes a code acquisition module 11, a code parsing module 12, and a relationship diagram generation module 13, specifically including:
[0123] Code acquisition module 11 is used to acquire the target program code;
[0124] The code parsing module 12 is used to parse the target program code based on the code syntax corresponding to the target program code, and determine each data processing node in the target program code and the data flow between each data processing node;
[0125] The relationship graph generation module 13 is used to generate a data relationship graph corresponding to the target program code by sequentially connecting each data processing node with data flow edges based on the data flow direction.
[0126] Optional, please see Figure 11 This is a schematic diagram of the structure of a code parsing module provided in an embodiment of this specification.Figure 11 As shown, the code parsing module 12 comprises:
[0127] The code parsing unit 121 is configured to perform code parsing on the target program code based on a code syntax corresponding to the target program code, and determine data storage code, logic operation code and data flow in the target program code.
[0128] The storage node generation unit 122 is configured to generate a storage node based on the data storage code and a node pattern corresponding to the storage node.
[0129] The operation node generation unit 123 is configured to generate a logic operation node based on the logic operation code and a node pattern corresponding to the logic operation node.
[0130] Optionally, the relationship graph generation module 13 is specifically configured to:
[0131] Based on the data flow, the storage node and the logic operation node are sequentially connected by using a data flow edge to generate a data relationship graph corresponding to the target program code.
[0132] Optionally, the storage node generation unit is specifically configured to:
[0133] Based on the code syntax, a target data corresponding to the data storage code and storage information corresponding to the target data are extracted.
[0134] Based on the target data, the storage information corresponding to the target data and a node pattern corresponding to the storage node, a target data storage node is generated.
[0135] Optionally, the operation node generation unit is specifically configured to:
[0136] Based on the code syntax, the logic operation code is parsed to obtain a logic operation flow corresponding to the target data.
[0137] Based on the logic operation flow and a node pattern corresponding to the logic operation node, a logic operation node corresponding to the logic operation flow is generated.
[0138] Optionally, the operation node generation unit is further configured to:
[0139] Obtain dependent data corresponding to the target data in the logic operation code and storage information corresponding to the dependent data.
[0140] Based on the dependent data, the storage information corresponding to the dependent data and a node pattern corresponding to the storage node, a dependent data storage node is generated.
[0141] Optionally, the relationship graph generation module is further configured to:
[0142] Based on the data flow direction, the target data storage node, the dependent data storage node and the logical operation node are sequentially connected by using data flow direction edges to generate a data relationship graph corresponding to the target program code.
[0143] Optionally, the storage node generation unit is further configured to:
[0144] Based on the code syntax, a sub-code corresponding to the target data is extracted from the target program code, and the sub-code is a code representing a target data generation process;
[0145] Based on the target data, the sub-code, the storage information corresponding to the target data and the node pattern corresponding to the storage node, a target data storage node is generated.
[0146] Optionally, please refer to Figure 12 A structural schematic diagram of a data relationship display device provided by an embodiment of the present disclosure is shown in FIG. 1. As shown in FIG. 1, the data relationship display device further comprises: Figure 12
[0147] The sub-code display module 14 is configured to display the sub-code in the form of a floating window in response to a selection instruction of a detailed description component in the target data storage node.
[0148] Optionally, as shown in FIG. 2, the data relationship display device further comprises: Figure 12
[0149] The annotation generation module 15 is configured to extract a text annotation corresponding to each data processing node from the target program code based on the code syntax.
[0150] Optionally, the relationship graph generation module is further configured to:
[0151] Each text annotation corresponding to each data processing node is added to the corresponding data processing node to obtain each data processing annotation node.
[0152] Based on the data flow direction, the target data storage node, the dependent data storage node and the logical operation node are sequentially connected by using data flow direction edges to generate a data relationship graph corresponding to the target program code.
[0153] In the embodiment of the present application, first, the target program code is acquired, then the code syntax corresponding to the target program code is used to parse the target program code, to determine each data processing node in the target program code and the data flow direction between the data processing nodes, and finally, based on the data flow direction, the data processing nodes are sequentially connected by using data flow direction edges, to generate a data relationship graph corresponding to the target program code. Through the data relationship graph, the production and processing process of data by the target program code, the data storage location and the dependency relationship between data can be clearly expressed, and the management level of data is improved.
[0154] It should be noted that the data relationship display device provided in the above embodiment is used to execute the data relationship display method, and the division of the above functional modules is only used as an example. In actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the data relationship display device and the data relationship display method provided in the above embodiment belong to the same concept, and the implementation process is described in detail in the method embodiment, which will not be described here.
[0155] The serial numbers of the above embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0156] The embodiment of the present application also provides a computer storage medium, which can store a plurality of instructions, the instructions being suitable for being loaded and executed by a processor to execute the data relationship display method of the above embodiment. Figures 1-9 The specific execution process can refer to the specific description of the embodiment shown in Figures 1-9 The specific execution process can refer to the specific description of the embodiment shown in
[0157] The present application also provides a computer program product, which stores at least one instruction, the at least one instruction being loaded and executed by the processor to execute the data relationship display method of the above embodiment. Figures 1-9 The specific execution process can refer to the specific description of the embodiment shown in Figures 1-9 The specific execution process can refer to the specific description of the embodiment shown in
[0158] Please refer to Figure 13 The present application provides a structural block diagram of an electronic device. The electronic device in the present application can include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140 and a bus 150. The processor 110, the memory 120, the input device 130 and the output device 140 can be connected through the bus 150.
[0159] The processor 110 can include one or more processing cores. The processor 110 connects various parts within the terminal through various interfaces and lines, performs various functions of the terminal 100 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Alternatively, the processor 110 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), a programmable logic array (PLA). The processor 110 can integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes an operating system, a user interface, and an application program; the GPU is responsible for rendering and drawing display content; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 110, but can be implemented by a separate communication chip.
[0160] The memory 120 can include a random access memory (RAM) and can also include a read-only memory (ROM). Alternatively, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 can be used to store instructions, programs, codes, code sets or instruction sets.
[0161] Among them, the input device 130 is used to receive input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes but is not limited to a display device and a speaker. In the embodiment of the present specification, the input device 130 can be a temperature sensor for obtaining the operating temperature of the terminal. The output device 140 can be a speaker for outputting an audio signal.
[0162] In addition, those skilled in the art can understand that the structure of the terminal shown in the above-mentioned drawings does not constitute a limitation on the terminal, and the terminal can include more or fewer components than the drawings, or combine certain components, or different component arrangements. For example, the terminal also includes radio frequency circuitry, input units, sensors, audio circuitry, wireless fidelity (WIFI) modules, power supplies, Bluetooth modules, and the like, which are not described here.
[0163] In the embodiments of the present specification, the execution subject of each step can be the terminal introduced above. Alternatively, the execution subject of each step is the operating system of the terminal. The operating system can be an Android system, an IOS system, or other operating systems, and the embodiments of the present specification do not limit this.
[0164] In Figure 13 In the electronic device of the present specification, the processor 110 can be configured to call the data relationship display program stored in the memory 120 and execute to implement the data relationship display method as described in the various method embodiments of the present specification.
[0165] In the embodiments of the present specification, first, the target program code is acquired, and then the target program code is parsed based on the code syntax corresponding to the target program code to determine each data processing node in the target program code and the data flow direction between each data processing node. Finally, based on the data flow direction, the data processing nodes are sequentially connected by using data flow direction edges to generate a data relationship graph corresponding to the target program code. Through the data relationship graph, the production and processing process of the target program code on the data, the data storage location, and the dependency relationship between the data can be clearly expressed, and the management level of the data is improved.
[0166] Those skilled in the art can clearly understand that the technical solutions of the present specification can be implemented by means of software and / or hardware. The "unit" and "module" in the present specification refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, and the hardware can be, for example, a Field-Programmable Gate Array (FPGA), an Integrated Circuit (IC), and the like.
[0167] It should be noted that for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present specification is not limited by the order of the described actions, because according to the present specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present specification.
[0168] In the above-described embodiments, the description of each embodiment focuses on different aspects, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0169] In several embodiments provided in the specification, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are only schematic. The division of the units described above is only a logical function division. In actual implementation, another division mode can be adopted, for example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some service interface, device or unit, and can be electrical or other forms.
[0170] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place or distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0171] In addition, each functional unit in each embodiment of the specification can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0172] Those of ordinary skill in the art can understand that all or part of the steps of the various methods in the above embodiments can be completed by a program instructing related hardware, and the program can be stored in a computer readable memory, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0173] The above is only an exemplary embodiment of the specification, and cannot limit the scope of the specification. That is, any equivalent changes and modifications made according to the teachings of the specification are still within the scope of the specification. Other embodiments of the specification will be easily thought of by those skilled in the art after considering the specification and practicing the disclosure herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or conventional technical means in the technical field not recorded in the specification. The specification and examples are only considered as exemplary, and the scope and spirit of the specification are defined by the claims.
Claims
1. A data relationship display method, the method comprising: acquiring target program code; code parsing the target program code based on a code syntax corresponding to the target program code, to determine each data processing node in the target program code and a data flow direction between each data processing node; based on the data flow direction, sequentially connecting each data processing node using a data flow direction edge to generate a data relationship graph corresponding to the target program code; the data processing node includes a storage node and a logical operation node; the code parsing the target program code based on the code syntax corresponding to the target program code, to determine each data processing node in the target program code and a data flow direction between each data processing node, comprises: code parsing the target program code based on the code syntax corresponding to the target program code, to determine data storage code, logical operation code and data flow direction in the target program code; generating a storage node based on the data storage code and a node pattern corresponding to the storage node; generating a logical operation node based on the logical operation code and a node pattern corresponding to the logical operation node.
2. The method of claim 1, wherein the data flow direction is used to sequentially connect each data processing node using a data flow direction edge to generate a data relationship graph corresponding to the target program code, comprising: based on the data flow direction, sequentially connecting the storage node and the logical operation node using a data flow direction edge to generate a data relationship graph corresponding to the target program code.
3. The method of claim 1, wherein the data storage code and the node pattern corresponding to the storage node are used to generate a storage node, comprising: extracting target data corresponding to the data storage code, storage information corresponding to the target data based on the code syntax; generating a target data storage node based on the target data, the storage information corresponding to the target data and the node pattern corresponding to the storage node.
4. The method of claim 3, wherein the logical operation code and the node pattern corresponding to the logical operation node are used to generate a logical operation node, comprising: obtaining a logical operation flow corresponding to the target data based on the code syntax for parsing and processing the logical operation code; generating a logical operation node corresponding to the logical operation flow based on the logical operation flow and the node pattern corresponding to the logical operation node.
5. The method of claim 4, further comprising: acquiring dependent data corresponding to the target data in the logical operation code and storage information corresponding to the dependent data; generating a dependent data storage node based on the dependent data, the storage information corresponding to the dependent data and the node pattern corresponding to the storage node; the data flow direction is used to sequentially connect each data processing node using a data flow direction edge to generate a data relationship graph corresponding to the target program code, comprising: Based on the data flow direction, the target data storage node, the dependent data storage node and the logical operation node are sequentially connected by using data flow direction edges to generate a data relationship graph corresponding to the target program code.
6. The method of claim 3, further comprising: extracting a sub-code corresponding to the target data from the target program code based on the code syntax, the sub-code being a code representing a generation process of the target data; the generating the target data storage node based on the target data, the storage information corresponding to the target data and the node pattern corresponding to the storage node comprises: generating the target data storage node based on the target data, the sub-code, the storage information corresponding to the target data and the node pattern corresponding to the storage node.
7. The method of claim 6, after the generating the data relationship graph corresponding to the target program code by sequentially connecting each data processing node by using data flow direction edges based on the data flow direction, further comprising: in response to a selection instruction of a detailed description component in the target data storage node, displaying the sub-code through a floating window.
8. The method of claim 1, after the code parsing of the target program code based on the code syntax corresponding to the target program code to determine each data processing node in the target program code and the data flow direction between each data processing node, further comprising: extracting a text annotation corresponding to each data processing node from the target program code based on the code syntax; the generating the data relationship graph corresponding to the target program code by sequentially connecting each data processing node by using data flow direction edges based on the data flow direction comprises: adding the text annotation corresponding to each data processing node to the corresponding data processing node to obtain a data processing annotation node; generating the data relationship graph corresponding to the target program code by sequentially connecting each data processing annotation node by using data flow direction edges based on the data flow direction.
9. The method of claim 1, wherein the logical operation node comprises any one or more of a function operation node, an association operation node, a filtering operation node, a combination operation node and a disassembly operation node.
10. A data relationship display device, comprising: a code acquisition module configured to acquire a target program code; a code parsing module configured to code parse the target program code based on a code syntax corresponding to the target program code to determine each data processing node in the target program code and a data flow direction between each data processing node; the data processing node comprises a storage node and a logical operation node. The code parsing module comprises: a code parsing unit configured to perform code parsing on the target program code based on a code syntax corresponding to the target program code, and determine data storage code, logic operation code and data flow in the target program code; a storage node generation unit configured to generate a storage node based on a node pattern corresponding to the data storage code and the storage node; and an operation node generation unit configured to generate a logic operation node based on a node pattern corresponding to the logic operation code and the logic operation node. The relationship graph generation module is configured to sequentially connect each data processing node by using a data flow edge based on the data flow, and generate a data relationship graph corresponding to the target program code.
11. A storage medium having stored thereon a computer program, characterized in that The computer program, when executed by a processor, implements the steps of the method of any one of claims 1-9.
12. An electronic device, comprising: The computer program, when executed by a processor, implements the steps of the method of any one of claims 1-9. The computer program, when executed by a processor, implements the steps of the method of any one of claims 1-9.
13. A computer program product having stored thereon at least one instruction, the computer program product comprising:
Citation Information
Patent Citations
Visualization method and device of program execution scheme, electronic equipment and storage medium
CN118606354A