Code analysis method and device, electronic equipment and storage medium
By generating and detecting the target process structure diagram, the problem in the existing technology that the correlation impact analysis results of business requirement changes are difficult to provide quickly is solved, the reliability and efficiency of the assessment are improved, and the risk of manual judgment is reduced.
Patent Information
- Application Number
- CN202410738462.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-17
AI Technical Summary
Existing technology cannot quickly provide impact analysis results related to changes in business requirements, and relies on human judgment based on experience or searching engineering codes when changing business process nodes, which has limitations and risks.
By generating a target process structure diagram when a target code change is detected, and detecting it, if there is an exception, an exception prompt message is generated, and a graphical user interface is used to display the scope of impact, thereby improving the reliability and efficiency of the assessment.
The evaluation of demand changes is more reliable, efficient and comprehensive, and the risk of manual judgment is reduced.
Smart Images

Figure CN118656114A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of code analysis, and in particular to a method, device, electronic device and storage medium for code analysis. Background Art
[0002] With the rapid development of the economy, the business of banks and other financial institutions is also increasing, and the demand for the development of financial-related systems is also increasing. After the development of financial-related systems is completed, business requirements will change with the replacement of versions. When business requirements change, it is necessary to conduct a correlation impact analysis of the requirements change.
[0003] The impact analysis of demand changes refers to the analysis and evaluation of the impact scope of the original business process changes by R&D personnel when receiving business demand changes. On the one hand, the industry's visual business process diagram tools, such as Visio and Drawio, only display business process diagrams and cannot quickly provide change impact analysis results. On the other hand, when a business process node is changed, the analysis results are often manually judged based on experience or searching engineering codes, which has certain limitations and risks. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a code analysis method, device, electronic device and storage medium to overcome the problems in the prior art.
[0005] In a first aspect, an embodiment of the present application provides a method for code analysis, the method comprising:
[0006] When a change in the target code is detected, a target flow structure diagram corresponding to the target code is displayed on the graphical user interface;
[0007] In response to the flowchart detection operation, the target flowchart is detected; when there is an abnormality in the target flowchart, target abnormality prompt information is generated.
[0008] In some technical solutions of the present application, the above method generates the target process structure diagram in the following manner:
[0009] In response to the code flow structure specification generation operation, a code flow structure specification is determined; and the R&D personnel write and generate target code under the code flow structure specification;
[0010] Scanning the target code according to a preset flowchart node specification to determine a first node set in the target code;
[0011] A target flow structure diagram of the target code is generated according to each first node included in the first node set.
[0012] In some technical solutions of the present application, the target flow structure diagram of the target code is generated according to each first node included in the first node set, including:
[0013] Determine the sequence of each box in the target process structure diagram according to the superior-subordinate association relationship between each first node included in the first node set;
[0014] The blocks are connected in sequence according to the determined sequence to generate the target process structure diagram.
[0015] In some technical solutions of the present application, the above method further includes:
[0016] Scanning the first node to determine a set of second nodes included in the first node;
[0017] Scanning the second nodes included in the second node set again until the nodes no longer contain scannable nodes included in the flowchart node specification, and obtaining nodes of each level included in the target code;
[0018] A target flow structure diagram of the target code is generated according to nodes at each level.
[0019] In some technical solutions of the present application, the above method detects the target process structure diagram in the following manner:
[0020] In response to the selection operation, detecting a target box node selected from the target process structure diagram and a code service corresponding to the target box node;
[0021] If the target box node is inconsistent with the code service corresponding to the target box node, then there is an abnormality in the target box node.
[0022] In some technical solutions of the present application, the above method generates target abnormality prompt information in the following manner:
[0023] Generate first abnormal prompt information according to the target box node;
[0024] Generate second abnormal prompt information according to the associated box node having an influence relationship with the target box node;
[0025] The target abnormal prompt information is obtained according to the first abnormal prompt information and the second abnormal prompt information, and is displayed on a graphical user interface.
[0026] In some technical solutions of this application, the above method is demonstrated in the following ways:
[0027] Displaying the first abnormal prompt information using a first display method;
[0028] The second abnormal prompt information is displayed using a second display method.
[0029] In a second aspect, an embodiment of the present application provides a device for code analysis, the device comprising:
[0030] A first detection module, configured to display a target flow structure diagram corresponding to the target code on the graphical user interface when a target code change is detected;
[0031] The second detection module is used to detect the target flow chart structure diagram in response to the flow chart detection operation; when the target flow chart structure diagram has an abnormality, generate target abnormality prompt information.
[0032] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned code analysis method when executing the computer program.
[0033] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned code analysis method are executed.
[0034] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0035] The method of the present application includes displaying a target flow structure diagram corresponding to the target code on the graphical user interface when a target code change is detected; detecting the target flow structure diagram in response to a flow chart detection operation; and generating target abnormality prompt information when an abnormality exists in the target flow structure diagram.
[0036] This application detects the target process structure diagram to determine whether there are any anomalies in the flow chart. The assessment of demand changes is more reliable, efficient and comprehensive than manual evaluation.
[0037] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of a code analysis method provided in an embodiment of the present application is shown;
[0040] Figure 2 A standard schematic diagram provided by an embodiment of the present application is shown;
[0041] Figure 3 A schematic diagram of a code analysis device provided in an embodiment of the present application is shown;
[0042] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0044] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0045] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0046] The impact analysis of demand changes refers to the analysis and evaluation of the impact scope of the original business process changes by R&D personnel when receiving business demand changes. On the one hand, the industry's visual business process diagram tools, such as Visio and Drawio, only display business process diagrams and cannot quickly provide change impact analysis results. On the other hand, when a business process node is changed, the analysis results are often manually judged based on experience or searching engineering codes, which has certain limitations and risks.
[0047] Based on this, the embodiments of the present application provide a method, device, electronic device and storage medium for code analysis, which are described below through embodiments.
[0048] Figure 1 A schematic flow chart of a code analysis method provided in an embodiment of the present application is shown, wherein the method includes steps S101-S102; specifically:
[0049] S101, when a target code change is detected, a target flow structure diagram corresponding to the target code is displayed on the graphical user interface;
[0050] S102. In response to a flowchart detection operation, the target flowchart is detected; when an abnormality exists in the target flowchart, target abnormality prompt information is generated.
[0051] This application detects the target process structure diagram to determine whether there are any anomalies in the flow chart. The assessment of demand changes is more reliable, efficient and comprehensive than manual evaluation.
[0052] Some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0053] In order to efficiently generate code flow charts, the embodiment of the present application first sets up code flow structure specifications suitable for the business according to business needs. Different code flow structure specifications can be set for different business needs. For example, the current directory structure of the industry is based on controller->action->service, that is, the controller receives the request, distributes it to the specific business action, and then calls the service. On this basis, the relevant specifications are defined: encapsulate the common controller class, uniformly receive peripheral system requests, and then distribute them to the specific business process Action class according to the custom matching rules. The Action class is a bridge between user requests and business logic, and each Action acts as a business agent for the customer. The Action layer assembles business processes, that is, connects service services with different functions in series to complete the business. Without doing too much logical processing, it can quickly assemble to complete the function development. The service layer is an atomic service, and it must be designed with high reusability. Specific specifications such as Figure 2 shown.
[0054] After setting the code flow structure specification, you also need to set the flowchart node specification. The specific setting can be one business flow chart corresponding to one Action, and one service corresponding to one node. The business flow chart must be defined as a specification, and the name of the flowchart is the business Action class name actually defined by the R&D personnel. The node in the flowchart must be defined as a specification, and the name of the node is the service class name actually defined by the R&D personnel.
[0055] After determining the above specifications, R&D personnel need to encode the code according to the above specifications and generate target code that meets the above specifications.
[0056] After the target code is generated, the target code is scanned and the first node set is extracted from the target code. This scan is the first scan, which scans the code flow (Action class), collects the service Service class name set, and marks the superior-subordinate relationship of each service Service class according to the rules, that is, which Service class is the upper-level node of the current Service class, and which Service class is the lower-level node, and then saves this relationship data in the database. After the first node set is determined, the initial flow chart of the target code is generated according to each first node contained in the first node set. The specific generation process here is the generation technology in the prior art. When generating the flow chart, the embodiment of the present application determines the order of each box in the initial flow chart according to the superior-subordinate relationship between each first node contained in the first node set; then connects each box in sequence according to the determined order of order to generate the initial flow chart.
[0057] In an optional embodiment, the above-mentioned scan is only the first scan, which mainly scans out the first node from the target code, mainly the Service class name set. There may also be branch nodes of the flowchart in each Service class. Therefore, the embodiment of the present application also needs to detect each first node contained in the first set again. Get the second node set contained in the first node. After obtaining the second node set, it is necessary to detect the second node contained in the second node set again. Determine the third node set from the second node, and then detect the third node in the third node set, determine the fourth node set from the third node, and so on. Detect in a loop until no nodes in the above specifications can be detected. At this time, the nodes at all levels contained in the target code can be obtained. Then generate the initial flowchart according to the nodes at all levels.
[0058] After obtaining the target code and the initial flowchart of the target code, business requirements may change during the actual development process. When business requirements change, the target code needs to be modified, updated, etc. At this time, the R&D personnel need to modify the target code. When the target code change is detected, it is necessary to generate the target flow structure diagram of the target code after the change based on the target code after the change. The specific generation process is the same as the above-mentioned method of generating the initial flowchart.
[0059] After the target flow structure diagram of the target code after the change is generated, it is displayed on the user graphical interface. After the user sees the target flow structure diagram on the graphical user interface, the target flow structure diagram can be selectively tested. That is, the user can perform flow chart selection operations using a mouse or keyboard, etc., and select one or more box nodes from the target flow structure diagram. The box node selected by the user is called the target box node, and the target box node is the one that needs to be tested.
[0060] When performing the specific detection, the embodiment of the present application detects the target box node selected by the user and the code service corresponding to the target box node. Because in the process of generating the target process structure diagram, the embodiment of the present application saves the association between the box node in the process diagram and the code service in the database, so the comparison at this time can be performed based on the content saved in the database. The association between the saved box node and the code service is compared with the target process structure diagram.
[0061] If the saved association relationship matches the target process structure Figure 1 If the saved association relationship is inconsistent with the target process structure diagram, it means that the target box node has not been modified, that is, the target box node is in a normal state. If the saved association relationship is inconsistent with the target process structure diagram, it means that the target box node has been modified, that is, the target box node is in an abnormal state.
[0062] When an abnormality is detected in the target box, in order to ensure the accuracy of the detection, the embodiment of the present application will also detect the associated box nodes with which the target box node has an impact relationship. Because after the target box node is modified, the associated box nodes with an impact relationship will be affected. The impact relationship here includes changes that will occur with the change of the target box node, specifically a calling relationship or a called relationship, etc.
[0063] After determining the associated box nodes that have an influence relationship with the target box node, the embodiment of the present application generates different abnormal prompt information when generating abnormal prompt information. Specifically, the first abnormal prompt information is generated according to the target box node, and the second abnormal prompt information is generated according to the associated box node. In order to facilitate the user to view the abnormal information, when displaying the abnormal prompt information, the embodiment of the present application also uses different display methods when displaying the first abnormal prompt information and the second abnormal prompt information. When displaying the first abnormal prompt information, the first display method is used. When displaying the second abnormal prompt information, the second display method is used. The first display method and the second display method here can be the same or different. In actual settings, in order to facilitate user viewing, it is generally selected to be set to be different.
[0064] When the first display mode is different from the second display mode, the display level of the first display mode is higher than the display level of the second display mode. The difference in display level here is mainly reflected in the degree of attraction to users. The higher the degree of attraction to users, the higher the display level. For example, the display level of red fonts is higher than that of black fonts.
[0065] In an optional implementation, during the specific implementation, the class name in the software engineering is located according to the name of the business process diagram, and then the service service assembled under the class name is checked and verified according to the upper and lower node relationship of the process diagram to see if it is consistent with the upper and lower node relationship of the process diagram. If it is inconsistent, an email reminder is triggered to make modifications. According to the upper and lower node association relationship (i.e., the node parent node or the current node child node) of the target process structure diagram saved in the database, the parent node information of the current node (assuming the changed node) is quickly queried, that is, the scope of change impact.
[0066] Figure 3 A schematic diagram of the structure of a code analysis device provided in an embodiment of the present application is shown, wherein the device comprises:
[0067] A first detection module, configured to display a target flow structure diagram corresponding to the target code on the graphical user interface when a target code change is detected;
[0068] The second detection module is used to detect the target flow chart structure diagram in response to the flow chart detection operation; when the target flow chart structure diagram has an abnormality, generate target abnormality prompt information.
[0069] The target process structure diagram is generated in the following way:
[0070] In response to the code flow structure specification generation operation, a code flow structure specification is determined; and the R&D personnel write and generate target code under the code flow structure specification;
[0071] Scanning the target code according to a preset flowchart node specification to determine a first node set in the target code;
[0072] A target flow structure diagram of the target code is generated according to each first node included in the first node set.
[0073] Generating a target flow structure diagram of the target code according to each first node included in the first node set includes:
[0074] Determine the sequence of each box in the target process structure diagram according to the superior-subordinate association relationship between each first node included in the first node set;
[0075] The blocks are connected in sequence according to the determined sequence to generate the target process structure diagram.
[0076] The first detection module is further used to scan the first node to determine a set of second nodes included in the first node;
[0077] Scanning the second nodes included in the second node set again until the nodes no longer contain scannable nodes included in the flowchart node specification, and obtaining nodes of each level included in the target code;
[0078] A target flow structure diagram of the target code is generated according to nodes at each level.
[0079] The target process structure diagram is detected by the following method:
[0080] In response to the selection operation, detecting a target box node selected from the target process structure diagram and a code service corresponding to the target box node;
[0081] If the target box node is inconsistent with the code service corresponding to the target box node, then there is an abnormality in the target box node.
[0082] Generate target exception prompt information in the following ways:
[0083] Generate first abnormal prompt information according to the target box node;
[0084] Generate second abnormal prompt information according to the associated box node having an influence relationship with the target box node;
[0085] The target abnormal prompt information is obtained according to the first abnormal prompt information and the second abnormal prompt information, and is displayed on a graphical user interface.
[0086] The following methods are used to display:
[0087] Using a first display method to display the first abnormal prompt information;
[0088] The second abnormal prompt information is displayed using a second display method.
[0089] like Figure 4 As shown, an embodiment of the present application provides an electronic device for executing the code analysis method in the present application, the device includes a memory, a processor, a bus, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0090] A method for code analysis, providing a graphical user interface through a terminal device, the method comprising:
[0091] When a change in the target code is detected, a target flow structure diagram corresponding to the target code is displayed on the graphical user interface;
[0092] In response to the flowchart detection operation, the target flowchart is detected; when there is an abnormality in the target flowchart, target abnormality prompt information is generated.
[0093] The method generates the target process structure diagram in the following manner:
[0094] In response to the code flow structure specification generation operation, a code flow structure specification is determined; and the R&D personnel write and generate target code under the code flow structure specification;
[0095] Scanning the target code according to a preset flowchart node specification to determine a first node set in the target code;
[0096] A target flow structure diagram of the target code is generated according to each first node included in the first node set.
[0097] Generating a target flow structure diagram of the target code according to each first node included in the first node set includes:
[0098] Determine the sequence of each box in the target process structure diagram according to the superior-subordinate association relationship between each first node included in the first node set;
[0099] The blocks are connected in sequence according to the determined sequence to generate the target process structure diagram.
[0100] The method further comprises:
[0101] Scanning the first node to determine a set of second nodes included in the first node;
[0102] Scanning the second nodes included in the second node set again until the nodes no longer contain scannable nodes included in the flowchart node specification, and obtaining nodes of each level included in the target code;
[0103] A target flow structure diagram of the target code is generated according to nodes at each level.
[0104] The method detects the target process structure diagram in the following manner:
[0105] In response to the selection operation, detecting a target box node selected from the target process structure diagram and a code service corresponding to the target box node;
[0106] If the target box node is inconsistent with the code service corresponding to the target box node, then there is an abnormality in the target box node.
[0107] The method generates target abnormality prompt information in the following way:
[0108] Generate first abnormal prompt information according to the target box node;
[0109] Generate second abnormal prompt information according to the associated box node having an influence relationship with the target box node;
[0110] The target abnormal prompt information is obtained according to the first abnormal prompt information and the second abnormal prompt information, and is displayed on a graphical user interface.
[0111] The method is demonstrated in the following way:
[0112] Using a first display method to display the first abnormal prompt information;
[0113] The second abnormal prompt information is displayed using a second display method.
[0114] Specifically, the above-mentioned memory and processor may be general-purpose memory and processor, which are not specifically limited here. When the processor runs the computer program stored in the memory, the above-mentioned code analysis method can be executed.
[0115] Corresponding to the code analysis method in the present application, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned code analysis method are executed.
[0116] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is executed, the following method steps can be executed:
[0117] A method for code analysis, providing a graphical user interface through a terminal device, the method comprising:
[0118] When a change in the target code is detected, a target flow structure diagram corresponding to the target code is displayed on the graphical user interface;
[0119] In response to the flowchart detection operation, the target flowchart is detected; when there is an abnormality in the target flowchart, target abnormality prompt information is generated.
[0120] The method generates the target process structure diagram in the following manner:
[0121] In response to the code flow structure specification generation operation, a code flow structure specification is determined; and the R&D personnel write and generate target code under the code flow structure specification;
[0122] Scanning the target code according to a preset flowchart node specification to determine a first node set in the target code;
[0123] A target flow structure diagram of the target code is generated according to each first node included in the first node set.
[0124] Generating a target flow structure diagram of the target code according to each first node included in the first node set includes:
[0125] Determine the sequence of each box in the target process structure diagram according to the superior-subordinate association relationship between each first node included in the first node set;
[0126] The blocks are connected in sequence according to the determined sequence to generate the target process structure diagram.
[0127] The method further comprises:
[0128] Scanning the first node to determine a set of second nodes included in the first node;
[0129] Scanning the second nodes included in the second node set again until the nodes no longer contain scannable nodes included in the flowchart node specification, and obtaining nodes of each level included in the target code;
[0130] A target flow structure diagram of the target code is generated according to nodes at each level.
[0131] The method detects the target process structure diagram in the following manner:
[0132] In response to the selection operation, detecting a target box node selected from the target process structure diagram and a code service corresponding to the target box node;
[0133] If the target box node is inconsistent with the code service corresponding to the target box node, then there is an abnormality in the target box node.
[0134] The method generates target abnormality prompt information in the following way:
[0135] Generate first abnormal prompt information according to the target box node;
[0136] Generate second abnormal prompt information according to the associated box node having an influence relationship with the target box node;
[0137] The target abnormal prompt information is obtained according to the first abnormal prompt information and the second abnormal prompt information, and is displayed on a graphical user interface.
[0138] The method is demonstrated in the following way:
[0139] Displaying the first abnormal prompt information using a first display method;
[0140] The second abnormal prompt information is displayed using a second display method.
[0141] In the embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0142] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0143] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0144] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0145] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0146] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A code analysis method, characterized in that: Providing a graphical user interface through a terminal device, the method comprising: When a change in the target code is detected, a target flow structure diagram corresponding to the target code is displayed on the graphical user interface; In response to the flowchart detection operation, the target flowchart is detected; when there is an abnormality in the target flowchart, target abnormality prompt information is generated.
2. The method according to claim 1, characterized in that The method generates the target process structure diagram in the following manner: In response to the code flow structure specification generation operation, a code flow structure specification is determined; and the R&D personnel write and generate target code under the code flow structure specification; Scanning the target code according to a preset flowchart node specification to determine a first node set in the target code; A target flow structure diagram of the target code is generated according to each first node included in the first node set.
3. The method according to claim 2, characterized in that Generating a target flow structure diagram of the target code according to each first node included in the first node set includes: Determine the sequence of each box in the target process structure diagram according to the superior-subordinate association relationship between each first node included in the first node set; The blocks are connected in sequence according to the determined sequence to generate the target process structure diagram.
4. The method according to claim 2, characterized in that: The method further comprises: Scanning the first node to determine a set of second nodes included in the first node; Scanning the second nodes included in the second node set again until the nodes no longer contain scannable nodes included in the flowchart node specification, and obtaining nodes of each level included in the target code; A target flow structure diagram of the target code is generated according to nodes at each level.
5. The method according to claim 1, characterized in that: The method detects the target process structure diagram in the following manner: In response to the selection operation, detecting a target box node selected from the target process structure diagram and a code service corresponding to the target box node; If the target box node is inconsistent with the code service corresponding to the target box node, then there is an abnormality in the target box node.
6. The method according to claim 5, characterized in that The method generates target abnormality prompt information in the following way: Generate first abnormal prompt information according to the target box node; Generate second abnormal prompt information according to the associated box node having an influence relationship with the target box node; The target abnormal prompt information is obtained according to the first abnormal prompt information and the second abnormal prompt information, and is displayed on a graphical user interface.
7. The method according to claim 6, characterized in that The method is demonstrated in the following way: Using a first display method to display the first abnormal prompt information; The second abnormal prompt information is displayed using a second display method.
8. A device for code analysis, characterized in that: The device comprises: A first detection module, configured to display a target flow structure diagram corresponding to the target code on the graphical user interface when a target code change is detected; The second detection module is used to detect the target flow chart structure diagram in response to the flow chart detection operation; when the target flow chart structure diagram has an abnormality, generate target abnormality prompt information.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the code analysis method as described in any one of claims 1 to 7 are performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the code analysis method as described in any one of claims 1 to 7.
Citation Information
Cited By
Visual compiling system for cloud intelligent screen operation chain tracking
CN121050729A
Visual compilation system for cloud smart screen operation chain tracking
CN121050729B
