CN116795377A - Code data processing method and device - Google Patents
Code data processing method and device Download PDFInfo
- Publication number
- CN116795377A CN116795377A CN202310770090.1A CN202310770090A CN116795377A CN 116795377 A CN116795377 A CN 116795377A CN 202310770090 A CN202310770090 A CN 202310770090A CN 116795377 A CN116795377 A CN 116795377A
- Authority
- CN
- China
- Prior art keywords
- code
- code block
- program
- data
- code data
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 31
- 238000000034 method Methods 0.000 claims abstract description 65
- 238000012800 visualization Methods 0.000 claims abstract description 65
- 238000007667 floating Methods 0.000 claims abstract description 15
- 230000008569 process Effects 0.000 claims description 37
- 238000011161 development Methods 0.000 claims description 21
- 238000010586 diagram Methods 0.000 claims description 21
- 238000012545 processing Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 9
- 238000004458 analytical method Methods 0.000 claims description 7
- 230000000007 visual effect Effects 0.000 description 8
- 238000007726 management method Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 6
- 238000011002 quantification Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 229910003460 diamond Inorganic materials 0.000 description 2
- 239000010432 diamond Substances 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 239000007795 chemical reaction product Substances 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000005111 flow chemistry technique Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000006386 memory function Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/43—Checking; Contextual analysis
- G06F8/433—Dependency analysis; Data or control flow analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/447—Target code generation
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
Abstract
The specification relates to the technical field of computers, and particularly discloses a code data processing method and device, wherein the method comprises the following steps: acquiring program code data to be processed; the program code data comprises a plurality of code blocks; scanning and analyzing the program code data to obtain a program scanning file; element information of each code block in the plurality of code blocks is recorded in the program scanning file; generating a data flow chart visualization interface corresponding to the program code data based on the element information in the program scanning file; acquiring code data of a code block corresponding to a node in a visualization interface of a data flow chart; converting the code data of the code block into code pictures; and responding to a first click operation of the user on the node in the data flow chart visualization interface, and displaying the floating layer of the bullet frame so as to display the code picture corresponding to the node. The scheme can increase code readability and flow accuracy.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for processing code data.
Background
In the rapid development period of code language, low-code development becomes the mainstream, and various back-end development technical schemes are layered. However, in terms of business logic, it is still an interface to the front-end, while the back-end processing may face a lot of complexities, multi-end interactions, multi-flow processing, not just a simple CRUD. The later analysis is limited by only reading codes layer by layer, so that the problems of high difficulty in understanding, poor readability of later handover, difficult quantification of working contents and the like are solved for non-technical staff. Based on the bottleneck, whether the development process can be used as food or not, a menu is provided, and the process management and the development process management are achieved.
The current general logic is: the scheme is determined by the demand personnel and the flow chart is manufactured. The determination is followed by development by a developer. However, after the final development process is finished, the code logic and the flow chart cannot be butted, the code and the chart are separated, the graph cannot be an accurate reference basis, and the graph cannot be a basis for a subsequent positioning reason.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the specification provides a code data processing method and device, which are used for solving the problem that code logic and a flow chart cannot be connected in the prior art.
The embodiment of the specification provides a code data processing method, which comprises the following steps:
acquiring program code data to be processed; the program code data comprises a plurality of code blocks;
scanning and analyzing the program code data to obtain a program scanning file; element information of each code block in the plurality of code blocks is recorded in the program scanning file; the element information comprises a code block identifier, a flow identifier, code data of a code block, a logic description and a code block dependency relationship;
generating a data flow chart visualization interface corresponding to the program code data based on the element information in the program scanning file;
acquiring code data of a code block corresponding to a node in the data flow chart visualization interface; converting the code data of the code block into code pictures; and responding to a first click operation of a user on a node in the data flow chart visualization interface, and displaying a floating layer of the bullet frame so as to display a code picture corresponding to the node.
In one embodiment, the first clicking operation includes one of: a single click operation, a double click operation, a right click operation, and a touch operation.
In one embodiment, the element information further includes positioning information, the positioning information including: the name of the class where the code block is located, the absolute path of the class relative to the project and/or the row information where the code block starts and ends;
correspondingly, the method further comprises the steps of:
acquiring positioning information of a code block corresponding to the node;
converting the code data of the code block into a positioning information picture;
and responding to a second click operation of the user on the node in the data flow chart visualization interface, displaying a floating layer of the popup frame so as to display the positioning information picture.
In one embodiment, generating a data flow diagram visualization interface corresponding to the program code data based on element information in the program scan file includes:
dividing the code blocks into corresponding processes based on the process identification in the program scanning file to obtain a plurality of processes;
and generating a data flow chart visualization interface corresponding to each flow based on the code block identification, the logic description and the code block dependency relationship of the code blocks in each flow.
In one embodiment, the element information further includes a logical type of the code block; correspondingly, when the data flow chart visualization interface corresponding to each flow is generated, determining the shape of the node corresponding to the code block according to the logic type of the code block.
In one embodiment, generating a data flow diagram visualization interface corresponding to the program code data based on element information in the program scan file includes:
and loading and identifying the program scanning file by utilizing a front-end user interface plug-in integrated in the IDEA development tool so as to generate a data flow diagram visualization interface corresponding to the program code data.
In one embodiment, the code block identification and/or the logical description of the code block is presented in a node of the dataflow diagram visualization interface.
In one embodiment, the code block dependency includes a parent node code block identification and/or a child node code block identification of the code block.
In one embodiment, the program scan file is a Json file or JavaScript file.
In one embodiment, the code blocks include a code block start instruction and an end instruction; the start instruction carries the code block identifier, the flow identifier, the logic instruction and the code block dependency relationship; and the ending instruction carries the code block identifier.
The embodiment of the specification also provides a code data processing device, which comprises:
the acquisition module is used for acquiring the program code data to be processed; the program code data comprises a plurality of code blocks;
the scanning module is used for carrying out scanning analysis on the program code data to obtain a program scanning file; element information of each code block in the plurality of code blocks is recorded in the program scanning file; the element information comprises a code block identifier, a flow identifier, code data of a code block, a logic description and a code block dependency relationship;
the generation module is used for generating a data flow chart visualization interface corresponding to the program code data based on the element information in the program scanning file;
the display module is used for acquiring code data of the code blocks corresponding to the nodes in the data flow chart visualization interface; converting the code data of the code block into code pictures; and responding to a first click operation of a user on a node in the data flow chart visualization interface, and displaying a floating layer of the bullet frame so as to display a code picture corresponding to the node.
In one embodiment, the element information further includes positioning information, the positioning information including: the name of the class where the code block is located, the absolute path of the class relative to the project and/or the row information where the code block starts and ends;
correspondingly, the display module is further used for: acquiring positioning information of a code block corresponding to the node; converting the code data of the code block into a positioning information picture; and responding to a second click operation of the user on the node in the data flow chart visualization interface, displaying a floating layer of the popup frame so as to display the positioning information picture.
The embodiments of the present specification also provide a computer device, including a processor and a memory for storing instructions executable by the processor, where the processor executes the instructions to implement the steps of the code data processing method described in any of the embodiments above.
The present description also provides a computer-readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the code data processing method described in any of the above embodiments.
The present description also provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the code data processing method described in any of the embodiments above.
In an embodiment of the present disclosure, a method for processing code data is provided, where the code data includes a plurality of code blocks, scan analysis is performed on the code data to obtain a program scan file, element information of each code block in the plurality of code blocks is recorded in the program scan file, where the element information includes a code block identifier, a flow identifier, a logic description, and a code block dependency relationship, and a data flow chart visualization interface corresponding to the code data may be generated based on the element information in the program scan file. In this scheme, the program code data is divided into a plurality of processes or a plurality of process steps by the code blocks, the program code data is scanned to generate a program scan file containing element information corresponding to each of the code blocks, and then a data flow chart visual interface can be generated based on the element information in the program scan file. In the scheme, the development process and the business process can be tightly combined by converting the code logic into the flow chart visualization interface, the code readability and the process accuracy are improved, the management of the development process is optimized, the reference basis for code quantification is increased, after the flow chart is displayed, the code data corresponding to each step can be displayed according to the user requirement, and the user can check and correct conveniently.
Drawings
The accompanying drawings are included to provide a further understanding of the specification, and are incorporated in and constitute a part of this specification. In the drawings:
FIG. 1 shows a flow chart of a code data processing method in an embodiment of the present specification;
FIG. 2 is a schematic diagram of a data flow diagram visualization interface generated by the code data processing method in one embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of a code data processing apparatus in an embodiment of the present specification;
fig. 4 shows a schematic diagram of a computer device in an embodiment of the present description.
Detailed Description
The principles and spirit of the present specification will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are presented merely to enable one skilled in the art to better understand and practice the present description, and are not intended to limit the scope of the present description in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Those skilled in the art will appreciate that the embodiments of the present description may be implemented as a system, apparatus, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: complete hardware, complete software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
The embodiment of the specification provides a code data processing method. Fig. 1 shows a flowchart of a code data processing method in an embodiment of the present specification. Although the present description provides methods and apparatus structures as shown in the following examples or figures, more or fewer steps or modular units may be included in the methods or apparatus based on conventional or non-inventive labor. In the steps or the structures of the apparatuses, which logically do not have the necessary cause and effect relationship, the execution order or the structure of the modules of the apparatuses are not limited to the execution order or the structure of the modules shown in the drawings and described in the embodiments of the present specification. The described methods or module structures may be implemented sequentially or in parallel (e.g., in a parallel processor or multithreaded environment, or even in a distributed processing environment) in accordance with the embodiments or the method or module structure connection illustrated in the figures when implemented in a practical device or end product application.
Specifically, as shown in fig. 1, the code data processing method provided in an embodiment of the present disclosure may include the following steps:
step S101, acquiring program code data to be processed; the program code data includes a plurality of code blocks.
The method in the embodiments of the present specification may be applied to a computer device. The computer device may be a server or a client with arithmetic processing capabilities.
The computer device may obtain program code data to be processed. The program code data may be stored locally or in a remote database. The program code data may include a plurality of code blocks. The code blocks may encapsulate the logic statements in a method body, surrounded by { }. However, unlike methods, code blocks have no method name, no return value, no parameters, only method body, and no call is displayed by object or class, but rather is implicitly invoked when a class is loaded or when an object is created.
In this embodiment, the code blocks may encapsulate one flow or encapsulate one flow step.
In some embodiments of the present description, the code blocks include a code block start description and an end description. The start instruction carries the code block identifier, the flow identifier, the logic instruction and the code block dependency relationship. And the ending instruction carries the code block identifier. Code data corresponding to the code blocks is included between the beginning description and the ending description, and the code data can be one or more lines of code data.
Step S102, scanning and analyzing the program code data to obtain a program scanning file; element information of each code block in the plurality of code blocks is recorded in the program scanning file; the element information includes code block identification, flow identification, logic description and code block dependency.
The computer device may perform a scan analysis of the program code data to obtain a program scan file. The program scan file can be used to route element information for each of a plurality of code blocks.
In some embodiments of the present disclosure, the program scan file is a Json file or a JavaScript file. The file type of the program scanning file is an ordered and structural file, and can be a Json file or a JavaScript file, so that the subsequent identification and analysis are facilitated.
In this embodiment, the element information may include a code block identifier, a flow identifier, a logic description, and a code block dependency.
Wherein the code block identification may be used to uniquely identify the code block.
The flow identification may be used to identify the flow described by the code block.
Logic instructions are provided to indicate the flow or step instructions that a code block can implement.
In some embodiments of the present description, the code block dependency includes a parent node code block identification and/or a child node code block identification of the code block. By including the parent node code block identification and/or the child node code block identification, the sequence and the dependency relationship between the code blocks can be clearly acquired.
Step S103, based on the element information in the program scanning file, generating a data flow chart visualization interface corresponding to the program code data.
After the program scan file is obtained by scanning, a data flow chart visualization interface corresponding to the program code data can be generated based on the element information in the program scan file.
In some embodiments of the present disclosure, generating a data flow chart visualization interface corresponding to the program code data based on the element information in the program scan file may include: and loading and identifying the program scanning file by utilizing a front-end user interface plug-in integrated in the IDEA development tool so as to generate a data flow diagram visualization interface corresponding to the program code data.
The corresponding front-end user interface plug-in can be designed in advance, and loading identification can be carried out on the program scanning file, so that a data flow chart visualization interface corresponding to the program code data is generated. The front-end user interface plug-in may extract the logical specification and code block dependencies corresponding to the code blocks, thereby generating a logic-compliant flow chart.
In some embodiments of the present description, the code block identification and/or the logical description of the code block is presented in a node of the dataflow diagram visualization interface. By displaying the code block identification and/or the logic description of the code block, the user can understand the code data conveniently, and the readability is enhanced.
Step S104, code data of a code block corresponding to a node in the data flow chart visualization interface is obtained; converting the code data of the code block into code pictures; and responding to a first click operation of a user on a node in the data flow chart visualization interface, and displaying a floating layer of the bullet frame so as to display a code picture corresponding to the node.
Specifically, after the data flow chart visualization interface is displayed, code data of code blocks corresponding to each node in the plurality of nodes in the data flow chart visualization interface may be obtained. The code data corresponding to each node can be converted into a picture type to obtain a code picture. After a first click operation of a certain node in the data flow diagram visualization interface by a user, a floating layer of the bullet frame can be displayed in response to the operation so as to display a code picture corresponding to the node. Wherein the first clicking operation may include one of: a single click operation, a double click operation, a right click operation, and a touch operation. After the flow chart is displayed, code data corresponding to each step can be displayed according to the user requirement, so that the user can check and correct conveniently.
In the above embodiment, the program code data is divided into a plurality of processes or a plurality of process steps by the code blocks, the program code data is scanned to generate the program scan file containing the element information corresponding to each of the plurality of code blocks, and then the data flow chart visualization interface can be generated based on the element information in the program scan file. In the scheme, the development process and the business process can be tightly combined by converting the code logic into the flow chart visual interface, the code readability and the process accuracy are improved, the management of the development process is optimized, and the reference basis for code quantification is increased. After the flow chart is displayed, code data corresponding to each step can be displayed according to the user requirement, so that the user can check and correct conveniently.
In some embodiments of the present description, the element information may further include positioning information. The positioning information may include: the name of the class in which the code block is located, the absolute path of the class relative to the project and/or the line information in which the code block starts and ends.
Correspondingly, the code data processing method may further include: acquiring positioning information of a code block corresponding to the node; converting the code data of the code block into a positioning information picture; and responding to a second click operation of the user on the node in the data flow chart visualization interface, displaying a floating layer of the popup frame so as to display the positioning information picture.
After the data flow chart visualization interface is displayed, positioning information of code blocks corresponding to each node in the plurality of nodes in the data flow chart visualization interface can be obtained. The positioning information corresponding to each node can be converted into a picture type to obtain a positioning information picture. After a second click operation of a certain node in the data flow diagram visualization interface by the user, the floating layer of the bullet frame can be displayed in response to the operation so as to display positioning information corresponding to the node. Wherein the second click operation may include one of: single click, double click, right click.
In this embodiment, after the flowchart is displayed, the position information of the code data corresponding to each step may be displayed according to the user requirement, so that the user may conveniently and quickly find the corresponding code data through the positioning information.
In some embodiments of the present disclosure, generating a data flow chart visualization interface corresponding to the program code data based on the element information in the program scan file may include: dividing the code blocks into corresponding processes based on the process identification in the program scanning file to obtain a plurality of processes; and generating a data flow chart visualization interface corresponding to each flow based on the code block identification, the logic description and the code block dependency relationship of the code blocks in each flow.
Specifically, the program code file may include code data corresponding to each flow in the multiple flows, and the scanned program scan file includes element information of code blocks corresponding to each flow.
The method can divide a plurality of code blocks in the program code file based on the flow marks in the program scanning file to obtain element information of the code blocks corresponding to each flow. Then, a data flow diagram visualization interface corresponding to each flow may be generated based on the code block identification, the logic description, and the code block dependency of the code blocks in each flow of the plurality of flows.
In this embodiment, a plurality of corresponding data flow chart visualization interfaces may be generated for program code data including a plurality of flows.
In some embodiments of the present description, the element information further includes a logical type of the code block; correspondingly, when the data flow chart visualization interface corresponding to each flow is generated, determining the shape of the node corresponding to the code block according to the logic type of the code block.
When the visualization interface of the data flow chart is generated, the shape of the node corresponding to the code block can be determined according to the logic type of the code block. For example, for a general step, the shape of the node may be rectangular, for a judgment step, the shape of the node may be diamond, or the like.
In this embodiment, the node shape is determined by the logic type, so that the legibility and accuracy of the flow chart can be further improved.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. Specific reference may be made to the foregoing description of related embodiments of the related process, which is not described herein in detail.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The above method is described below in connection with a specific embodiment, however, it should be noted that this specific embodiment is only for better illustrating the present specification and should not be construed as unduly limiting the present specification.
A flowchart of a code data processing method is provided in this embodiment. In this embodiment, the processing flow will be described by way of code blocks, and may include the following steps.
Step one, a code block is defined, which consists of CodeStart and CodeEnd.
codeStart ("code block id", "code block description", "flow id", "flow description", "logic type", "sequence of steps", "parent node code block id")
CodeEnd ("code block id")
The code block is the minimum unit, a row of codes can be arranged between the codeSatrt and the codeEnd, and a plurality of methods can be arranged, depending on the dimension which a user wants to extract, the realization of the flow logic does not pay attention to the complexity of the codes, what is important is that the start and end of the start are described, and the parent-child nodes are obviously marked in the code block, so that the code block can be used according to requirements.
For loop logic, processing modes such as loops and the like can be placed in the same code block to be used as a whole logic; the loop can be put into a code block to be used as a parent node, the logic in the loop is provided with a plurality of small code blocks to be used as child nodes, and the belonging relation is marked by the ids of the parent nodes of the inner code block and the outer code block.
And step two, planning which codes are a code block by the code layer.
CodeStart ("orderSave-3", "determine if an order exists", "OrderSave", "order flow", "01-determine", "1",)
Logic 3, judging whether the local database has codes of related orders.
CodeEnd(“orderSave-3”)
CodeStart ("orderSave-4", "order number generated", "OrderSave", "order flow", "02-save", "2", "orderSave-3")
Logic 4. Generating order number related codes.
CodeEnd(“orderSave-4”)
Step three: codeStart and CodeEnd are extracted, and a visual interface is generated after the program is started, and all specified flowcharts are concerned. A complete flow chart is also included as a flow ID. And clicking on each node can directly display the code block content and directly locate which file which class/method, which row. Two logics declare the code block as in step two.
In a program code file, a plurality of small processes may be wrapped with code blocks in a complex process. After marking according to the attribute, the annotation and method for scanning the code blocks can be added in the startup class when the program starts, all the places where all the code blocks (including CodeStart and CodeEnd) are scanned, and a local file (CodeScan file) can be stored after scanning. The file type is an ordered and structured file, and may be a Json file or JavaScript file. The scanned and saved contents include information such as item name, class name where the code block is located, absolute path of class relative to project, line information where the code block starts and ends, contents wrapped in the block, attribute elements described by the code block, etc., and the CodeStart and CodeEnd of the same code block ID are a group, so there must be a start and an end.
After storing all this information, a visual way can be achieved by means of the plug-in. For example, the development tool is IDEA, and it is assumed that a plug-in with a VUE-UI (VUE is the front end) can be integrated into IDEA, and code block files that have just been scanned and saved can be loaded and identified, and the function of the front end plug-in is to generate UI pages according to the saved id, the content of the code block, the logic type (the type of the code block can determine whether the generated effect is rectangular or judging diamond, etc.), and generate a web page complementary to each other after the program is started, so that the displayed effect can be completed. At this time, attribute element information marked by CodeSatrt and CodeEnd is displayed on the flowchart, and the flowchart shown in fig. 2 is formed according to the code block ID, parent node ID, logic type and logic description.
As shown in FIG. 2, the contents shown in the flow chart are elements extracted from the code block, and a frame can be popped up by clicking on a node of one shape, and the contents in the frame are the codes contained in the code block and display the information (stored in the CodeScan file previously) such as the position of the original code project where the code block is located
Because the code class file is not a class file after the compiling after the program is started, and the use of the flow chart is not only provided for programmers (personnel with codes), the line where the class file is not opened directly and the code block is displayed is positioned, but the code content in the code block is checked through the form of displaying the picture type by a bullet frame, and the position information of the code block can be displayed.
The flow logic visualization scheme in the embodiment can quickly and clearly develop a flow, directly position, and extract code logic into a graphic structure, and is not limited to a flow chart. The scheme is added in complex logic or in places needing to be exposed, so that code readability can be improved, management of a development process is optimized, and reference basis for code quantification is increased.
Based on the same inventive concept, a code data processing apparatus is also provided in the embodiments of the present specification, as described in the following embodiments. Since the principle of the code data processing apparatus for solving the problem is similar to that of the code data processing method, the implementation of the code data processing apparatus can refer to the implementation of the code data processing method, and the repetition is omitted. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements the intended function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated. Fig. 3 is a block diagram of a code data processing apparatus of an embodiment of the present specification, as shown in fig. 3, including: the structure of the acquisition module 301, the scanning module 302, the generation module 303, and the presentation module 304 is described below.
The acquiring module 301 is configured to acquire program code data to be processed; the program code data includes a plurality of code blocks.
The scanning module 302 is configured to perform scanning analysis on the program code data to obtain a program scanning file; element information of each code block in the plurality of code blocks is recorded in the program scanning file; the element information comprises code block identification, flow identification, logic description and code block dependency relationship.
The generating module 303 is configured to generate a data flow chart visualization interface corresponding to the program code data based on the element information in the program scan file.
The display module 304 is configured to obtain code data of a code block corresponding to a node in the visualization interface of the dataflow diagram; converting the code data of the code block into code pictures; and responding to a first click operation of a user on a node in the data flow chart visualization interface, and displaying a floating layer of the bullet frame so as to display a code picture corresponding to the node.
In this embodiment, the program code data is divided into a plurality of processes or a plurality of process steps by the code blocks, the program code data is scanned to generate a program scan file containing element information corresponding to each of the code blocks, and then a data flow chart visual interface can be generated based on the element information in the program scan file. By converting the code logic into a flow chart visual interface, the development process and the business flow can be tightly combined, the code readability and the flow accuracy are improved, the management of the development process is optimized, and the reference basis for code quantification is increased. After the flow chart is displayed, code data corresponding to each step can be displayed according to the user requirement, so that the user can check and correct conveniently.
In some embodiments of the present description, the first clicking operation includes one of: a single click operation, a double click operation, a right click operation, and a touch operation.
In some embodiments of the present description, the element information further includes positioning information, the positioning information including: the name of the class where the code block is located, the absolute path of the class relative to the project and/or the row information where the code block starts and ends;
correspondingly, the device further comprises a display module, wherein the display module is specifically used for: acquiring positioning information of a code block corresponding to the node; converting the code data of the code block into a positioning information picture; and responding to a second click operation of the user on the node in the data flow chart visualization interface, displaying a floating layer of the popup frame so as to display the positioning information picture.
In some embodiments of the present description, the generating module may be specifically configured to: dividing the code blocks into corresponding processes based on the process identification in the program scanning file to obtain a plurality of processes; and generating a data flow chart visualization interface corresponding to each flow based on the code block identification, the logic description and the code block dependency relationship of the code blocks in each flow.
In some embodiments of the present description, the element information further includes a logical type of the code block; correspondingly, when the generating module generates the data flow chart visualization interface corresponding to each flow, determining the shape of the node corresponding to the code block according to the logic type of the code block.
In some embodiments of the present description, the generating module may be specifically configured to: and loading and identifying the program scanning file by utilizing a front-end user interface plug-in integrated in the IDEA development tool so as to generate a data flow diagram visualization interface corresponding to the program code data.
In some embodiments of the present description, the code block identification and/or the logical description of the code block is presented in a node of the dataflow diagram visualization interface.
In some embodiments of the present description, the code block dependency includes a parent node code block identification and/or a child node code block identification of the code block.
In some embodiments of the present disclosure, the program scan file is a Json file or a JavaScript file.
In some embodiments of the present specification, the code blocks include a code block start instruction and an end instruction; the start instruction carries the code block identifier, the flow identifier, the logic instruction and the code block dependency relationship; and the ending instruction carries the code block identifier.
From the above description, it can be seen that the following technical effects are achieved in the embodiments of the present specification: the program code data is divided into a plurality of processes or a plurality of process steps by the code blocks, a program scanning file containing element information corresponding to each code block in the plurality of code blocks is generated by scanning the program code data, and then a data flow chart visual interface can be generated based on the element information in the program scanning file. By converting the code logic into a flow chart visual interface, the development process and the business flow can be tightly combined, the code readability and the flow accuracy are improved, the management of the development process is optimized, and the reference basis for code quantification is increased. After the flow chart is displayed, code data corresponding to each step can be displayed according to the user requirement, so that the user can check and correct conveniently.
The embodiment of the present disclosure further provides a schematic structural diagram of a computer device, which may specifically refer to fig. 4, where the schematic structural diagram is based on the code data processing method provided by the embodiment of the present disclosure, and the computer device may specifically include an input device 41, a processor 42, and a memory 43. Wherein the memory 43 is for storing processor executable instructions. The processor 42, when executing the instructions, implements the steps of the code data processing method described in any of the embodiments above.
In this embodiment, the input device may specifically be one of the main apparatuses for exchanging information between the user and the computer system. The input device may include a keyboard, mouse, camera, scanner, light pen, handwriting input board, voice input device, etc.; the input device is used to input raw data and a program for processing these numbers into the computer. The input device may also acquire and receive data transmitted from other modules, units, and devices. The processor may be implemented in any suitable manner. For example, the processor may take the form of, for example, a microprocessor or processor, and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable logic controller, and an embedded microcontroller, among others. The memory may in particular be a memory device for storing information in modern information technology. The memory may comprise a plurality of levels, and in a digital system, may be memory as long as binary data can be stored; in an integrated circuit, a circuit with a memory function without a physical form is also called a memory, such as a RAM, a FIFO, etc.; in the system, the storage device in physical form is also called a memory, such as a memory bank, a TF card, and the like.
In this embodiment, the specific functions and effects of the computer device may be explained in comparison with other embodiments, and will not be described herein.
There is also provided in the present description a computer storage medium based on a code data processing method, the computer storage medium storing computer program instructions which, when executed by a processor, implement the steps of the code data processing method as described in any of the embodiments above.
In the present embodiment, the storage medium includes, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read-Only Memory (ROM), a Cache (Cache), a Hard Disk (HDD), or a Memory Card (Memory Card). The memory may be used to store computer program instructions. The network communication unit may be an interface for performing network connection communication, which is set in accordance with a standard prescribed by a communication protocol.
In this embodiment, the functions and effects of the program instructions stored in the computer storage medium may be explained in comparison with other embodiments, and are not described herein.
The present description also provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the low code platform based application deployment method described in any of the embodiments above.
It will be apparent to those skilled in the art that the modules or steps of the embodiments described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module. Thus, embodiments of the present specification are not limited to any specific combination of hardware and software.
It is to be understood that the above description is intended to be illustrative, and not restrictive. Many embodiments and many applications other than the examples provided will be apparent to those of skill in the art upon reading the above description. The scope of the disclosure should, therefore, be determined not with reference to the above description, but instead should be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the embodiments of the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the protection scope of the present specification.
Claims (15)
1. A code data processing method, comprising:
acquiring program code data to be processed; the program code data comprises a plurality of code blocks;
scanning and analyzing the program code data to obtain a program scanning file; element information of each code block in the plurality of code blocks is recorded in the program scanning file; the element information comprises a code block identifier, a flow identifier, code data of a code block, a logic description and a code block dependency relationship;
generating a data flow chart visualization interface corresponding to the program code data based on the element information in the program scanning file;
acquiring code data of a code block corresponding to a node in the data flow chart visualization interface; converting the code data of the code block into code pictures; and responding to a first click operation of a user on a node in the data flow chart visualization interface, and displaying a floating layer of the bullet frame so as to display a code picture corresponding to the node.
2. The code data processing method of claim 1, wherein the first click operation comprises one of: a single click operation, a double click operation, a right click operation, and a touch operation.
3. The code data processing method according to claim 1, wherein the element information further includes positioning information including: the name of the class where the code block is located, the absolute path of the class relative to the project and/or the row information where the code block starts and ends;
correspondingly, the method further comprises the steps of:
acquiring positioning information of a code block corresponding to the node;
converting the code data of the code block into a positioning information picture;
and responding to a second click operation of the user on the node in the data flow chart visualization interface, displaying a floating layer of the popup frame so as to display the positioning information picture.
4. The code data processing method according to claim 1, wherein generating a data flow chart visualization interface corresponding to the program code data based on element information in the program scan file includes:
dividing the code blocks into corresponding processes based on the process identification in the program scanning file to obtain a plurality of processes;
and generating a data flow chart visualization interface corresponding to each flow based on the code block identification, the logic description and the code block dependency relationship of the code blocks in each flow.
5. The code data processing method according to claim 4, wherein the element information further includes a logical type of the code block; correspondingly, when the data flow chart visualization interface corresponding to each flow is generated, determining the shape of the node corresponding to the code block according to the logic type of the code block.
6. The code data processing method according to claim 1, wherein generating a data flow chart visualization interface corresponding to the program code data based on element information in the program scan file includes:
and loading and identifying the program scanning file by utilizing a front-end user interface plug-in integrated in the IDEA development tool so as to generate a data flow diagram visualization interface corresponding to the program code data.
7. A code data processing method according to claim 1, characterized in that the code block identification and/or the logical description of the code block is presented in a node of the data flow diagram visualization interface.
8. A code data processing method according to claim 1, wherein the code block dependency comprises a parent node code block identity and/or a child node code block identity of the code block.
9. The code data processing method according to claim 1, wherein the program scan file is a Json file or a JavaScript file.
10. The code data processing method according to claim 1, wherein the code blocks include a code block start instruction and an end instruction; the start instruction carries the code block identifier, the flow identifier, the logic instruction and the code block dependency relationship; and the ending instruction carries the code block identifier.
11. A code data processing apparatus, comprising:
the acquisition module is used for acquiring the program code data to be processed; the program code data comprises a plurality of code blocks;
the scanning module is used for carrying out scanning analysis on the program code data to obtain a program scanning file; element information of each code block in the plurality of code blocks is recorded in the program scanning file; the element information comprises a code block identifier, a flow identifier, code data of a code block, a logic description and a code block dependency relationship;
the generation module is used for generating a data flow chart visualization interface corresponding to the program code data based on the element information in the program scanning file;
the display module is used for acquiring code data of the code blocks corresponding to the nodes in the data flow chart visualization interface; converting the code data of the code block into code pictures; and responding to a first click operation of a user on a node in the data flow chart visualization interface, and displaying a floating layer of the bullet frame so as to display a code picture corresponding to the node.
12. The code data processing apparatus of claim 11, wherein the element information further includes positioning information, the positioning information including: the name of the class where the code block is located, the absolute path of the class relative to the project and/or the row information where the code block starts and ends;
correspondingly, the display module is further used for: acquiring positioning information of a code block corresponding to the node; converting the code data of the code block into a positioning information picture; and responding to a second click operation of the user on the node in the data flow chart visualization interface, displaying a floating layer of the popup frame so as to display the positioning information picture.
13. A computer device comprising a processor and a memory for storing processor-executable instructions which when executed by the processor implement the steps of the method of any one of claims 1 to 10.
14. A computer readable storage medium having stored thereon computer instructions, which when executed by a processor, implement the steps of the method of any of claims 1 to 10.
15. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method of any of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310770090.1A CN116795377A (en) | 2023-06-27 | 2023-06-27 | Code data processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310770090.1A CN116795377A (en) | 2023-06-27 | 2023-06-27 | Code data processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116795377A true CN116795377A (en) | 2023-09-22 |
Family
ID=88037225
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310770090.1A Pending CN116795377A (en) | 2023-06-27 | 2023-06-27 | Code data processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116795377A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117331559A (en) * | 2023-11-06 | 2024-01-02 | 久方智能(广东)有限公司 | Method for generating application interface by front end code-free |
-
2023
- 2023-06-27 CN CN202310770090.1A patent/CN116795377A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117331559A (en) * | 2023-11-06 | 2024-01-02 | 久方智能(广东)有限公司 | Method for generating application interface by front end code-free |
CN117331559B (en) * | 2023-11-06 | 2024-05-03 | 久方智能(广东)有限公司 | Method for generating application interface by front end code-free |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3433732B1 (en) | Converting visual diagrams into code | |
US20220206923A1 (en) | Operation logs visualization device, operation logs visualization method and operation logs visualization program | |
CN111191410A (en) | System and method for computing a notebook interface and computer readable medium thereof | |
CN108319687B (en) | SQL rule generator based on JS dragging technology | |
CN110399063B (en) | Method and device for viewing page element attributes | |
Beeley et al. | Web Application Development with R Using Shiny: Build stunning graphics and interactive data visualizations to deliver cutting-edge analytics | |
US20160188299A1 (en) | System And Method For Automatic Extraction Of Software Design From Requirements | |
CN112445693B (en) | Page update detection method, device, equipment and storage medium | |
CN116841536B (en) | Component reference relation reconstruction method, device, system and storage medium | |
CN113018870A (en) | Data processing method and device and computer readable storage medium | |
CN116795377A (en) | Code data processing method and device | |
CN114020256A (en) | Front-end page generation method, device and equipment and readable storage medium | |
CN115268873A (en) | Low-code file development method based on multi-person cooperation | |
CN116009852A (en) | Code construction method, device, computer equipment and storage medium | |
US11604662B2 (en) | System and method for accelerating modernization of user interfaces in a computing environment | |
US20180137036A1 (en) | Determining potential test actions | |
CN113254016A (en) | Interface generation method, interface information processing method, equipment and storage medium | |
JP4846029B2 (en) | Operation verification apparatus, operation verification method, and operation verification program | |
CN108509460A (en) | Data consistent check in distributed system | |
US11544179B2 (en) | Source traceability-based impact analysis | |
Bragagnolo et al. | Challenges for layout validation: Lessons learned | |
JP2005122398A (en) | Dynamic document generating program, recording medium thereof, dynamic document generating device, and dynamic document generating method | |
US9536330B2 (en) | Program information generation system, method for program information generation, program for program information generation, and program information display system for displaying the execution status of a program | |
CN116679852B (en) | Project icon quotation method and device, electronic equipment and medium | |
US20240126978A1 (en) | Determining attributes for elements of displayable content and adding them to an accessibility tree |
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 |