CN114968348A - Data analysis method and device, electronic equipment and storage medium - Google Patents

Data analysis method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114968348A
CN114968348A CN202210581973.3A CN202210581973A CN114968348A CN 114968348 A CN114968348 A CN 114968348A CN 202210581973 A CN202210581973 A CN 202210581973A CN 114968348 A CN114968348 A CN 114968348A
Authority
CN
China
Prior art keywords
node
code
data
code data
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.)
Pending
Application number
CN202210581973.3A
Other languages
Chinese (zh)
Inventor
刘泉富
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202210581973.3A priority Critical patent/CN114968348A/en
Publication of CN114968348A publication Critical patent/CN114968348A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/74Reverse engineering; Extracting design information from source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis

Abstract

The application provides a data analysis method and device, electronic equipment and a storage medium, wherein the method comprises the following steps: code data that operates on the data table is obtained. And identifying a target data table from the code data, and constructing a root node according to the target data table, wherein the target data table is a data table to be operated. And identifying the table operation corresponding to the target data table from the code data, and constructing an operation node according to the table operation. Identifying object information corresponding to the table operation from the code data, and constructing an associated node corresponding to the operation node according to the object information, wherein the object information comprises a plurality of objects calling the table operation and a hierarchical relationship among the objects. Based on the method, the root node, the operation node and the associated node are associated to obtain a relation view corresponding to the code data, so that developers can conveniently and quickly evaluate the influence of code change on the whole code logic, and efficient and comprehensive code data analysis can be realized.

Description

Data analysis method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to a data analysis method and device, electronic equipment and a storage medium.
Background
In software development work, upgrade optimization of software functions involves changes to original code, and the changes are usually easy to cause a series of code errors. In the existing mode, developers can arrange the code logic according to own experience, so that data sources and use scenes related to the codes are analyzed, and the code change results are convenient to evaluate. However, this method is time-consuming and laborious, and still presents the problem of incomplete analysis.
Disclosure of Invention
The application provides a data analysis method and device, electronic equipment and a storage medium, and mainly aims to realize efficient and comprehensive code data analysis.
In order to achieve the above object, an embodiment of the present application provides a data analysis method, where the method includes:
code data for operating aiming at the data table is obtained; identifying a target data table from the code data, and constructing a root node according to the target data table, wherein the target data table is a data table to be operated; identifying table operation corresponding to the target data table from the code data, and constructing an operation node according to the table operation; identifying object information corresponding to the table operation from the code data, and constructing an associated node corresponding to the operation node according to the object information, wherein the object information comprises a plurality of objects for calling the table operation and a hierarchical relationship among the objects; and associating the root node, the operation node and the association node to obtain a relation view corresponding to the code data.
In some optional embodiments, the associated node includes N layers of child nodes of the operation node, where N is a positive integer; the identifying of the object information corresponding to the table operation from the code data and the construction of the associated node corresponding to the operation node according to the object information includes:
generating a first keyword according to the table operation, utilizing the first keyword to carry out retrieval analysis on the code data to obtain a first analysis result, and if a first object calling the first keyword is obtained according to the first analysis result, constructing a first-layer child node of the operation node according to the first object; generating a second keyword according to the ith layer of sub-nodes of the operation node, and utilizing the second keyword to carry out retrieval analysis on the code data to obtain a second analysis result, wherein i belongs to [2, N-1 ]; and if a second object for calling the second keyword is obtained according to the second analysis result, constructing the (i + 1) th layer of sub-nodes of the operation node according to the second object.
In some optional embodiments, the associating the root node, the operation node, and the association node to obtain the relationship view corresponding to the code data includes:
adding a first pointer for pointing to the operation node for the root node, adding a second pointer for pointing to a first-layer child node of the operation node for the operation node, and adding a third pointer for pointing to an i + 1-layer child node of the operation node for an i-layer child node of the operation node; sequencing the root nodes, the operation nodes and the associated nodes according to the respective corresponding construction sequence of the root nodes, the operation nodes and the associated nodes to obtain a node sequence; traversing the node sequence; in the process of traversing the node sequence, sequentially adding the traversed nodes into the relational view; if the node indicated by the first pointer is traversed, connecting the root node with the node indicated by the first pointer; if the node indicated by the second pointer is traversed, connecting the operating node with the node indicated by the second pointer; and if the node indicated by the third pointer is traversed, connecting the i-th layer child node with the node indicated by the third pointer.
In some optional embodiments, after the associating the root node, the operation node, and the association node to obtain the relationship view corresponding to the code data, the method further includes:
acquiring a selected code in the code data; identifying a target node corresponding to the selected code from the relational view; acquiring a first node link corresponding to the target node from the relation view; according to the first node link, determining a first code corresponding to the first node link from the code data; and performing prompt processing on the first code.
In some optional embodiments, after the associating the root node, the operation node, and the association node to obtain the relationship view corresponding to the code data, the method further includes:
acquiring a selected node in the relation view; acquiring a second node link associated with the selected node from the relation view; according to the second node link, determining a second code corresponding to the second node link from the code data; and prompting the second code.
In some optional embodiments, after determining, according to the second node link, a second code corresponding to the second node link from the code data, the method further includes: generating a code template corresponding to the second node link according to the second code, wherein the code template comprises a plurality of fields to be filled; generating an information input page corresponding to the second node link based on the code template, and generating a field input area corresponding to each field to be filled in the information input page; acquiring field input information through the field input area; and generating the target code based on the code template and the field input information.
In some optional embodiments, the generating, according to the second code, a code template corresponding to the second node link includes:
acquiring a code block including the second code from the code data; and replacing the second code with a field to be filled in the code block to obtain a code template corresponding to the second node link.
In order to achieve the above object, an embodiment of the present application further provides a data analysis apparatus, where the apparatus includes:
the acquisition module is used for acquiring code data for operating the data table;
the first construction module is used for identifying a target data table from the code data and constructing a root node according to the target data table, wherein the target data table is a data table to be operated;
the second construction module is used for identifying the table operation corresponding to the target data table from the code data and constructing an operation node according to the table operation;
a second construction module, configured to identify object information corresponding to the table operation from the code data, and construct an associated node corresponding to the operation node according to the object information, where the object information includes a plurality of objects that invoke the table operation and a hierarchical relationship between the plurality of objects;
and the view generation module is used for associating the root node, the operation node and the association node to obtain a relation view corresponding to the code data.
To achieve the above object, an embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and the computer program, when executed by the processor, implements the foregoing method.
To achieve the above object, the present application provides a storage medium for a computer-readable storage, the storage medium storing one or more computer programs, the one or more computer programs being executable by one or more processors to implement the foregoing methods.
According to the data analysis method and device, the electronic device and the storage medium, the target data table is identified from the code data, the root node corresponding to the target data table is constructed, the table operation corresponding to the target data table is identified from the code data, the operation node is constructed according to the table operation, the source tracing from the data table can be realized, and the association relation is established between the data table and the related table operation. Based on the method, object information corresponding to the table operation is identified from the code data, so that associated nodes corresponding to the operation nodes are constructed, a plurality of objects specifically related to the table operation and the hierarchical relationship of the objects are conveniently analyzed, and finally, a relationship view capable of representing the hierarchical relationship of the data is generated according to the root nodes, the operation nodes and the associated nodes, so that developers can conveniently and quickly evaluate the influence of the code change on the whole code logic, and efficient and comprehensive code data analysis is facilitated.
Drawings
Fig. 1 is a block diagram of an electronic device to which an embodiment of the present application is applied;
fig. 2 is a schematic flowchart of a data analysis method provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of a relational view in an embodiment of the present application;
FIG. 4 is a schematic flowchart of a specific process of prompting a code in an embodiment of the present application;
FIG. 5 is a schematic diagram of another specific flow chart of prompting processing on a code in the embodiment of the present application;
fig. 6 is a block diagram of a data analysis device applied in the embodiment of the present application.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for the convenience of description of the present application, and have no peculiar meaning by themselves. Thus, "module", "component" or "unit" may be used mixedly.
In software development work, upgrade optimization of software functions involves changes to original code, and the changes are usually easy to cause a series of code errors. In the existing mode, developers can arrange the code logic according to own experience, so that data sources and use scenes related to the codes are analyzed, and the code change results are convenient to evaluate. However, this method is time-consuming and laborious, and still presents the problem of incomplete analysis.
In order to solve the above problem, the present application provides a data analysis method applied to an electronic device. Referring to fig. 1, fig. 1 is a block diagram of an electronic device to which an embodiment of the present application is applied.
In the embodiment of the present application, the electronic device may be a terminal device having an arithmetic function, such as a server, a smart phone, a tablet computer, a portable computer, and a desktop computer.
The electronic device includes: memory 11, processor 12, network interface 13, and data bus 14.
The memory 11 includes at least one type of readable storage medium, which may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory, and the like. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device, such as a hard disk of the electronic device. In other embodiments, the readable storage medium may be an external memory of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device.
In the present embodiment, the readable storage medium of the memory 11 is generally used for storing a data analysis program installed in the electronic device, a plurality of sample sets, a pre-trained model, and the like. The memory 11 may also be used to temporarily store data that has been output or is to be output.
The processor 12 may be a Central Processing Unit (CPU), a microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 11 or Processing data, such as executing a data analysis program.
The network interface 13 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and is typically used to establish a communication link between the electronic device and other electronic devices.
The data bus 14 is used to enable connection communication between these components.
Fig. 1 only shows an electronic device having components 11-14, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
Optionally, the electronic device may further include a user interface, the user interface may include an input unit such as a Keyboard (Keyboard), a voice input device such as a microphone (microphone) or other devices with voice recognition function, a voice output device such as a sound box, a headset, or other devices, and optionally, the user interface may further include a standard wired interface or a wireless interface.
Optionally, the electronic device may further include a display, which may also be referred to as a display screen or a display unit. In some embodiments, the display device may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an Organic Light-Emitting Diode (OLED) touch device, or the like. The display is used for displaying information processed in the electronic device and for displaying a visualized user interface.
Optionally, the electronic device further comprises a touch sensor. The area provided by the touch sensor for the user to perform touch operation is referred to as a touch area. Further, the touch sensor here may be a resistive touch sensor, a capacitive touch sensor, or the like. The touch sensor may include not only a contact type touch sensor but also a proximity type touch sensor. Further, the touch sensor may be a single sensor, or may be a plurality of sensors arranged in, for example, an array.
In addition, the area of the display of the electronic device may be the same as or different from the area of the touch sensor. Optionally, the display is stacked with the touch sensor to form a touch display screen. The device detects touch operation triggered by a user based on the touch display screen.
A data analysis method disclosed in the embodiments of the present application is specifically described below.
As shown in fig. 2, fig. 2 is a schematic flow chart of a data analysis method provided in the embodiment of the present application. Based on the electronic device shown in fig. 1, the processor 12 implements the following steps S200 to S240 when executing the computer program stored in the memory 11.
Step S200: code data that operates on the data table is obtained.
In the embodiment of the present application, the data table is an object for storing data in the database, and is organized according to a format of rows and columns. The data table may include table names, fields in the table, records, and indexes, wherein the table names have uniqueness, the data types of the fields may include, but are not limited to, text, numbers, dates and times, numbers, Object Linking and Embedding (OLE) objects, hyperlinks, and the like, and the indexes are storage structures that sort the fields in each row or column for quickly locating the row or column containing the specified fields. It is understood that the database types applied in the embodiments of the present application include, but are not limited to, relational databases such as MySQL, SQL Server, Access, Oracle, Sybase, and DB 2. Accordingly, the code data may be in Structured Query Language (SQL) and the data in the database may be accessed and processed by compiling and executing the code data.
Specifically, the electronic device may generate a code writing interface and directly obtain code data from the code writing interface. Alternatively, the electronic device may also parse the code data from the received source code file, which is not limited in this respect.
Step S210: and identifying a target data table from the code data, and constructing a root node according to the target data table, wherein the target data table is a data table to be operated.
In the embodiment of the application, the electronic device may determine, according to a writing language adopted by the code data, a first syntax structure for identifying the data table, so as to identify the target data table from the code data in combination with the first syntax structure. For example, for a query statement written in SQL language, its syntax structure is "SELECT FROM table _ name 1", and then "table _ name 1" is a data table to be operated. For another example, for an INSERT statement written in SQL language, the syntax structure of the INSERT statement is "INSERT table _ name2 VALUES (value1, value2, value 3)", and then "table _ name 2" is a data table to be operated.
It is to be understood that the root node represents the topmost node in a tree data structure, and that the root node may be connected to at least one child node, but does not have a parent node. And the target data table is used as a root node, and data source tracing and flow direction analysis can be performed on the basis of the data table.
Step S220: and identifying the table operation corresponding to the target data table from the code data, and constructing an operation node according to the table operation.
In this embodiment, similarly, the electronic device may determine a preset keyword for identifying a table operation according to a writing language adopted by the code data, and perform keyword matching on an operation statement including the target data table in the code data according to the preset keyword to obtain a keyword that is successfully matched, so as to determine a table operation corresponding to the target data table based on the keyword that is successfully matched. Table operations may include, but are not limited to, query operations, sort operations, insert operations, update operations, delete operations, and the like. In some implementations, identification information (e.g., ID information) corresponding to the table operation may be obtained, and an operation node corresponding to the table operation may be constructed according to the identification information.
Step S230: and identifying object information corresponding to the table operation from the code data, and constructing an associated node corresponding to the operation node according to the object information.
In the embodiment of the present application, the object information includes a plurality of objects for invoking table operations and a hierarchical relationship between the plurality of objects, where the objects include, but are not limited to, classes, functions, methods, stored procedures, interfaces, and the like.
The hierarchical relationship may also be used to represent a calling relationship among the objects, and the associated node may include N layers of child nodes of the operation node, where N is a positive integer. For example, if the object a is a calling function and the object a calls a query operation, so the object a and the query operation satisfy a call relationship, assuming that the operation node P0 is constructed for the query operation, the first-level child node P1 of the operation node P0 may be constructed from the object a. Similarly, if the object B is a calling function and the object A is a called function of the object B, so that the object B and the object A satisfy a calling relationship, the child node P2 of the first-level child node P1, that is, the second-level child node of the operation node P0, may be constructed from the object B. Based on the above, by combining the traversing and recursive node construction modes, the N layers of sub-nodes form a calling link corresponding to one operation node, and if the calling links corresponding to different operation nodes are further combined, a global hierarchical structure corresponding to the data table can be formed.
In an optional implementation manner, step S230 may specifically include the following steps:
and if a first object calling the first keyword is obtained according to the first analysis result, constructing a first-layer child node of the operation node according to the first object.
Generating a second keyword according to the ith layer of sub-nodes of the operation node, and performing retrieval analysis on code data by using the second keyword to obtain a second analysis result, wherein i belongs to [2, N-1 ]; and if a second object for calling the second keyword is obtained according to the second analysis result, constructing the (i + 1) th layer of sub-nodes of the operation node according to the second object.
It is to be understood that, if the first object invoking the first keyword cannot be obtained according to the first analysis result, the operation node is determined as a leaf node. Or, determining the i-th layer child node of the operation node as a leaf node if the second object calling the second keyword cannot be obtained according to the second analysis result. A leaf node represents the lowest node in a tree data structure, and a leaf node may connect at least one parent node but does not have a child node, so that a leaf node is used to mark the end of a node link.
Step S240: and associating the root node, the operation node and the associated node to obtain a corresponding relation view of the code data.
In the embodiment of the application, the nodes meeting the hierarchical relationship are connected according to the root node, the operation node and the associated node, and the relationship view corresponding to the code data can be obtained. The relational view may adopt a tree diagram, a bubble diagram, a fishbone diagram, or the like, which is not particularly limited.
Further, in an optional implementation manner, the step S240 may specifically include the following steps:
the electronic device adds a first pointer for pointing to the operation node for the root node, adds a second pointer for pointing to a first-layer child node of the operation node for the operation node, and adds a third pointer for pointing to an i + 1-layer child node of the operation node for the i-layer child node of the operation node. The first pointer, the second pointer and the third pointer are used for representing different memory addresses. Specifically, a different third pointer may be added to each of the child nodes in the ith layer of child nodes, where the third pointer is specifically used to point to at least one corresponding child node in the (i + 1) th layer of child nodes in each of the ith layer of child nodes.
Based on the above, the electronic device sorts the root nodes, the operation nodes and the associated nodes according to the respective corresponding construction sequences of the root nodes, the operation nodes and the associated nodes to obtain a node sequence. Finally, the electronic device traverses the sequence of nodes. In the process of traversing the node sequence, the electronic device may sequentially add the traversed nodes to the relationship view, and perform node connection according to the following manner: if the node indicated by the first pointer is traversed, connecting the root node with the node indicated by the first pointer; if the node indicated by the second pointer is traversed, connecting the operation node with the node indicated by the second pointer; and if the node indicated by the third pointer is traversed, connecting the i-th layer child node with the node indicated by the third pointer.
Illustratively, referring to fig. 3, fig. 3 is a schematic view of a relationship view in an embodiment of the present application. Assuming that the root node 30 is "table name T", the operation nodes include an insertion node 31, a deletion node 32, and an update node 33, and the associated nodes corresponding to the update node include a first-layer child node 331, a second-layer child node 332, a third-layer child node 333, and a fourth-layer child node 334. Based on this, a sequence of nodes can be generated, namely: table name T, (insert node, delete node, update node), ("Procedure 1" node, "xml 1" node), ("Procedure 2" node, "xml 2" node), "xxx. Therefore, the correct node hierarchy relationship can be ensured by traversing the node sequence, namely sequentially traversing the nodes of different hierarchies. Taking fig. 3 as an example, the root node 30 is connected to the insertion node 31, the deletion node 32, and the update node 33 is connected to the corresponding first-level child nodes 331. Next, in the first-level child node 331 of the update node 33, the "Procedure 1" node is connected to its corresponding second-level child node 332 according to the pointer. Thereafter, in the second-tier child node 332 of the update node 33, the "xml 2" node is connected with its corresponding third-tier child node 333. Finally, in the third-level child node 333 of the update node 33, the "xxx. java" node is connected with its corresponding fourth-level node 334, resulting in the relationship view shown in fig. 3. It can be understood that the association relationship is established for the nodes of different levels by using the pointer, that is, the nodes can be automatically connected according to the indication of the pointer in the traversal process. Because the pointer is only used for indicating the memory address, the data volume of the node can be reduced by the method, and the node structure of different levels can be flexibly adjusted under the condition of not influencing the level relationship.
In an alternative implementation manner, please refer to fig. 4, where fig. 4 is a schematic diagram illustrating a specific flow of a process for prompting a code in an embodiment of the present application. As shown in fig. 4, after step S240, the electronic device may further perform the following steps S400 to S440.
Step S400: and acquiring the selected code in the code data.
Optionally, the electronic device may detect a first selection operation on the code data through the code writing interface, and determine a code corresponding to the first selection operation as the selected code.
Step S410: and identifying a target node corresponding to the selected code from the relational view.
It can be understood that, when the nodes are constructed in steps S210 to S230, the conversion relationship between the codes and the nodes may be recorded, and according to the conversion relationship, the target node corresponding to the selected code may be quickly identified.
Step S420: a first node link associated with the target node is obtained from the relational view.
In one implementation, the node link containing the target node may be taken as the first node link associated with the target node among all node links from the root node to the leaf nodes of the relational view. In another implementation manner, a target pointer pointing to the target node may also be obtained, and the node to which the target pointer is added is taken as the first node associated with the target node, so that the first node link is generated according to the target node and the first node. The manner of acquiring the first node link is not particularly limited.
Step S430: and determining a first code corresponding to the first node link from the code data according to the first node link.
Specifically, according to the conversion relationship between the codes and the nodes, the code positions corresponding to all the nodes in the first node link may be located in the code data, so as to obtain the first code from the code data according to the code positions, where the first code may be a class, a method, a code block, or the like, and is not limited.
Step S440: and performing prompt processing on the first code.
The prompting method in step S440 includes, but is not limited to, highlighting, bolding, or changing color of the first code in the code writing interface. Therefore, through steps S400 to S440, when the user writes the code, the electronic device may automatically prompt the code information related to the code to be changed, so that the user can quickly evaluate the influence of the code change on the original code data.
In another alternative implementation, please refer to fig. 5, where fig. 5 is a schematic specific flowchart of another prompting process for a code in this embodiment. As shown in fig. 5, after step S240, the electronic device may further perform the following steps S500 to S530.
Step S500: and acquiring the selected node in the relation view.
Optionally, the electronic device may generate a view interaction interface and display the relationship view in the view interaction interface. The electronic equipment can also detect a second selection operation on the relation view through the view interaction interface, and determine a node corresponding to the second selection operation as a selected node.
Step S510: and acquiring a second node link associated with the selected node from the relational view.
In one implementation, the node link containing the selected node may be taken as the second node link associated with the selected node among all node links from the root node to the leaf nodes of the relational view. In another implementation, a pointer to the selected node may be obtained, the node added with the pointer is used as a second node associated with the selected node, and a second node link is generated according to the selected node and the second node. The manner of acquiring the link of the second node is not particularly limited.
Step S520: and determining a second code corresponding to the second node link from the code data according to the second node link.
It can be understood that the second codes corresponding to all nodes in the link of the second node can be quickly identified according to the conversion relationship between the codes and the nodes.
Further, in some optional implementation manners, after step S520, the electronic device may further generate a code template corresponding to the second node link according to the second code, where the code template includes a plurality of fields to be filled. And generating an information input page corresponding to the second node link based on the code template, and generating a field input area corresponding to each field to be filled in the information input page. And acquiring field input information through the field input area. And generating the target code based on the code template and the field input information. Therefore, in addition to quickly positioning the code information corresponding to the node link, the code template corresponding to the selected node link can be quickly generated through the operation relation view, the development period can be favorably shortened, the target code required by the user can be accurately and efficiently obtained, and the problem that manual coding is prone to errors is effectively solved.
Still further, in some optional implementation manners, generating a code template corresponding to the second node link according to the second code may specifically include the following steps: a code block including the second code is acquired from the code data. And in the code block, replacing the second code with a field to be filled, and obtaining a code template corresponding to the second node link. It can be understood that the codes corresponding to the nodes in the second node link are used as variables, so that a user can fill in the replacement fields by himself, and the universality of the codes is improved while the original code logic is maintained.
Step S530: and prompting the second code.
The prompting method in step S530 includes, but is not limited to, highlighting, bolding, or changing color of the second code in the code writing interface. It can be seen that, through steps S500 to S530, when the user selects a node according to the user' S own needs, the electronic device may automatically prompt the code information related to the selected node, so that the user can quickly view the specific codes related to different node types.
Therefore, by implementing the method embodiment, the data table and the related table operation can be associated from the data table tracing, a plurality of objects specifically related to the table operation and the hierarchical relationship thereof are analyzed, and finally, a relationship view capable of representing the hierarchical relationship of the data is generated, so that developers can conveniently and rapidly evaluate the influence of code change on the whole code logic, and efficient and comprehensive code data analysis is facilitated.
The embodiment of the application also provides a data analysis device. Referring to fig. 6, fig. 6 is a block diagram of a data analysis apparatus according to an embodiment of the present disclosure. As shown in fig. 6, the data analysis apparatus 600 includes an acquisition module 610, a first construction module 620, a second construction module 630, a third construction module 640, and a view generation module 650, wherein:
an obtaining module 610, configured to obtain code data for operating on a data table.
The first constructing module 620 is configured to identify a target data table from the code data, and construct a root node according to the target data table, where the target data table is a data table to be operated.
The second building module 630 is configured to identify a table operation corresponding to the target data table from the code data, and build an operation node according to the table operation.
The third constructing module 640 is configured to identify object information corresponding to the table operation from the code data, and construct an associated node corresponding to the operation node according to the object information, where the object information includes a plurality of objects invoking the table operation and a hierarchical relationship between the plurality of objects.
And the view generating module 650 is configured to associate the root node, the operation node, and the association node to obtain a relationship view corresponding to the code data.
In some optional embodiments, the associated node includes N layers of child nodes of the operation node, where N is a positive integer. The third constructing module 640 is further configured to generate a first keyword according to the table operation, perform retrieval analysis on the code data by using the first keyword to obtain a first analysis result, and if a first object calling the first keyword is obtained according to the first analysis result, construct a first-layer child node of the operation node according to the first object; generating a second keyword according to the ith layer of sub-nodes of the operation node, and performing retrieval analysis on code data by using the second keyword to obtain a second analysis result, wherein i belongs to [2, N-1 ]; and if a second object for calling the second keyword is obtained according to the second analysis result, constructing the (i + 1) th layer of sub-nodes of the operation node according to the second object.
Further, in some optional embodiments, the view generating module 650 is further configured to add a first pointer to the operation node for the root node, add a second pointer to the first-layer child node of the operation node for the operation node, and add a third pointer to the i + 1-layer child node of the operation node for the i-layer child node of the operation node; the method comprises the steps that according to the respective corresponding construction sequence of a root node, an operation node and an associated node, the root node, the operation node and the associated node are sequenced to obtain a node sequence; traversing the node sequence; in the process of traversing the node sequence, sequentially adding the traversed nodes into the relational view, and if the nodes indicated by the first pointer are traversed, connecting the root nodes with the nodes indicated by the first pointer; if the node indicated by the second pointer is traversed, connecting the operation node with the node indicated by the second pointer; and if the node indicated by the third pointer is traversed, connecting the i-th layer child node with the node indicated by the third pointer.
In some optional embodiments, the data analysis apparatus may further include a first prompt module. The first prompting module is configured to, after the view generating module 650 associates the root node, the operation node, and the associated node to obtain a relationship view corresponding to the code data, obtain a selected code in the code data, identify a target node corresponding to the selected code from the relationship view, obtain a first node link corresponding to the target node from the relationship view, and determine, according to the first node link, a first code corresponding to the first node link from the code data, so as to perform a prompting process on the first code.
In some optional embodiments, the data analysis device may further include a second prompting module. The second prompting module is configured to obtain a selected node in the relationship view after the view generating module 650 associates the root node, the operation node, and the association node to obtain the relationship view corresponding to the code data; acquiring a second node link associated with the selected node from the relationship view; determining a second code corresponding to the second node link from the code data according to the second node link; and prompting the second code.
Further, in some optional embodiments, the data analysis apparatus may further include a code generation module, and the code generation module may include a template generation unit, a page generation unit, an acquisition unit, and a code generation unit. The template generating unit is used for generating a code template corresponding to the second node link according to the second code after the second prompting module determines the second code corresponding to the second node link from the code data according to the second node link, wherein the code template comprises a plurality of fields to be filled. The page generating unit is used for generating an information input page corresponding to the second node link based on the code template, and generating a field input area corresponding to each field to be filled in the information input page. The acquisition unit is used for acquiring the field input information through the field input area. The code generation unit is used for generating the target code based on the code template and the field input information.
In some optional embodiments, the template generating unit is specifically configured to obtain a code block including the second code from the code data, and replace the second code with a field to be filled in the code block, so as to obtain a code template corresponding to the second node link.
It should be noted that, for the specific implementation process of this embodiment, reference may be made to the specific implementation process of the foregoing method embodiment, and details are not described again.
An embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, and the memory stores a computer program, and the computer program implements the data analysis method when executed by the processor.
Embodiments of the present application further provide a storage medium for a computer-readable storage, where the storage medium stores one or more computer programs, and the one or more computer programs are executable by one or more processors to implement the data analysis method.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
One of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the application and the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of units is only one type of division of logical functions, and other divisions may be realized in practice, 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 through some interfaces, devices or units, 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 integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, which are essential or part of the technical solutions contributing to the prior art, or all or part of the technical solutions, may be embodied in the form of a software product stored in a storage medium, which includes multiple instructions for enabling 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 methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The preferred embodiments of the present application have been described above with reference to the accompanying drawings, and the scope of the claims of the embodiments of the present application is not limited thereto. Any modifications, equivalents and improvements that may occur to those skilled in the art without departing from the scope and spirit of the embodiments of the present application are intended to be within the scope of the claims of the embodiments of the present application.

Claims (10)

1. A method of data analysis, the method comprising:
code data for operating aiming at the data table is obtained;
identifying a target data table from the code data, and constructing a root node according to the target data table, wherein the target data table is a data table to be operated;
identifying table operation corresponding to the target data table from the code data, and constructing an operation node according to the table operation;
identifying object information corresponding to the table operation from the code data, and constructing an associated node corresponding to the operation node according to the object information, wherein the object information comprises a plurality of objects for calling the table operation and a hierarchical relationship among the objects;
and associating the root node, the operation node and the association node to obtain a relation view corresponding to the code data.
2. The method of claim 1, wherein the associated node comprises N levels of child nodes of the operational node, N being a positive integer; the identifying the object information corresponding to the table operation from the code data and constructing the associated node corresponding to the operation node according to the object information includes:
generating a first keyword according to the table operation, utilizing the first keyword to carry out retrieval analysis on the code data to obtain a first analysis result, and if a first object calling the first keyword is obtained according to the first analysis result, constructing a first-layer child node of the operation node according to the first object;
generating a second keyword according to the ith layer of sub-nodes of the operation node, and utilizing the second keyword to carry out retrieval analysis on the code data to obtain a second analysis result, wherein i belongs to [2, N-1 ]; and if a second object for calling the second keyword is obtained according to the second analysis result, constructing the (i + 1) th layer of sub-nodes of the operation node according to the second object.
3. The method of claim 2, wherein associating the root node, the operation node, and the association node to obtain a relationship view corresponding to the code data comprises:
adding a first pointer for pointing to the operation node for the root node, adding a second pointer for pointing to a first-layer child node of the operation node for the operation node, and adding a third pointer for pointing to an i + 1-layer child node of the operation node for an i-layer child node of the operation node;
sequencing the root nodes, the operation nodes and the associated nodes according to the respective corresponding construction sequence of the root nodes, the operation nodes and the associated nodes to obtain a node sequence;
traversing the node sequence;
in the process of traversing the node sequence, sequentially adding the traversed nodes into the relational view;
if the node indicated by the first pointer is traversed, connecting the root node with the node indicated by the first pointer; if the node indicated by the second pointer is traversed, connecting the operating node with the node indicated by the second pointer; and if the node indicated by the third pointer is traversed, connecting the i-th layer child node with the node indicated by the third pointer.
4. The method according to any one of claims 1 to 3, wherein after the associating the root node, the operation node, and the association node to obtain the relationship view corresponding to the code data, the method further comprises:
acquiring a selected code in the code data;
identifying a target node corresponding to the selected code from the relational view;
acquiring a first node link corresponding to the target node from the relation view;
determining a first code corresponding to the first node link from the code data according to the first node link;
and performing prompt processing on the first code.
5. The method according to any one of claims 1 to 3, wherein after the associating the root node, the operation node, and the association node to obtain the relationship view corresponding to the code data, the method further comprises:
acquiring a selected node in the relation view;
acquiring a second node link associated with the selected node from the relation view;
according to the second node link, determining a second code corresponding to the second node link from the code data;
and prompting the second code.
6. The method of claim 5, wherein after determining the second code corresponding to the second node link from the code data according to the second node link, the method further comprises:
generating a code template corresponding to the second node link according to the second code, wherein the code template comprises a plurality of fields to be filled;
generating an information input page corresponding to the second node link based on the code template, and generating a field input area corresponding to each field to be filled in the information input page;
acquiring field input information through the field input area;
and generating the target code based on the code template and the field input information.
7. The method of claim 6, wherein the generating a code template corresponding to the second node link according to the second code comprises:
acquiring a code block including the second code from the code data;
and replacing the second code with a field to be filled in the code block to obtain a code template corresponding to the second node link.
8. A data analysis apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring code data for operating the data table;
the first construction module is used for identifying a target data table from the code data and constructing a root node according to the target data table, wherein the target data table is a data table to be operated;
the second construction module is used for identifying the table operation corresponding to the target data table from the code data and constructing an operation node according to the table operation;
a third construction module, configured to identify object information corresponding to the table operation from the code data, and construct an associated node corresponding to the operation node according to the object information, where the object information includes a plurality of objects that invoke the table operation and a hierarchical relationship between the plurality of objects;
and the view generation module is used for associating the root node, the operation node and the association node to obtain a relation view corresponding to the code data.
9. An electronic device, characterized in that the electronic device comprises a memory, a processor, a computer program stored on the memory and executable on the processor, and a data bus for enabling a connection communication between the processor and the memory, the computer program, when executed by the processor, implementing the data analysis method according to any one of claims 1 to 7.
10. A storage medium for computer-readable storage, wherein the storage medium stores one or more computer programs executable by one or more processors to implement the data analysis method of any one of claims 1 to 7.
CN202210581973.3A 2022-05-26 2022-05-26 Data analysis method and device, electronic equipment and storage medium Pending CN114968348A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210581973.3A CN114968348A (en) 2022-05-26 2022-05-26 Data analysis method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210581973.3A CN114968348A (en) 2022-05-26 2022-05-26 Data analysis method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114968348A true CN114968348A (en) 2022-08-30

Family

ID=82956174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210581973.3A Pending CN114968348A (en) 2022-05-26 2022-05-26 Data analysis method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114968348A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115630117A (en) * 2022-12-21 2023-01-20 网易(杭州)网络有限公司 Data analysis method, materialized view generation method and related equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115630117A (en) * 2022-12-21 2023-01-20 网易(杭州)网络有限公司 Data analysis method, materialized view generation method and related equipment

Similar Documents

Publication Publication Date Title
JP6916403B2 (en) Specifying and applying logical validation rules to data
CN108038222B (en) System of entity-attribute framework for information system modeling and data access
CN111177176B (en) Data detection method, device and storage medium
CN110543517B (en) Method, device and medium for realizing complex query of mass data based on elastic search
US8615526B2 (en) Markup language based query and file generation
US8447775B2 (en) Database query user interface to assist in efficient and accurate query construction
US11341116B2 (en) Techniques for automated data analysis
US8145990B2 (en) Systems and methods to dynamically recognize a database member identifier entered into a spreadsheet cell
CN110795524B (en) Main data mapping processing method and device, computer equipment and storage medium
CN103262076A (en) Analytical data processing
CN115061721A (en) Report generation method and device, computer equipment and storage medium
US9147040B2 (en) Point-in-time query system
CN103646049A (en) Method and system for automatically generating data report
CN114253995B (en) Data tracing method, device, equipment and computer readable storage medium
CN114968348A (en) Data analysis method and device, electronic equipment and storage medium
JP2010015458A (en) Program correction support system, program correction support method, and program correction support program
Cherry et al. Static analysis of database accesses in mongodb applications
CN117290376A (en) Two-stage Text2SQL model, method and system based on large language model
CN104636471A (en) Procedure code finding method and device
Kamp et al. SeSaMe: A data set of semantically similar Java methods
CN114298525A (en) Database risk assessment method and device
CN109739835B (en) Data version preservation method and device
US11036730B2 (en) Business intelligence language type representing result structure
CN112130841B (en) SQL development method and device and terminal equipment
CN116244424B (en) Book management 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