Software engineering abnormal file dependency relationship determination method and device, equipment and medium

By generating directed acyclic graphs of software engineering and determining the dependencies of exception files, the problem of low compilation efficiency in software development is solved, and the software product compilation process is optimized.

CN120144133APending Publication Date: 2025-06-13ZHONGHUI SMART AN AUTOMOBILE TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510218515.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

In the field of software development, with the increase of engineering files, the compilation speed of software products gradually decreases, especially in compiled languages ​​such as C++, resulting in low compilation efficiency.

Method used

By obtaining each target file of the target software project, determining the header file it contains according to the special instructions contained in each file, generating a directed acyclic graph (DAG) of the target software project, and determining the abnormal file dependency based on the DAG.

Benefits of technology

By identifying and optimizing abnormal file dependencies, software developers can improve the compilation efficiency of software products, reduce duplicate parsing and redundant construction during the compilation process, thereby shortening compilation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144133A_ABST
    Figure CN120144133A_ABST
Patent Text Reader

Abstract

The invention provides a software engineering abnormal file dependency relationship determination method and device, equipment and a medium, and relates to the technical field of software development, the method comprises the following steps: obtaining each target file corresponding to a target software engineering; determining a plurality of files contained in each file according to the special instruction contained in each file; generating a directed acyclic graph corresponding to the target software project according to a plurality of files contained in each file; according to the directed acyclic graph corresponding to the target software project, determining an abnormal file dependency relationship corresponding to the target software project; according to the method and the device, after the dependency relationship of the abnormal files is determined, software developers can optimize the corresponding files according to the dependency relationship of the abnormal files, so that the compiling efficiency of software products is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and particularly to a method, device, equipment and medium for determining abnormal file dependency relationships in software engineering. Background Art

[0002] In the field of software development, the compilation speed of software engineering will consume more and more time as the number of engineering files increases, which is particularly evident in compiled languages such as C++; taking the C++ language as an example, the entire compilation process involves preprocessing, compilation, assembly, and linking. Among them, preprocessing is to process header files such as #include "X.h", replace the content of the X.h file into the file that calls the include instruction, and then proceed with the compilation process; however, in a software engineering file, there may be a situation where the A.h file includes the B.h file and the C.h file, and at the same time, the B.h file also includes the C.h file. According to the rules of preprocessing, the A.h file will have two copies of the content of the C.h file; if there are a large number of similar dependency relationships in a software engineering file, it will lead to a low compilation efficiency of the software product. Summary of the Invention

[0003] The present invention provides a method, device, equipment and medium for determining abnormal file dependency relationships in software engineering to solve the technical problem of low compilation efficiency of software products in the prior art.

[0004] According to the first aspect of the present application, a method for determining abnormal file dependency relationships in software engineering is provided, including:

[0005] Obtaining each target file corresponding to the target software engineering; wherein, the target file is a file containing a preset special instruction;

[0006] Determining a number of header files included in each target file according to the special instruction included in each target file; wherein, the special instruction is used to represent a number of header files included in the corresponding target file;

[0007] Generating a directed acyclic graph corresponding to the target software engineering according to the number of header files included in each target file; wherein, the directed acyclic graph includes a number of nodes and edges, each node corresponds to a target file or a header file, and there is a dependency relationship between the two nodes connected by an edge;

[0008] Determining the abnormal file dependency relationship corresponding to the target software engineering according to the directed acyclic graph corresponding to the target software engineering.

[0009] Further, the determining the abnormal file dependency relationship corresponding to the target software engineering according to the directed acyclic graph corresponding to the target software engineering includes:

[0010] Obtain the starting node and each terminating node of the directed acyclic graph corresponding to the target software engineering;

[0011] According to the file corresponding to the starting node and the files corresponding to each terminating node, determine the file dependency relationship between the starting node and each terminating node; wherein, the file dependency relationship includes at least one starting node and one terminating node, and the nodes are connected by edges;

[0012] When the terminating nodes of two file dependency relationships are the same and one of the file dependencies only includes two nodes, determine the file dependency relationship with only two nodes as an abnormal file dependency relationship.

[0013] Further, the determining the abnormal file dependency relationship corresponding to the target software engineering according to the directed acyclic graph corresponding to the target software engineering includes:

[0014] Judge whether there are the same terminating nodes among all the terminating nodes of the directed acyclic graph corresponding to the target software engineering;

[0015] When there are no same terminating nodes among all the terminating nodes of the directed acyclic graph corresponding to the target software engineering, determine that the target software engineering has no abnormal file dependency relationship.

[0016] Further, the determining the abnormal file dependency relationship corresponding to the target software engineering according to the directed acyclic graph corresponding to the target software engineering further includes:

[0017] When there are the same terminating nodes among all the terminating nodes of the directed acyclic graph corresponding to the target software engineering, obtain the starting node of the directed acyclic graph corresponding to the target software engineering and each same terminating node;

[0018] When there are nodes between each same terminating node and the starting node, determine that the target software engineering has no abnormal file dependency relationship;

[0019] When there is any same terminating node directly connected to the starting node, determine the file dependency relationship between the terminating node and the starting node as an abnormal file dependency relationship.

[0020] Further, the target file is obtained through the following steps:

[0021] Obtain each initial file corresponding to the target software engineering; wherein, the initial file includes a number of instructions;

[0022] Traverse the instructions corresponding to each initial file, and determine the initial file with the special instruction as the target file.

[0023] Further, determining several header files included in each target file according to the special instructions included in each target file includes:

[0024] Obtaining the file names within the special characters corresponding to each special instruction included in any target file;

[0025] When the file name meets the preset file name conditions, determining the file corresponding to the file name within the special characters as the header file included in the file.

[0026] Further, the special instruction includes: include.

[0027] According to another aspect of the present application, there is also provided a device for determining the dependency relationship of abnormal files in software engineering, and the device includes:

[0028] A target file acquisition module, configured to acquire each target file corresponding to the target software engineering; wherein, the target file is a file containing preset special instructions;

[0029] A file determination module, configured to determine several header files included in each target file according to the special instructions included in each target file; wherein, the special instruction is used to represent several header files included in the corresponding target file;

[0030] A directed acyclic graph generation module, configured to generate a directed acyclic graph corresponding to the target software engineering according to several header files included in each target file; wherein, the directed acyclic graph includes several nodes and edges, each node corresponds to a target file or a header file, and there is a dependency relationship between the two nodes connected by an edge;

[0031] An abnormal file dependency relationship determination module, configured to determine the abnormal file dependency relationship corresponding to the target software engineering according to the directed acyclic graph corresponding to the target software engineering.

[0032] According to another aspect of the present application, there is also provided a non-transitory computer-readable storage medium, and at least one instruction or at least one program segment is stored in the storage medium, and at least one instruction or at least one program segment is loaded and executed by a processor to implement the above-mentioned method for determining the dependency relationship of abnormal files in software engineering.

[0033] According to another aspect of the present application, there is also provided an electronic device, including a processor and the above-mentioned non-transitory computer-readable storage medium.

[0034] The present invention has at least the following beneficial effects:

[0035] The method for determining the abnormal file dependency relationship of software engineering according to the present invention obtains each target file corresponding to the target software engineering; determines several files included in each file according to the special instructions included in each file; generates a directed acyclic graph corresponding to the target software engineering according to the several files included in each file; determines the abnormal file dependency relationship corresponding to the target software engineering according to the directed acyclic graph corresponding to the target software engineering; after determining the abnormal file dependency relationship, software developers can optimize the corresponding files according to the abnormal file dependency relationship, thereby improving the compilation efficiency of software products. Brief Description of the Drawings

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0037] Figure 1 It is a flowchart of the method for determining the abnormal file dependency relationship of software engineering provided by the embodiment of the present invention;

[0038] Figure 2 It is a framework diagram of the device for determining the abnormal file dependency relationship of software engineering provided by the embodiment of the present invention;

[0039] Figure 3 It is an application scenario diagram of the method for determining the abnormal file dependency relationship of the project provided by the embodiment of the present invention;

[0040] Figure 4 It is a structural diagram of an electronic device provided by the embodiment of the present invention. Detailed Embodiments

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the technical field without creative efforts belong to the scope of protection of the present application.

[0042] It should be noted that in the following description, specific details such as specific system structures and technologies are proposed for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those of ordinary skill in the technical field should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, the detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.

[0043] It should be understood that when used in the specification of this application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations. It should also be understood that when the term "and / or" is used in the specification of this application and the appended claims, it means any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0044] In the description of the specification of this application and the appended claims, if the term "if" is used, it can be interpreted as "in the case of", "when", "once", "in response to determining", or "in response to detecting" according to the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]" according to the context.

[0045] In the description of the specification of this application and the appended claims, if the terms "first", "second", "third", etc. are used, they are only used for distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor are they used to describe a specific order or sequence.

[0046] In the field of software development, the compilation speed of software engineering will consume more and more time as the number of engineering files increases, which is particularly obvious in compiled languages such as C++.

[0047] Taking the C++ language as an example, the entire compilation process involves links such as preprocessing, compilation, assembly, and linking; among them, preprocessing is to process header files such as #include "X.h", replace the content of the X.h file into the file that calls the include instruction, and then proceed with the compilation process.

[0048] Consider such a common scenario. If A.h includes B.h and C.h, and B.h also includes C.h, then according to the rules of preprocessing, A.h will have two copies of the content of C.h. If there are no syntax errors considered, the subsequent compilation process will definitely be affected because the number of characters for syntax and lexical analysis has increased.

[0049] Such scenarios are relatively common in the field of software development. Although they do not affect the generation of the final software product, they will slow down the compilation process of the entire software product in large software projects; if there is an effective means to identify such redundant file dependencies, it will not only be beneficial to clearly sort out the dependencies of software engineering, but also be beneficial to making some optimization operations for the software.

[0050] For the above technical problems, the following will refer to Figure 1 the flowchart of the software engineering abnormal file dependency determination method shown in the figure, and introduce a software engineering abnormal file dependency determination method.

[0051] The software engineering abnormal file dependency determination method may include the following steps:

[0052] S100, obtain each target file corresponding to the target software engineering; wherein, the target file is a file containing a preset special instruction.

[0053] Specifically, obtain each target file corresponding to the target software engineering to obtain a target file list D = (D 1 , D 2 , …, D i , …, D n ), i = 1, 2, …, n; wherein, D i is the i-th target file obtained for the target software engineering, and n is the number of target files corresponding to the target software engineering.

[0054] Furthermore, the target file can be obtained through the following steps:

[0055] S110, obtain each initial file corresponding to the target software engineering; wherein, the initial file includes several instructions.

[0056] In this embodiment, in the software product development project, there are several files corresponding to the code written in a specified programming language; the specified programming language can be the C++ language or other programming languages.

[0057] S120, traverse the instructions corresponding to each initial file, and determine the initial file with the special instruction as the target file.

[0058] Specifically, traverse D, if D i contains the special instruction, then determine D i as the target file to obtain D.

[0059] In this embodiment, the special instruction is #include; for example: if the code of file A contains the #include instruction, it means that file A contains other header files, and there is a dependency relationship between file A and other header files.

[0060] S200, determine several header files included in each target file according to the special instruction included in each target file; wherein, the special instruction is used to represent several header files included in the corresponding target file.

[0061] Specifically, obtain Di each special instruction included to obtain D i corresponding special instruction list LD i =(LD i,1 , LD i,2 , …, LD i,j , LD i,f(i) ), j = 1, 2, …, f(i); where LD i,j is the j-th special instruction included in the i-th target file, and f(i) is the number of special instructions included in the i-th target file.

[0062] In this embodiment, it can be understood that since in this embodiment, the number of files included in each target file is different, and the target file may depend on more than one header file, therefore, in this embodiment, f(i) does not refer to a specific function or function result value, but refers to a value that may vary with the specific value of i. For example, when i = 1, f(i) = 3; when i = 2, f(i) = 4; when i = 3, f(i) = 3.

[0063] Furthermore, determining several files included in each file according to the special instructions included in each file includes:

[0064] S210, obtaining the file names within the special characters corresponding to each special instruction included in any target file.

[0065] Specifically, obtaining the file names within the special characters corresponding to each special instruction in LD i to obtain the file name list TD i =(TD i , TD i,1 , …, TD i,2 , TD i,j , TD i,f(i) ); where TD i,j is the file name within the special characters corresponding to LD i,j .

[0066] In this embodiment, the special characters can be <> or "", and the file names within the special characters represent the header files included in the current file.

[0067] S220, when the file name meets the preset file name conditions, determining the file corresponding to the file name within the special characters as the header file included in the file.

[0068] In this embodiment, different programming languages may correspond to file names with different suffixes; for example, the suffixes include.c and.h; therefore, after obtaining the file name, it is necessary to first verify to determine that the obtained file name matches the current programming language used.

[0069] S300. Generate a directed acyclic graph (DAG) corresponding to the target software project according to a number of header files included in each target file. The DAG includes a number of nodes and edges. Each node corresponds to a target file or a header file, and there is a dependency relationship between two nodes connected by an edge.

[0070] In this embodiment, the header files included in the target file may also include other header files. For example, file A.h includes file B.h and file C.h, and file B.h also includes file C.h. By determining all the file inclusion relationships, the dependency relationships between files can be obtained, and then a DAG corresponding to the target software project can be generated. It should be noted that an existing DGA algorithm can also be used to directly generate a DAG corresponding to the target software project in combination with the file directory corresponding to the target software project. The DAG corresponding to the target software project is in a tree structure, including a number of nodes and edges, and each node corresponds to a file.

[0071] S400. Determine the abnormal file dependency relationship corresponding to the target software project according to the DAG corresponding to the target software project.

[0072] Further, the determining the abnormal file dependency relationship corresponding to the target software project according to the DAG corresponding to the target software project includes:

[0073] S410. Obtain the starting node and each terminating node of the DAG corresponding to the target software project.

[0074] Specifically, obtain the starting node QD and each terminating node of the DAG corresponding to the target software project to obtain a terminating node list ZD = (ZD 1 , ZD 2 , …, ZD p , …, ZD q ), where p = 1, 2, …, q; ZD p is the p-th terminating node of the DAG corresponding to the target software project, and q is the number of terminating nodes of the DAG corresponding to the target software project.

[0075] In this embodiment, the target software project may correspond to a main file, which corresponds to the starting node in the DAG. The main file includes a number of header files, and each header file may also include other header files. According to this hierarchical relationship, the header files at the last level can be determined. The header files at the last level do not include other header files, and this header file corresponds to the terminating node in the DAG.

[0076] S411. Determine the file dependency relationships between the starting node and each ending node according to the file corresponding to the starting node and the files corresponding to each ending node. The file dependency relationships include at least one starting node and one ending node, and the nodes are connected by edges.

[0077] Specifically, determine the file dependency relationships between the starting node and each ending node according to the file corresponding to the starting node and the files corresponding to each ending node, so as to obtain a dependency relationship list YA = (YA 1 , YA 2 , …, YA x , …, YA y ), where x = 1, 2, …, y; YA x is the x-th file dependency relationship corresponding to the directed acyclic graph, and y is the number of file dependency relationships corresponding to the directed acyclic graph.

[0078] In this embodiment, by means of traversal, each file dependency relationship in the directed acyclic graph can be determined. The file dependency relationship is: the relationship from the starting node of the directed acyclic graph to each ending node. It should be noted that there may be more than one file dependency relationship corresponding to between one ending node and the starting node.

[0079] S412. When the ending nodes of two file dependency relationships are the same and one of the file dependencies only includes two nodes, determine the file dependency relationship that only includes two nodes as an abnormal file dependency relationship.

[0080] Specifically, traverse YA to obtain two dependency relationships E 1 and E 2 in YA with the same ending node. If E 1 only includes two nodes, then determine E 1 as an abnormal file dependency relationship. If E 2 only includes two nodes, then determine E 2 as an abnormal file dependency relationship.

[0081] In this embodiment, for example: the A.h file includes the B.h file and the C.h file, and the B.h file also includes the C.h file. Then, determine the file dependency relationship between the A.h file and the C.h file as an abnormal file dependency relationship.

[0082] Furthermore, the determining the abnormal file dependency relationships corresponding to the target software project according to the directed acyclic graph corresponding to the target software project includes:

[0083] S420. Determine whether there are the same ending nodes among all the ending nodes of the directed acyclic graph corresponding to the target software project.

[0084] In this embodiment, after obtaining the termination node list ZD, ZD can be traversed to determine whether there are identical termination nodes in ZD.

[0085] S430. When there are no identical termination nodes among all the termination nodes of the directed acyclic graph corresponding to the target software project, it is determined that the target software project has no abnormal file dependency relationship.

[0086] In this embodiment, if there are no two identical termination nodes in ZD, it means that any two termination nodes in the directed acyclic graph are different, and it can be determined that there is no abnormal file dependency relationship in the directed acyclic graph; through steps S420 and S430, it can be quickly determined that the target software project has no abnormal file dependency relationship without performing subsequent complex judgment processes, improving the judgment efficiency.

[0087] Furthermore, determining the abnormal file dependency relationship corresponding to the target software project according to the directed acyclic graph corresponding to the target software project further includes:

[0088] S440. When there are identical termination nodes among all the termination nodes of the directed acyclic graph corresponding to the target software project, obtain the start node and each identical termination node of the directed acyclic graph corresponding to the target software project.

[0089] Specifically, if there are identical termination nodes among all the termination nodes of the directed acyclic graph corresponding to the target software project, obtain the start node QD and each identical termination node of the directed acyclic graph corresponding to the target software project to obtain the identical termination node list XD = (XD 1 , XD 2 , …, XD a , …, XD b ), where a = 1, 2, …, b; among them, XD a is the a-th identical termination node in the directed acyclic graph corresponding to the target software project, and b is the number of identical termination nodes in the directed acyclic graph corresponding to the target software project.

[0090] In this embodiment, if there are identical termination nodes among all the termination nodes of the directed acyclic graph corresponding to the target software project, it means that there may be an abnormal file dependency relationship in the directed acyclic graph corresponding to the target software project, and further judgment is required.

[0091] S450. When there are nodes between each identical termination node and the start node, it is determined that the target software project has no abnormal file dependency relationship.

[0092] In this embodiment, it is possible to determine whether there are nodes between each identical termination node and start node in XD. If there are no nodes between each identical termination node and start node in XD, it is possible to directly determine that there are no abnormal file dependencies in the target software engineering.

[0093] S460. In the case where there is any identical termination node directly connected to the start node, determine the file dependency corresponding to this termination node and start node as an abnormal file dependency.

[0094] In this embodiment, it is possible to determine whether there are nodes between each identical termination node and start node in XD. If there are nodes between a certain identical termination node and start node in XD, it is possible to determine the file dependency corresponding to this termination node and start node as an abnormal file dependency.

[0095] After determining the abnormal file dependency, it is possible to give a prompt for the abnormal file dependency and the dependencies related to the abnormal file dependency. Relevant developers can optimize the dependencies between files according to the prompt; for example: delete the abnormal file dependency; thereby improving the compilation efficiency in software development engineering.

[0096] The method for determining the abnormal file dependency of the software engineering in this embodiment obtains each target file corresponding to the target software engineering; determines several files included in each file according to the special instructions included in each file; generates a directed acyclic graph corresponding to the target software engineering according to the several files included in each file; determines the abnormal file dependency corresponding to the target software engineering according to the directed acyclic graph corresponding to the target software engineering; after determining the abnormal file dependency, software developers can optimize the corresponding files according to the abnormal file dependency, thereby improving the compilation efficiency of the software product.

[0097] In addition, this solution can also be applied to the field of vehicle autonomous driving testing. When applied to this field, the following technical effects can be achieved: Dependency visualization generates a directed acyclic graph (DAG) by parsing software engineering files, intuitively presenting the dependency topology of each functional module (such as perception, decision-making, control, etc.) of the autonomous driving system, and assisting developers in understanding complex software architectures. Abnormal dependency detection automatically identifies abnormal file relationships such as circular dependencies and redundant dependencies, preventing potential problems such as compilation errors and memory leaks caused by unreasonable dependencies, and improving the running reliability of the autonomous driving system. Compilation efficiency optimization eliminates invalid dependency relationships, reduces repeated parsing and redundant construction during compilation, significantly shortens the compilation time of large-scale autonomous driving software systems, and accelerates the development and testing iteration cycle. This technical solution is particularly suitable for code modules with high real-time requirements in the autonomous driving system (such as perception fusion algorithms, path planning, etc.). By optimizing the quality of the software architecture, the overall performance and development efficiency of the system can be effectively improved.

[0098] In an exemplary embodiment, as Figure 2 shown, a device for determining abnormal file dependency relationships in software engineering is provided, characterized in that the device includes:

[0099] A target file acquisition module for acquiring each target file corresponding to the target software engineering; wherein, the target file is a file containing a preset special instruction.

[0100] A file determination module for determining a number of header files included in each target file according to the special instruction included in each target file; wherein, the special instruction is used to represent a number of header files included in the corresponding target file.

[0101] A directed acyclic graph generation module for generating a directed acyclic graph corresponding to the target software engineering according to a number of header files included in each target file; wherein, the directed acyclic graph includes a number of nodes and edges, each node corresponds to a target file or a header file, and there is a dependency relationship between two nodes connected by an edge.

[0102] An abnormal file dependency relationship determination module for determining the abnormal file dependency relationship corresponding to the target software engineering according to the directed acyclic graph corresponding to the target software engineering.

[0103] In addition, although the steps of the methods in the present disclosure are described in a specific order in the drawings, this does not require or imply that these steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.

[0104] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one segment of a program related to a method in the method embodiment. The at least one instruction or the at least one segment of the program is loaded and executed by the processor to implement the method provided in the above embodiment.

[0105] The program product may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0106] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program used by or in conjunction with an instruction execution system, apparatus, or device.

[0107] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the above.

[0108] The program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. As Figure 3As shown, the program code can be executed entirely on the user computing device, partially on the user device, executed as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), for testing anomalies in the vehicle autonomous driving software, or can be connected to an external computing device (e.g., using an Internet service provider to connect via the Internet).

[0109] As Figure 4 As shown, an embodiment of the present invention also provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0110] The electronic device is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.

[0111] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one of the aforementioned processors, at least one of the aforementioned memories, and a bus connecting different system components (including the memory and the processor).

[0112] Wherein, the memory stores program code, and the program code can be executed by the processor, such that the processor executes the steps in various embodiments described in this specification.

[0113] The memory may include a readable medium in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).

[0114] The memory may also include a program / utilities having a set (at least one) of program modules, and such program modules include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Implementations of a network environment may be included in each or some combination of these examples.

[0115] The bus may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure in a variety of bus structures.

[0116] The electronic device can also communicate with one or more external devices (such as a keyboard, a pointing device, a Bluetooth device, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device, and / or communicate with any device that enables the electronic device to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface. Moreover, the electronic device can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in combination with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0117] From the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software, or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0118] The embodiments of the present invention also provide a computer program product, which includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the steps in the methods according to various exemplary embodiments of the present invention described above in this specification.

[0119] Although some specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are only for illustration and not for limiting the scope of the present invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present invention.

Claims

1. A method for determining abnormal file dependencies in software engineering, characterized in that: include: Obtain each target file corresponding to the target software project; wherein the target file is a file containing preset special instructions; According to the special instructions contained in each target file, a number of header files contained in each target file are determined; wherein the special instructions are used to represent the number of header files contained in the corresponding target file; Generate a directed acyclic graph corresponding to the target software project according to the header files included in each target file; wherein the directed acyclic graph includes a plurality of nodes and edges, each node corresponds to a target file or a header file, and there is a dependency relationship between the corresponding files of two nodes connected by the edge; According to the directed acyclic graph corresponding to the target software project, the abnormal file dependency corresponding to the target software project is determined.

2. The method for determining abnormal file dependencies in software engineering according to claim 1, characterized in that: Determining the abnormal file dependency relationship corresponding to the target software project according to the directed acyclic graph corresponding to the target software project includes: Obtain the starting node and each ending node of the directed acyclic graph corresponding to the target software project; Determine the file dependency relationship between the starting node and each terminating node according to the file corresponding to the starting node and the file corresponding to each terminating node; wherein the file dependency relationship includes at least one starting node and one terminating node, and the nodes are connected by edges; In the case where the termination nodes of two file dependency relationships are the same and one of the file dependencies includes only two nodes, the file dependency relationship including only two nodes is determined as an abnormal file dependency relationship.

3. The method for determining abnormal file dependencies in software engineering according to claim 1, characterized in that: Determining the abnormal file dependency relationship corresponding to the target software project according to the directed acyclic graph corresponding to the target software project includes: Determine whether there is an identical terminal node among all the terminal nodes of the directed acyclic graph corresponding to the target software project; When there is no identical termination node among all termination nodes of the directed acyclic graph corresponding to the target software project, it is determined that there is no abnormal file dependency relationship in the target software project.

4. The method for determining abnormal file dependencies in software engineering according to claim 3, characterized in that: Determining the abnormal file dependency relationship corresponding to the target software project according to the directed acyclic graph corresponding to the target software project also includes: When there are identical terminal nodes among all terminal nodes of the directed acyclic graph corresponding to the target software project, obtaining the starting node of the directed acyclic graph corresponding to the target software project and each identical terminal node; In the case where there are nodes between each identical end node and the start node, it is determined that there is no abnormal file dependency relationship in the target software project; In the case that there is any identical terminating node directly connected to the starting node, the file dependency relationship corresponding to the terminating node and the starting node is determined to be an abnormal file dependency relationship.

5. The method for determining abnormal file dependencies in software engineering according to claim 1, characterized in that: The target file is obtained by the following steps: Obtain each initial file corresponding to the target software project; wherein the initial file includes a number of instructions; The instructions corresponding to each initial file are traversed, and the initial file containing the special instructions is determined as the target file.

6. The method for determining abnormal file dependencies in software engineering according to claim 1, characterized in that: The step of determining, based on the special instructions contained in each target file, a number of header files contained in each target file includes: Get the file name in special characters corresponding to each special instruction contained in any target file; When the file name meets the preset file name condition, the file corresponding to the file name within the special characters is determined as the header file included in the file.

7. The method for determining abnormal file dependencies in software engineering according to claim 1, characterized in that: The special instructions include: include.

8. A software engineering abnormal file dependency determination device, characterized in that: The device comprises: A target file acquisition module is used to acquire each target file corresponding to the target software project; wherein the target file is a file containing preset special instructions; A file determination module, used to determine a number of header files included in each target file according to a special instruction included in each target file; wherein the special instruction is used to represent a number of header files included in the corresponding target file; A directed acyclic graph generation module is used to generate a directed acyclic graph corresponding to a target software project according to a number of header files included in each target file; wherein the directed acyclic graph includes a number of nodes and edges, each node corresponds to a target file or a header file, and there is a dependency relationship between the corresponding files of two nodes connected by an edge; The abnormal file dependency determination module is used to determine the abnormal file dependency corresponding to the target software project according to the directed acyclic graph corresponding to the target software project.

9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the method for determining abnormal file dependencies in software engineering as described in any one of claims 1-7.

10. An electronic device, characterized in that: The method comprises a processor and the non-transitory computer-readable storage medium of claim 9.