Method, device, equipment and medium for displaying project file and library reference relationship

By building preset arrays and category arrays, identifying and classifying libraries in project files, the problem of technicians obtaining library reference relationships is solved, development efficiency is improved, and the problems of repeated import and loss of libraries are avoided.

CN114510511BActive Publication Date: 2024-11-08武汉斗鱼鱼乐网络科技有限公司
View PDF 15 Cites 0 Cited by

Patent Information

Application Number
CN202011284349.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-17
Publication Date
2024-11-08
Estimated Expiration
2040-11-17

AI Technical Summary

Technical Problem

In mobile development, it is difficult for technicians to quickly obtain the relationship between project files and library references, resulting in repeated import of the same components or libraries, or the loss of necessary libraries, which reduces the efficiency of system development.

Method used

By pre-constructing multiple preset arrays and category arrays, traversing the project files, identifying and classifying the target library corresponding to each reference header file, and outputting reference relationship statistics results to avoid the problems of repeated import and loss of libraries.

Benefits of technology

It realizes a rapid display of the reference relationship of the project file library, guides technicians to avoid repeated imports and loss of libraries, and improves the convenience and efficiency of system development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114510511B_ABST
    Figure CN114510511B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method for displaying the reference relationship between a project file and a library, including: pre-building multiple preset arrays and multiple category arrays, each of the preset arrays contains multiple preset libraries of the same type, and different preset arrays contain preset libraries of different types; traversing the project file to obtain the reference header files of all subfiles in the project file; respectively identifying the target library corresponding to each reference header file; based on the type of the preset library contained in all the preset arrays, classifying each target library respectively, and storing each target library in one of the category arrays respectively, to obtain the reference relationship statistics of the project file and all the target libraries; outputting and displaying the reference relationship statistics. By establishing different arrays and classifying and counting all the libraries referenced by the project file, the problem of repeated reference libraries and unclear reference relationships in the development process is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of software engineering, and in particular to a method, device, equipment and medium for displaying the relationship between project files and library references. Background Art

[0002] In mobile development, technicians need to import multiple different components or libraries into the project file to achieve development. However, due to the large number of components or libraries that need to be imported, technicians often do not count the components or libraries referenced in the project file during the development process, or different technicians cannot clearly identify the types of components or libraries that other technicians have imported when facing the same system development. In the above situation, technicians may repeatedly import the same components or libraries, or fail to continue development tasks based on the imported components or libraries. This brings great inconvenience to the entire system development process, easily causes unnecessary losses, and reduces the system development efficiency.

[0003] Public Content

[0004] The present invention provides a method, device, electronic device and computer-readable storage medium for displaying the relationship between a project file and a library reference, so as to solve the technical problem that a technician cannot quickly obtain the relationship between a project file and a library reference.

[0005] The present disclosure provides a method for displaying the relationship between a project file and a library reference, including:

[0006] Pre-building a plurality of preset arrays and a plurality of category arrays, each of the preset arrays containing a plurality of preset libraries of the same type, and different preset arrays containing preset libraries of different types;

[0007] Traverse the project file to obtain the reference header files of all sub-files in the project file;

[0008] Identify the target library corresponding to each referenced header file respectively;

[0009] Based on the types of preset libraries contained in all the preset arrays, each target library is classified respectively, and each target library is stored in one of the category arrays respectively, so as to obtain the statistical results of the reference relationship between the project file and all the target libraries;

[0010] Output and display the citation relationship statistics results.

[0011] Optionally, the pre-built multiple preset arrays and multiple category arrays, each of the preset arrays contains multiple preset libraries of the same type, including:

[0012] Constructing a first preset array and at least one second preset array, wherein the first preset array includes a plurality of preset basic libraries, and the second preset array includes a plurality of preset common libraries;

[0013] Constructing at least one first category array and one second category array, wherein the first category array is used to store commonly used libraries corresponding to the reference header file, and the second category array is used to store uncommon libraries corresponding to the reference header file;

[0014] The types of the preset common libraries contained in each of the second preset arrays correspond one-to-one to the types of the common libraries stored in each of the first category arrays.

[0015] Optionally, the method of classifying each target library based on the type of the preset libraries included in all the preset arrays, and storing each target library in one of the category arrays, comprises:

[0016] Determine whether each target library is of the same type as the preset basic library included in the first preset array;

[0017] If the determined target library is of the same type as the preset basic library included in the first preset array, the target library is ignored;

[0018] If the determined target library is not of the same type as the preset basic library included in the first preset array, then determining respectively whether the target library is of the same type as the preset common library included in each of the second preset arrays;

[0019] If the determined target library is of the same type as a preset common library included in one of the second preset arrays, the target library is stored in the first category array for storing common libraries of the same type;

[0020] If the determined target library is of a different type from all the preset common libraries included in the second preset array, the library is stored in the second category array.

[0021] Optionally, traversing the project file to obtain the reference header files of all sub-files in the project file includes:

[0022] Traverse the project file and obtain all sub-files of the project file;

[0023] Determine whether each sub-file is a valid file;

[0024] If the subfile is a valid file, obtain the valid row content of the subfile;

[0025] Call the line.include function to parse out the referenced header file contained in the line content.

[0026] Optionally, traversing the project file to obtain all sub-files of the project file includes:

[0027] Search all sub-files under the project file directory and obtain the fillArr array containing all the sub-files;

[0028] Traverse the fillArr array to obtain all the sub-files of the project file.

[0029] Optionally, the determining whether each sub-file is a valid file includes:

[0030] Get the file name of each sub-file;

[0031] Determine whether the file name contains .h, .m or .pch respectively;

[0032] If the file name contains .h, .m or .pch, the sub-file corresponding to the file name is a valid file, and the sub-file is obtained.

[0033] Optionally, the identifying the target library corresponding to each reference header file includes:

[0034] Call the findP function to determine whether each referenced header file contains import;

[0035] If the reference header file contains import, identifying the target library corresponding to the reference header file;

[0036] If the referenced header file does not contain import, the referenced header file is ignored.

[0037] The present disclosure provides a display device for a project file and a library reference relationship, comprising:

[0038] A construction module, used to pre-construct a plurality of preset arrays and a plurality of category arrays, each of the preset arrays containing a plurality of preset libraries of the same type, and different preset arrays containing preset libraries of different types;

[0039] A traversal acquisition module is used to traverse the project file and obtain the reference header files of all sub-files in the project file;

[0040] An identification module, used to identify the target library corresponding to each reference header file;

[0041] A classification storage module, used for classifying each target library according to the type of the preset libraries contained in all the preset arrays, and storing each target library in one of the category arrays, so as to obtain the statistical result of the reference relationship between the project file and all the target libraries;

[0042] The output display module is used to output and display the citation relationship statistics results.

[0043] The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned methods for displaying the relationship between project files and library references when executing the program.

[0044] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the method for displaying the relationship between project files and library references as described in any one of the above items is implemented.

[0045] Based on the above technical solution, it can be seen that the present disclosure has at least the following beneficial effects:

[0046] The present disclosure provides a method for displaying the reference relationship between a project file and a library, including: pre-building multiple preset arrays and multiple category arrays, wherein the preset arrays contain multiple preset libraries of the same type, and different preset arrays contain preset libraries of different types; traversing the project file to obtain the reference header files of all subfiles in the project file; respectively identifying the target library corresponding to each reference header file; based on the type of the preset library contained in all the preset arrays, respectively classifying each target library, and storing each target library in one of the category arrays, so as to obtain the statistical results of the reference relationship between the project file and all the target libraries; and outputting the statistical results of the reference relationship to a display platform. By pre-building a preset array containing preset libraries of different types, the unknown libraries referenced by the project file are classified and stored, and the statistical results of the reference relationship between the project file and the library are output and displayed, so that the technicians do not need to search for the target library in a large number of project files, but quickly obtain the reference relationship between the project file and the library through the display results, and provide a guiding basis for the technicians in the later development process, avoiding the problem of repeatedly importing the same library or losing the necessary library, thereby improving the convenience of system development and reducing the development workload. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description taken in conjunction with the accompanying drawings, in which:

[0048] Figure 1 A flowchart schematically shows a method for displaying a project file and a library reference relationship according to an embodiment of the present disclosure;

[0049] Figure 2 A block diagram schematically showing a device for displaying a relationship between a project file and a library reference according to an embodiment of the present disclosure; and

[0050] Figure 3The figure schematically shows a hardware structure diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0052] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. The terms "include", "comprising", etc. used herein indicate the presence of the features, steps, operations and / or components, but do not exclude the presence or addition of one or more other features, steps, operations or components.

[0053] See also Figure 1 The present disclosure provides a method for displaying the relationship between a project file and a library reference, the method comprising:

[0054] Step S101, pre-constructing a plurality of preset arrays and a plurality of category arrays, each of the preset arrays comprising a plurality of preset libraries of the same type, and different preset arrays comprising preset libraries of different types;

[0055] Step S102, traversing the project file to obtain the reference header files of all sub-files in the project file;

[0056] Step S103, identifying the target library corresponding to each reference header file respectively;

[0057] Step S104, classifying each target library based on the type of the preset libraries included in all the preset arrays, and storing each target library in one of the category arrays, so as to obtain the statistical result of the reference relationship between the project file and all the target libraries;

[0058] Step S105: output and display the citation relationship statistics result.

[0059] Exemplarily, if the operations of steps S101-S105 above are performed in the server, the server can send the statistical results of the reference relationship obtained by the analysis to the client, so that the user can intuitively see the statistical results of the reference relationship between the displayed project files and the library on the client, and clarify the reference situation of the project files to the library. If the operations of steps S101-S105 above are performed in the client, the client directly obtains and displays the statistical results of the reference relationship, without the need to send the statistical results of the reference relationship, thereby further improving the efficiency of the user in obtaining the statistical results of the reference relationship. Furthermore, the operation of step S101 above is performed on the client, the operation of steps S102-S104 above is performed on the server, and finally the operation of step S105 is performed on the client, and the user directly obtains the statistical results of the reference relationship on the client. The above are only some of the embodiments listed to explain the technical solution of the present disclosure in detail, and are not all embodiments of the technical solution of the present disclosure, nor are they intended to limit the technical solution of the present disclosure.

[0060] In this embodiment, by pre-building a plurality of preset arrays containing different types of preset libraries, all unknown libraries referenced in the project file are classified and counted, and the statistical results are output and displayed, so that technical personnel can clarify the actual references of various libraries by the project file during the system development process, reduce development problems caused by repeated references to libraries and loss of necessary libraries in the later development process, and improve the efficiency of system development.

[0061] As an optional embodiment, in step S101, multiple preset arrays and multiple category arrays are pre-built, each of the preset arrays contains multiple preset libraries of the same type, and different preset arrays contain preset libraries of different types, including at least:

[0062] Step S111, constructing a first preset array and at least one second preset array, wherein the first preset array includes a plurality of preset basic libraries, and the second preset array includes a plurality of preset common libraries;

[0063] Step S112, constructing at least one first category array and one second category array, wherein the first category array is used to store commonly used libraries corresponding to the reference header file, and the second category array is used to store uncommon libraries corresponding to the reference header file;

[0064] The types of the preset common libraries contained in each of the second preset arrays correspond one-to-one to the types of the common libraries stored in each of the first category arrays.

[0065] In this embodiment, the multiple preset arrays constructed can be mainly divided into two categories, one is a first preset array containing multiple preset basic libraries; the other is a second preset array containing multiple preset common libraries of different types, each of which contains multiple preset libraries of the same type, and different second preset arrays contain different types of preset common libraries. The types of the preset basic libraries are mainly libraries that must be used in the system development process. Such libraries are generally imported into the project file as default basic libraries. In the actual development process, the technicians do not need to re-import such basic libraries into the project file, but directly call such basic libraries. The preset common libraries are generally commonly used system libraries, such as positioning libraries, Bluetooth libraries, multimedia libraries, chat libraries, and address book libraries. The commonly used system libraries are classified and stored according to different types to form multiple second preset arrays containing different types of preset common libraries.

[0066] The multiple category arrays constructed can also be divided into two categories, one is a plurality of first category arrays for storing different types of commonly used libraries, and the other is a second category array for storing uncommon libraries. The types of commonly used libraries stored in the plurality of first category arrays correspond one to one with the types of preset libraries contained in the plurality of second preset arrays. In the actual development process, the project file will also reference a type of uncommon library that is neither a basic library type nor a commonly used library type, and such library will be classified and stored in the second preset array.

[0067] By constructing a preset array containing different preset libraries and a category array for storing different types of unknown libraries, each type of unknown library referenced by the project file can be stored in a different category array accordingly. In the later development process, technicians can refer to the displayed reference relationship statistics, search for the required library in the array storing different types of libraries according to actual needs, and confirm whether the required library has been imported into the project file, so as to save search time and improve development efficiency.

[0068] Specifically, the first preset array may be a nonArr array, the second preset array may include a sysAllArr array, a datasysAllArr array, a mapsysAllArr array, a messagesysAllArr array, etc., the corresponding first category array may include a sysArr array, a datasysArr array, a mapsysArr array, a messagesysArr array, etc., and the second category array may be a podArr array. Those skilled in the art may construct preset arrays and category arrays of different types and numbers according to actual needs, and the present disclosure does not impose any limitation thereto.

[0069] As an optional embodiment, step S102, traversing the project file to obtain the reference header files of all sub-files in the project file, at least includes the following steps:

[0070] Step S121, traverse the project file to obtain all sub-files of the project file;

[0071] Step S122, determining whether each sub-file is a valid file;

[0072] Step S123, if the sub-file is a valid file, obtaining valid row content of the sub-file;

[0073] Step S124, calling the line.include function to parse out the reference header file included in the line content.

[0074] Specifically, step S121, traversing the project file to obtain all sub-files of the project file, includes at least the following steps:

[0075] Step S1211, searching all sub-files under the project file directory, and obtaining a fillArr array containing all the sub-files;

[0076] Step S1212, traverse the fillArr array to obtain all the sub-files of the project file.

[0077] Specifically, step S122, determining whether each sub-file is a valid file, includes at least the following steps:

[0078] Step S1221, obtaining the file name of each sub-file;

[0079] Step S1222, determining whether the file name contains .h, .m or .pch;

[0080] Step S1223: If the file name contains .h, .m or .pch, the sub-file corresponding to the file name is a valid file.

[0081] In this embodiment, after traversing the project file, a large number of sub-files are obtained, some of which are not valid. In order to improve the efficiency of the subsequent analysis of the reference relationship, the findValidFile function is used to filter out valid sub-files, so that the system does not need to parse the corresponding header files of invalid sub-files, avoiding the system from performing meaningless work tasks and improving the system work efficiency.

[0082] After obtaining the valid files, specifically, call an openfile function to open the valid files, and traverse to obtain each line of each valid file. Then call the line.include function to parse each line of content to obtain the reference header file contained in the line content. Specifically, use the line.include function to determine whether each line of content contains "#import<". If it contains "#import<", it means that the current line contains a reference header file. If the content of a certain line contains "interface" or "implement", it means that the current line of the current file no longer has a header file, and the determination of the content of the current file line is terminated.

[0083] As an optional embodiment, step S103, identifying the target library corresponding to each reference header file, includes at least the following steps:

[0084] Step S131, calling the iindP function to determine whether each reference header file contains import. If the reference header file contains import, execute step S312; otherwise, execute step S313;

[0085] Step S132, identifying the target library corresponding to the reference header file;

[0086] Step S133, ignoring the reference header file.

[0087] In this embodiment, since not every reference header file has a corresponding library, after obtaining the reference header file, it is necessary to further judge the library corresponding to the reference header file, filter out the reference header file with the corresponding library and obtain its corresponding library, and then classify all the libraries. By judging the reference header file, the valid corresponding library is filtered out, ensuring the accuracy of the subsequent classification of all libraries, and improving the statistical efficiency of the reference relationship between the project file and the library.

[0088] As an optional embodiment, step S104, based on the types of preset libraries included in all the preset arrays, classifies each target library respectively, and stores each target library in one of the category arrays respectively, including at least the following steps:

[0089] Step S141, respectively determining whether each target library is of the same type as the preset basic library included in the first preset array, if the determined target library is of the same type as the preset basic library included in the first preset array, executing step S142, otherwise, executing step S143;

[0090] Step S142, ignoring the target library;

[0091] Step S143, respectively judging whether the target library is of the same type as the preset common library contained in each of the second preset arrays, if the judged target library is of the same type as the preset common library contained in one of the second preset arrays, executing step S144, otherwise, executing step S145;

[0092] Step S144, storing the target library into the first category array used to store commonly used libraries of the same type;

[0093] Step S145, storing the target library into the second category array.

[0094] In this embodiment, first, it is determined whether each target library obtained is of the same type as the preset basic library in the first preset array, so that the conventional basic libraries contained in all libraries can be screened out, further reducing the number of target libraries to be classified and improving the statistical efficiency of reference relationships. For example, the isNoImport function is called to determine whether the target library belongs to the type of the preset basic library. If so, the basic library of this type is ignored; if the target library is a non-basic type library, the isSysImport function is called to determine whether the target library of the non-basic type belongs to the type of the preset common library contained in the sysAllArr array. If so, the current target library is stored in the sysArr array. If not, other functions are further called to determine the specific type of the target library of the non-basic type. If, after comparison with the types of all preset libraries, the target library does not belong to the type of the preset basic library or the type of the preset common library, the target library is stored in the podArr array. Finally, the classified statistics of all target libraries can be obtained and displayed. Based on the displayed statistical results, technicians can clearly understand the reference relationship between the project files and each library, avoiding repeated import of the same library or the inability to perform development work based on the imported library.

[0095] See also Figure 2 The present disclosure provides a display device 200 for displaying the relationship between a project file and a library reference, comprising:

[0096] A construction module 201 is used to pre-construct a plurality of preset arrays and a plurality of category arrays, each of the preset arrays comprising a plurality of preset libraries of the same type, and different preset arrays comprising preset libraries of different types;

[0097] A traversal acquisition module 202 is used to traverse the project file and obtain the reference header files of all sub-files in the project file;

[0098] Identification module 203, used to identify the target library corresponding to each reference header file;

[0099] The classification storage module 204 is used to classify each target library based on the type of the preset libraries contained in all the preset arrays, and store each target library in one of the category arrays to obtain the statistical results of the reference relationship between the project file and all the target libraries;

[0100] The output display module 205 is used to output and display the citation relationship statistics result.

[0101] The display device of this embodiment constructs multiple preset arrays containing different types of preset libraries, and classifies and stores all unknown libraries referenced in the engineering file, so that technical personnel can understand the actual references of various libraries in the engineering file during the system development process, and output and display the statistical results, so that technical personnel can understand the actual references of various libraries in the engineering file during the system development process, reduce development problems caused by repeated references to libraries and loss of necessary libraries in the later development process, and improve the efficiency of system development.

[0102] In this embodiment, the constructing device 201 at least includes:

[0103] A first construction module 211 is used to construct a first preset array and at least one second preset array, wherein the first preset array includes a plurality of preset basic libraries, and the second preset array includes a plurality of preset common libraries;

[0104] The second construction module 212 is used to construct at least one first category array and one second category array, wherein the first category array is used to store the commonly used libraries corresponding to the reference header file, and the second category array is used to store the uncommon libraries corresponding to the reference header file.

[0105] The types of the preset common libraries contained in each of the second preset arrays correspond one-to-one to the types of the common libraries stored in each of the first category arrays.

[0106] In this embodiment, the traversal obtaining module 202 at least includes:

[0107] The first traversal obtaining module 221 is used to traverse the project file and obtain all sub-files of the project file;

[0108] A first judging module 222, used to judge whether each sub-file is a valid file;

[0109] A first obtaining module 223, used for obtaining valid row contents of the subfile;

[0110] The parsing module 224 is called to call the line.include function to parse out the reference header file included in the line content.

[0111] Specifically, the first traversal obtaining module 221 at least includes:

[0112] The search module 2211 is used to search all sub-files in the project file directory and obtain the fillArr array containing all the sub-files;

[0113] The second traversal obtaining module 2212 is used to traverse the fillArr array to obtain all the sub-files of the project file.

[0114] The first determination module 222 at least includes:

[0115] The second obtaining module 2221 is used to obtain the file name of each sub-file;

[0116] The second judging module 2222 is used to judge whether the file name contains .h, .m or .pch;

[0117] In this embodiment, the identification module 203 at least includes:

[0118] A calling judgment module 231 is used to call the findP function to judge whether each reference header file contains import;

[0119] A first identification module 232, used to identify a target library corresponding to the reference header file containing import;

[0120] The second ignoring module 233 is used to ignore the reference header file that does not contain import.

[0121] In this embodiment, the classification storage module 204 at least includes:

[0122] A third judgment module 241 is used to judge whether each target library is of the same type as the preset basic library included in the first preset array;

[0123] An ignoring module 242, configured to ignore the target library of the same type as the preset basic library included in the first preset array;

[0124] A fourth judgment module 243 is used to respectively judge whether the target library which is different from the type of the preset basic library included in the first preset array is the same as the type of the preset common library included in each of the second preset arrays;

[0125] A first storage module 244, used for storing the target library of the same type as the preset common library included in one of the second preset arrays into the first category array for storing common libraries of the same type;

[0126] The second storage module 245 is used to store the target library which is different from the type of all the preset common libraries included in the second preset array into the second category array.

[0127] See also Figure 3 , Figure 3 A hardware structure diagram of an electronic device is shown.

[0128] The electronic device 300 described in this embodiment includes:

[0129] The memory 301, the processor 302 and the computer program stored in the memory 301 and executable on the processor 302, when the processor 302 executes the program, realize the aforementioned Figure 1 The method for displaying the relationship between project files and library references described in the illustrated embodiment.

[0130] Furthermore, the electronic device also includes:

[0131] At least one input device 303 ; at least one output device 304 .

[0132] The memory 301 , processor 302 , input device 303 and output device 304 are connected via a bus 305 .

[0133] The input device 303 may be a camera, a touch panel, a physical button or a mouse, etc. The output device 304 may be a display screen.

[0134] The memory 301 may be a high-speed random access memory (RAM) memory or a non-volatile memory, such as a disk memory. The memory 301 is used to store a set of executable program codes, and the processor 302 is coupled to the memory 301 .

[0135] Furthermore, the present disclosure also provides a computer-readable storage medium, which may be disposed in the electronic device in the above embodiments. Figure 3 The electronic device in the embodiment shown. The computer readable storage medium stores a computer program, which, when executed by the processor, implements the aforementioned Figure 1 The method for displaying the relationship between the project file and the library reference described in the illustrated embodiment. Furthermore, the computer storable medium may also be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0136] It should be noted that the functional modules in the various embodiments of the present disclosure may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0137] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product.

[0138] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the described action sequence, because according to the present disclosure, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0139] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0140] The above is a description of a method, device, electronic device and readable storage medium for displaying the relationship between engineering files and library references provided by the present disclosure. For technicians in this field, according to the ideas of the embodiments of the present disclosure, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present disclosure.

Claims

1. A method for displaying the relationship between project files and library references, It is characterized in that include: Pre-building a plurality of preset arrays and a plurality of category arrays, each of the preset arrays containing a plurality of preset libraries of the same type, and different preset arrays containing preset libraries of different types; Traverse the project file to obtain the reference header files of all sub-files in the project file; Identify the target library corresponding to each referenced header file respectively; Based on the types of preset libraries contained in all the preset arrays, each target library is classified respectively, and each target library is stored in one of the category arrays respectively, so as to obtain the statistical results of the reference relationship between the project file and all the target libraries; Output and display the citation relationship statistics results; The pre-building of multiple preset arrays and multiple category arrays includes: Constructing a first preset array and at least one second preset array, wherein the first preset array includes a plurality of preset basic libraries, and the second preset array includes a plurality of preset common libraries; Constructing at least one first category array and one second category array, wherein the first category array is used to store commonly used libraries corresponding to the reference header file, and the second category array is used to store uncommon libraries corresponding to the reference header file; The types of the preset common libraries contained in each of the second preset arrays correspond one-to-one to the types of the common libraries stored in each of the first category arrays; Wherein, based on the types of preset libraries contained in all the preset arrays, each target library is classified respectively, and each target library is stored in one of the category arrays respectively, including: Determine whether each target library is of the same type as the preset basic library included in the first preset array; If the determined target library is of the same type as the preset basic library included in the first preset array, the target library is ignored; If the type of the determined target library is different from the type of the preset basic library included in the first preset array, then determining whether the type of the target library is the same as the type of the preset common library included in each of the second preset arrays; If the determined target library is of the same type as a preset common library included in one of the second preset arrays, the target library is stored in the first category array for storing common libraries of the same type; If the determined target library is of a different type from all the preset common libraries included in the second preset array, the library is stored in the second category array.

2. The method for displaying the relationship between project files and library references according to claim 1, It is characterized in that The traversal of the project file to obtain the reference header files of all sub-files in the project file includes: Traverse the project file and obtain all sub-files of the project file; Determine whether each sub-file is a valid file; If the subfile is a valid file, obtain the valid row content of the subfile; Call the line.include function to parse out the referenced header file contained in the line content.

3. The method for displaying the relationship between project files and library references according to claim 2, It is characterized in that The traversing of the project file to obtain all sub-files of the project file includes: Search all sub-files under the project file directory and obtain the fillArr array containing all the sub-files; Traverse the fillArr array to obtain all the sub-files of the project file.

4. The method for displaying the relationship between project files and library references according to claim 2, It is characterized in that The step of determining whether each sub-file is a valid file comprises: Get the file name of each sub-file; Determine whether the file name contains .h, .m or .pch respectively; If the file name contains .h, .m or .pch, the sub-file corresponding to the file name is a valid file.

5. The method for displaying the relationship between project files and library references according to claim 1, It is characterized in that The target library corresponding to each reference header file is identified respectively, including Call the findP function to determine whether each referenced header file contains import; If the reference header file contains import, identifying the target library corresponding to the reference header file; If the referenced header file does not contain import, the referenced header file is ignored.

6. A display device for the relationship between project files and library references, It is characterized in that include: A construction module, used to pre-construct a plurality of preset arrays and a plurality of category arrays, each of the preset arrays containing a plurality of preset libraries of the same type, and different preset arrays containing preset libraries of different types; A traversal acquisition module is used to traverse the project file and obtain the reference header files of all sub-files in the project file; An identification module, used to identify the target library corresponding to each reference header file; A classification storage module, used for classifying each target library according to the type of the preset libraries contained in all the preset arrays, and storing each target library in one of the category arrays, so as to obtain the statistical result of the reference relationship between the project file and all the target libraries; An output display module, used to output and display the citation relationship statistics; Wherein, the building blocks include: A first construction module is used to construct a first preset array and at least one second preset array, wherein the first preset array includes a plurality of preset basic libraries, and the second preset array includes a plurality of preset common libraries; A second construction module is used to construct at least one first category array and one second category array, wherein the first category array is used to store commonly used libraries corresponding to the reference header file, and the second category array is used to store uncommon libraries corresponding to the reference header file; The types of the preset common libraries contained in each of the second preset arrays correspond one-to-one to the types of the common libraries stored in each of the first category arrays; Among them, the classification storage module includes: A third judgment module, used to judge whether each target library is of the same type as the preset basic library included in the first preset array; an ignoring module, configured to ignore the target library of the same type as the preset basic library included in the first preset array; A fourth judgment module, used for respectively judging whether the target library which is different from the type of the preset basic library included in the first preset array is the same as the type of the preset common library included in each of the second preset arrays; A first storage module, used for storing the target library of the same type as the preset common library included in one of the second preset arrays into the first category array for storing common libraries of the same type; The second storage module is used to store the target library which is different from the type of all the preset common libraries included in the second preset array into the second category array.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method for displaying the relationship between the project file and the library reference described in any one of claims 1-5 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method for displaying the relationship between project files and library references described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Data management method and device

    CN106843992A

  • Structured processing method and system for engineering electronic files

    CN108572952A

  • Generating deeplinks for applications based on multi-level referrer data

    CN108738362A

  • Method, device and apparatus for finding dependency relationship between components and storage medium

    CN109189729A

  • A method and a system for searching and supplementing missing resources

    CN109828776A