A data processing method, device, server and storage medium
By converting project project files into attribute table files and using the JSONDecoder class in Swift to obtain compilation configuration information and class library information, the problem of slow parsing speed of Ruby script language in complex projects is solved, and more efficient data processing is achieved.
Patent Information
- Application Number
- CN202110353887.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-03-31
AI Technical Summary
In complex projects, it is difficult to effectively improve file parsing speed by scanning project project projects using Ruby scripting language, especially in projects that rely on many libraries and many resource files.
By converting the project project file into a property table file, obtaining the compilation configuration information and class library information, and displaying the class library and attribute configuration information in the file parsing interface, and using the JSONDecoder class in Swift to accelerate data reading.
It significantly speeds up file parsing speed and improves data processing efficiency, especially in complex projects, which greatly reduces analysis time.
Smart Images

Figure CN114675867B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, server and storage medium. Background Art
[0002] With the rapid development of computer technology, more and more applications are being developed. When developing an application, the source code program corresponding to the application can be a project, and the project file can be a program description file for the application. At present, the Ruby (Ruby is a computer programming language) scripting language is usually used to traverse the file content from the project file directory to parse the project file. The Ruby scripting language needs to scan the file content line by line to extract key information. Especially in complex projects, projects with many dependent libraries and too many resource files, the parsing speed of scanning the project file through the scripting language is relatively slow. Therefore, how to speed up the file parsing speed is an urgent problem to be solved. Summary of the invention
[0003] The embodiments of the present application provide a data processing method, device, server, and storage medium, which help to speed up file parsing and improve data processing efficiency.
[0004] The first aspect of the embodiment of the present application discloses a data processing method, the method comprising:
[0005] Get project engineering documents;
[0006] Converting the project engineering file into a property table file according to a target conversion method, obtaining compilation configuration information corresponding to the target object from the property table file, and determining the class library information of the project engineering file according to the compilation configuration information corresponding to the target object;
[0007] While determining the class library information corresponding to the target object according to the project engineering file, obtaining the attribute configuration information of the project engineering file;
[0008] The class library information and property configuration information of the project engineering file are displayed on the file parsing interface.
[0009] A second aspect of an embodiment of the present application discloses a data processing device, the device comprising:
[0010] A first acquisition unit, used for acquiring project engineering files;
[0011] A determination unit, configured to convert the project engineering file into a property table file according to a target conversion method, obtain compilation configuration information corresponding to the target object from the property table file, and determine the class library information of the project engineering file according to the compilation configuration information corresponding to the target object;
[0012] A second acquisition unit is used to acquire the property configuration information of the project engineering file while determining the class library information corresponding to the target object according to the project engineering file;
[0013] The display unit is used to display the class library information and property configuration information of the project engineering file on the file parsing interface.
[0014] A third aspect of an embodiment of the present application discloses a server, comprising a processor, a memory and a network interface, wherein the processor, the memory and the network interface are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method of the first aspect above.
[0015] A fourth aspect of an embodiment of the present application discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect.
[0016] The fifth aspect of the embodiment of the present application discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a server reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the server executes the method of the first aspect above.
[0017] In the embodiment of the present application, the server can obtain the project engineering file, and can convert the project engineering file into a property table file according to the target conversion method, obtain the compilation configuration information corresponding to the target object from the property table file, and then determine the class library information of the project engineering file according to the compilation configuration information corresponding to the target object. While determining the class library information corresponding to the target object according to the project engineering file, the property configuration information of the project engineering file can also be obtained, and further, the class library information and property configuration information of the project engineering file are displayed on the file parsing interface. By implementing the above method, the file parsing speed can be accelerated and the data processing efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 It is a schematic diagram of the architecture of a data processing system provided in an embodiment of the present application;
[0020] Figure 2 It is a flowchart of a data processing method provided in an embodiment of the present application;
[0021] Figure 3a This is a schematic diagram of an interface for a file parsing and selection interface provided in an embodiment of the present application;
[0022] Figure 3b This is a schematic diagram of a configuration file interface provided in an embodiment of the present application;
[0023] Figure 3c This is a schematic diagram of a file parsing interface provided in an embodiment of the present application;
[0024] Figure 4 It is a flowchart of a data processing method provided in an embodiment of the present application;
[0025] Figure 5a It is a structural diagram of a hash table structure provided in an embodiment of the present application;
[0026] Figure 5b It is a flowchart of a data processing method provided in an embodiment of the present application;
[0027] Figure 6 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0028] Figure 7 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] Cloud Technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0031] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, image websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0032] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0033] This application can store project engineering files or class library information and property configuration information obtained after parsing project engineering files in the "cloud", and obtain and expand the data in the cloud at any time according to needs. For example, after parsing the project engineering files, the parsed class library information and property configuration information can be stored in the "cloud". If you need to understand the parsed data of the project engineering files again, you can get the relevant information from the "cloud".
[0034] In view of the current problem of slow parsing of project engineering files, the present application embodiment provides a Figure 1 The present application relates to a terminal 101 and a server 102 .
[0035] Taking terminal 101 as an example, terminal 101 can obtain the project engineering file imported by the user in the file parsing interface, and send the project engineering file to server 102. After obtaining the project engineering file, server 102 can convert the project engineering file into a property table file according to the target conversion method, obtain the compilation configuration information corresponding to the target object from the property table file, and determine the class library information of the project engineering file according to the compilation configuration information corresponding to the target object. While determining the class library information corresponding to the target object according to the project engineering file, server 102 can also obtain the property configuration information of the project engineering file.
[0036] Subsequently, the server 102 sends the determined class library information and property configuration information of the project engineering file to the terminal 101 , so that the class library information and property configuration information of the project engineering file are displayed on the file parsing interface of the terminal.
[0037] Figure 1 The server 102 shown can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0038] The terminal 101 may be a smart device such as a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile Internet device (MID), etc. The terminal 101 and the server 102 may be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0039] based on Figure 1 A data processing system, an embodiment of the present application proposes a data processing method, a server can obtain a project engineering file, and can convert the project engineering file into an attribute table file according to a target conversion method, obtain the compilation configuration information corresponding to the target object from the attribute table file, then determine the class library information of the project engineering file according to the compilation configuration information corresponding to the target object, and while determining the class library information corresponding to the target object according to the project engineering file, the attribute configuration information of the project engineering file can also be obtained, and further, the class library information and attribute configuration information of the project engineering file are displayed on the file parsing interface. By implementing the above method, the file parsing speed can be accelerated and the data processing efficiency can be improved.
[0040] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0041] See also Figure 2 , Figure 2 : is a flow chart of a data processing method provided in an embodiment of the present application, the data processing method comprises the following steps:
[0042] S201: Obtain project engineering files.
[0043] Among them, the project engineering file can be a program description file for the application. For example, when the user needs to know the relevant information about running the application, the required information can be obtained from the project engineering file. The project engineering file can contain information such as the relevant editing settings for generating the application and the files included in the project, such as the name of the application, the component modules of the application, the class libraries referenced by the running application, etc. For example, the project engineering file can be an Xcode project engineering file, where Xcode is an integrated development tool running on a specific operating system and is the fastest way to develop applications. Xcode has a unified user interface design, and the coding, testing, and debugging of the application can all be completed in a simple window. The corresponding source code program of the application can be understood as an Xcode project.
[0044] In one implementation, Figure 3a As shown, when it is necessary to obtain the required information from the project engineering file, the project engineering file can be parsed, and the parsed information can be the required information. Specifically, the terminal display screen can output a file parsing selection interface, and the file parsing selection interface can include a file setting area. The file setting area can be as follows Figure 3a The area marked by 301. The file setting area is used for users to import project engineering files. After importing the project engineering files, the server can obtain the project engineering files for subsequent parsing process.
[0045] In one implementation, the method of importing the project file can be to directly drag the project file to Figure 3a The file setting area shown in , or the project engineering file can be obtained according to the path of the project engineering file. Wherein, in the case of obtaining the project engineering file according to the path of the project engineering file, the user can store the project engineering file in a storage area in the terminal before parsing the project engineering file, and the path of the storage area is the path to obtain the project engineering file, then, the project engineering file can be obtained according to the path of the project engineering file. For example, when the user clicks "Open Project" in the area marked by 301 in 3a, the project engineering file can be obtained according to the path of the project engineering file. Considering that the project engineering file is in a specific format, the first suffix of the project engineering file also has a specific form, for example, the specific form includes xcodeproj and xcworkspace. Then, when there are multiple files under the path of the project engineering file, the project engineering file can be obtained according to the first suffix of the file, that is, a file with the suffix xcodeproj or a file with the suffix xcworkspace can be obtained, and the obtained file is the project engineering file.
[0046] S202: converting the project engineering file into a property table file according to the target conversion method, obtaining the compilation configuration information corresponding to the target object from the property table file, and determining the class library information of the project engineering file according to the compilation configuration information corresponding to the target object.
[0047] Among them, the number of target objects may include one or more, and the target object may refer to an object for the main function of the application, or an object for implementing the plug-in function included in the application. For example, a certain application is a social application, and the main function of the application is information interaction. For this social application, other plug-in functions may also be included, such as information push function, scan function, etc.
[0048] In one implementation, the content in the project engineering file is JSON data, that is, the content in the project engineering file is written using a JSON string, and the speed of reading the content in the project engineering file is slow. Therefore, in order to speed up the data reading speed, the project engineering file can be converted to convert the project engineering file into a file that is easier to read. Among them, the above-mentioned easier-to-read file can be a property table (Plist) file, then the project engineering file can be converted into a property table file, wherein the project engineering file can be converted into a property table file according to a target conversion method, and the target conversion method can be through the JSONDecoder class in the Swift method. Swift is an open source programming language that supports multiple programming paradigms and compiled styles. The JSONDecoder class can be used to convert JSON strings into dictionary type data. Then, by calling the JSONDecoder().decode interface in the Swift method, the project engineering file can be converted into a property table file, wherein the data in the property table file is dictionary type data, and the dictionary type data can be understood as data stored in the form of key-value pairs, that is, there are many keys (Key) in the property table file, and the values corresponding to the Key. Then, the data in the attribute table file is read according to the Key, and reading the file in this way can effectively speed up the reading speed or acquisition speed of the data.
[0049] In one implementation, after obtaining the property table file, the compilation configuration information corresponding to the target object can be obtained from the property table file, wherein the number of target objects can include one or more, and each target object has its corresponding compilation configuration information. The target object can refer to an object for the main function of the application, or an object for implementing the plug-in function included in the application. For example, a certain application is a social application, and the main function of the application is information interaction. For the social application, other plug-in functions can also be included, such as information push function, scan function, etc. Then, the compilation configuration information corresponding to the target object can be understood as the compilation configuration information required to implement the main function or plug-in function in the application. After determining the compilation configuration information corresponding to the target object, the class library information of the project engineering file can be determined according to the compilation configuration information corresponding to the target object. Specifically, the candidate class library set of the target object can be determined according to the compilation configuration information corresponding to the target object, wherein the candidate class library set can include one or more candidate class libraries, wherein the candidate class library can include the following four types: ordinary application (Application), dynamic library (Framework), static library (StaticLibrary): software package (Package). After determining the candidate class library set, the path corresponding to each candidate class library in the candidate class library set can be obtained from the attribute table file, so as to determine the reference file corresponding to each candidate class library according to the path corresponding to each candidate class library, and then determine the class library information of the project engineering file according to the reference file corresponding to each candidate class library.
[0050] S203: While determining the class library information corresponding to the target object according to the project engineering file, acquiring the property configuration information of the project engineering file.
[0051] In one implementation, while determining the class library information corresponding to the target object according to the project engineering file, the property configuration information of the project engineering file can also be obtained. This allows the parallel processing of obtaining the class library information and obtaining the property configuration information, thereby improving data processing efficiency and effectively reducing the parsing time of the project engineering file. The property configuration information of the project engineering file can be stored in the configuration file of the project engineering file, for example, Figure 3b The following is the content displayed in the configuration file, which contains the property configuration information of the project engineering file.
[0052] In one implementation, the configuration file can be obtained according to the path of the configuration file of the project engineering file. Specifically, when creating a project engineering file, the configuration file of the project engineering file is usually stored in a specified directory of the project engineering file. For example, the directory can be a work directory, such as Figure 3bThe data marked by 302 is the path of the configuration file. Then, the path of the configuration file is in the specified directory of the project engineering file, that is, the configuration file can be obtained in the specified directory of the project engineering file, or it can be said that the project engineering file is found through the path of the project engineering file, and then the configuration file is obtained in the specified directory of the project engineering file. In the process of obtaining the configuration file, there may be a situation where the configuration file cannot be obtained, for example, a sudden power outage. Then, in the case where the configuration file cannot be successfully obtained, considering that the project engineering file can also include configuration attribute information, the attribute configuration information can also be obtained according to the project engineering file processing.
[0053] In one implementation, if the configuration file of the project engineering file is successfully obtained, the corresponding property configuration information can be obtained from the configuration file according to the reference information identifier. Among them, the reference information identifier can be the configuration property information used in the function of editing the project engineering file. In this case, the reference information identifier can include the project engineering file name, application identifier (App ID), workspace identifier (Workspace ID), and application unique identifier (Bundle ID); and the reference information identifier can also be the configuration property information used in the function of overviewing the project engineering file. In this case, the reference information identifier can include the baseline version of the project engineering file, the type of the project engineering file, and the most recent editing time of the project engineering file. The reference information identifier can also include other data, which is not limited in this application. For example, this application takes the example that the reference information identifier can include the project engineering file name, application identifier, workspace identifier, and application unique identifier. Specifically, the data corresponding to the project engineering file name, application identifier, workspace identifier, and application unique identifier can be obtained from the configuration file, and the obtained data is the property configuration information. As Figure 3b The data marked by 303 is the data corresponding to the project engineering file name, and the data marked by 304 includes the data corresponding to the application identifier, the workspace identifier, and the application unique identifier. Then, after the property configuration information is obtained, the obtained property configuration information can be determined as the property configuration information of the project engineering file.
[0054] In one implementation, if the configuration file of the project engineering file is not successfully obtained, the project engineering file can be converted into a property table file according to the target conversion method, wherein the conversion of the project engineering file into the property table file can refer to the above description and will not be repeated here. After obtaining the property table file, the corresponding property configuration information can be obtained from the property table file according to the reference information identifier, and the obtained property configuration information is determined as the property configuration information of the project engineering file.
[0055] In one implementation, before obtaining the property configuration information from the configuration file or the property table file, a project object model can be pre-set in the parser, and the project object model includes multiple fields (which can also be understood as the above-mentioned reference information identifier), and the field data corresponding to the field is the property configuration information. Then, when obtaining the property configuration information from the configuration file or the property table file, the project object model can be obtained first. After obtaining the project object model, the field data corresponding to each of the multiple fields can be obtained from the configuration file or the property table file, and the obtained field data is the property configuration information of the project engineering file. After obtaining the field data, the obtained field data can also be written to the corresponding field in the project object model for storage, so the configuration file information of the project engineering file can also be obtained from the project object model later.
[0056] S204: Displaying class library information and property configuration information of the project engineering file on the file parsing interface.
[0057] In one implementation, the server can output a file parsing interface and display it on a user terminal interface, and the server obtains the class library information and property configuration information of the project engineering file, that is, the class library information and property configuration information of the project engineering file can be displayed on the file parsing interface, such as Figure 3c The area marked by 305 shows the class library information, and the area marked by 306 shows the property configuration information.
[0058] In an embodiment of the present application, the server can obtain a project engineering file, and can convert the project engineering file into an attribute table file according to a target conversion method, obtain the compilation configuration information corresponding to the target object from the attribute table file, and then determine the class library information of the project engineering file according to the compilation configuration information corresponding to the target object. While determining the class library information corresponding to the target object according to the project engineering file, the attribute configuration information of the project engineering file can also be obtained, and further, the class library information and attribute configuration information of the project engineering file are displayed on the file parsing interface. By implementing the above method, the file parsing speed can be accelerated and the data processing efficiency can be improved.
[0059] See also Figure 4 , Figure 4 : is a flow chart of a data processing method provided in an embodiment of the present application, the data processing method comprises the following steps:
[0060] S401: Obtain project engineering files.
[0061] S402: Convert the project engineering file into a property table file according to the target conversion method, and obtain the compilation configuration information corresponding to the target object from the property table file.
[0062] S403: Determine a candidate class library set of the target object according to the compilation configuration information corresponding to the target object.
[0063] The candidate class library set of the target object may include one or more candidate class libraries.
[0064] In one implementation, the compilation configuration information of the target object may include build settings (BuildSettings) information and build phases (Build Phases) information. Among them, the build settings information mainly includes the editing configuration of the application. For example, the editing configuration may include file references between class libraries, that is, the reference relationship between class libraries. For example, if the target object is a plug-in function in the application, such as the notification message function, then the implementation of the notification message function may refer to multiple class libraries, and the implementation of any class library function may also refer to other class libraries. It can be seen that in order to implement a plug-in function in the application, multiple class libraries may be referenced. Then, according to the reference relationship between class libraries, the class library or multiple class libraries used by the target object can be determined, and the class library or multiple class libraries used by the target object determined above can be the candidate class libraries in the candidate class library set. The build phase information is the information in the steps required to compile an application, wherein the steps required by the application may include compile source files (Compile Sources), link binary files and libraries (Link Binary With Libraries), and copy bundle resources (Copy Bundle Resources). Among them, compiling source files refers to generating source files included in the application, connecting binary files and libraries refers to generating class library files referenced in the application, and copying bound resources refers to generating resource files included in the application. Then, according to the build phase information, the class library referenced by the target object can also be obtained, that is, the candidate class library in the candidate class library set. From the above, it can be seen that the candidate class library set of the target object can be determined according to the compilation configuration information corresponding to the target object. When the number of target objects includes multiple, the candidate class library set corresponding to each target object can be determined according to the compilation configuration information corresponding to each target object. The specific implementation method can refer to the above description and will not be repeated here.
[0065] S404: Obtain the path corresponding to each candidate class library in the candidate class library set from the attribute table file.
[0066] In one implementation, the property table file may include the path of the class library used in the generated application. Then, after determining the candidate class library set of the target object, the path corresponding to each candidate class library in the candidate class library set may be obtained from the property table file.
[0067] S405: For any candidate class library in the candidate class library set, scan all files under the path corresponding to the candidate class library, and determine a reference file matching the specified file format from all the files.
[0068] In one implementation, each class library will have a file describing the relevant functional information of the class library. For example, the file may contain the class library name, the class library version number, and the class library condition description of the class library, etc. Then, the file can be obtained to determine the subsequent class library information. Considering that the format of the file may include plist or config or cache, that is, the second suffix of the file may include any one of plist, config and cache, the specified file format means that the second suffix of the file is any one of plist, config and cache. Then, for any candidate class library in the candidate class library set, all files under the path corresponding to the candidate class library can be scanned, and reference files that match the specified file format can be determined from all files, that is, the reference file can be obtained according to the suffix of the file.
[0069] It should be noted that when developing applications, many third-party libraries are usually used. One of the libraries may refer to other libraries. Therefore, to use it, you must download other libraries, and other libraries refer to other libraries. It is very troublesome to download the required libraries manually one by one. Then you can use the library management tool to manage the libraries used in the application. For example, Xcode projects usually use CocoaPods and SwiftPackage to manage libraries. CocoaPods and Swift Package are both library management tools. For CocoaPods, you can use the Pods folder as the root directory to recursively traverse the files in the root directory to find the reference file. For SwiftPackage, you can use the SourcePackages folder as the root directory to recursively traverse the files in the root directory to find the reference file.
[0070] In one implementation, after obtaining the path of the candidate class library, the class library folder can be searched according to the path to find the reference file corresponding to the candidate class library from the class library folder. Specifically, taking the case where the class library is managed by a class library management tool as an example, the search can be started from the root directory (the root directory and each file or folder under the root directory can be understood as a class library folder) in a recursive manner to find the reference file. In order to speed up the search for reference files, the root directory in the class library management tool can be put into an array (the array can be understood as a file list), and each element in the array corresponds to each folder or file in the root directory. Then, each file in the array can be recursively searched. If a certain element (file or folder) in the array has a subdirectory, the recursion continues, and the termination condition is that the subdirectory of a certain array element is empty.
[0071] Among them, when a file is recursively found in the array, it can be determined whether the current file is a reference file according to the specified file format. Specifically, the suffix name of the file to be searched currently can be matched with the second suffix name. For example, if the suffix name of the file to be searched currently is any one of plist, config and cache, it can be determined that the suffix name of the file to be searched currently matches the second suffix name. If the suffix name of the file to be searched currently is not any one of plist, config and cache, it is necessary to search for the next file in the array and match the suffix name. In the case where the suffix name of the searched file matches the second suffix name, the content of the matched file can be read. If the relevant functional information description about the class library can be read from the content, for example, the class library name of the class library, the class library version number of the class library, and the class library condition description of the class library can be read from the content, the matched file can be determined as a reference file, or the scanning can be stopped. If there is no relevant functional information description about the class library in the content, it is necessary to search for the next file in the array and perform subsequent operations.
[0072] S406: Determine the class library information of the project engineering file according to the reference file corresponding to each candidate class library.
[0073] In one implementation, for any candidate class library in the candidate class library set, the class library name and class library version number of the candidate class library can be extracted from the content of the reference file corresponding to the candidate class library. Then, after obtaining the class library name and class library version number of each candidate class library, the class library information of the project engineering file can be determined according to the class library name and class library version number of each candidate class library. Among them, the number of target objects can be one or more, and the method of determining the class library information of the project engineering file according to the class library name and class library version number of each candidate class library is different depending on the number of target objects.
[0074] Optionally, when the number of target objects is one, the class library information of the project engineering file can be determined according to the class library name of each candidate class library in the candidate class library set. The class library information can also be a set of candidate class libraries, and each candidate class library can be named with its corresponding class library name.
[0075] Optionally, when there are multiple target objects, each target object has a corresponding candidate library set, and in multiple candidate library sets, there may be the same candidate library. In this case, the same candidate library can be merged, wherein the same candidate library can refer to the same corresponding library name, or the same type of library but different library version numbers. For example, there is candidate library A in candidate library set 1, and there is candidate library B in candidate library set 1, but the library names of candidate library A and candidate library B are the same. In this case, candidate library A and candidate library B can be merged into one candidate library. For another example, there is candidate library A in candidate library set 1, and there is candidate library B in candidate library set 1. When candidate library A and candidate library B are the same type of library but have different library version numbers, in this case, candidate library A and candidate library B can be merged into one candidate library. Then, multiple candidate class library sets can be deduplicated according to the class library name and class library version number of each candidate class library in the candidate class library set corresponding to each target object, that is, the same candidate class libraries are merged as described above. After deduplicating multiple candidate class library sets, a target class library set can be obtained, which is a set of candidate class libraries obtained after deduplicating all candidate class libraries in multiple candidate class library sets. After obtaining the target class library set, the class library information of the project engineering file can be determined according to the class library name of each class library in the target class library set.
[0076] In one implementation, after obtaining the class library information of the project engineering file, it can also be mapped in a hash table. The hash table structure can be as follows: Figure 5a As shown, the target class library set may include multiple sub-class library sets, each sub-class library set corresponds to a target object, each target object directly determines the sub-class library set to which it belongs from the hash table, and each class library in the sub-class library set can also determine the target object to which it belongs. For example, the sub-class library set of target object A includes class library a, class library b, and class library c, and the sub-class library set of target object B includes class library b, class library d, and class library e. It can be understood that the class libraries in the target class library set can be displayed in a list, and the list can be as follows: Figure 3cIn the list of displaying class library information marked by 305, when displaying class library information in the file parsing interface according to the target class library collection, the dependency relationship between the class libraries of each target object can be parsed, and when parsing the dependency relationship, the target class library collection can be traversed, so that the class libraries can be quickly combined when parsing the dependency relationship between the class libraries. When traversing the target class library collection, each element (element, i.e., class library) can be added with a reference to the array to create a variable array as the data source of the list. For example, Figure 3c The Pods directory in the area marked by 305 shows the class libraries in the target class library collection, where each class library can be named after the class library name corresponding to the device.
[0077] It can be understood that based on the above-mentioned reference relationship between class libraries and the class library version numbers of each class library, the dependency relationship between the class libraries of the target object can be determined. For example, the corresponding class library set of a target object includes class library 1 and class library 2, wherein class library 1 references class library 2, the class library version number of class library 1 is P1, and the class library version number of class library 2 is Q2. Then, the main function or plug-in function in the application corresponding to the target object is implemented by class library 1 with class library version number P1 and class library 2 with class library version number Q2, and class library 1 and class library 2 are mutually dependent.
[0078] S407: While determining the class library information corresponding to the target object according to the project engineering file, the property configuration information of the project engineering file is obtained.
[0079] S408: Displaying the class library information and property configuration information of the project engineering file on the file parsing interface.
[0080] The specific implementation of steps S401-S402 and S407-S408 can refer to the specific description of steps S201-S202 and S203-S204 in the above embodiment, which will not be repeated here.
[0081] In an embodiment of the present application, a server can obtain a project engineering file. The project engineering file is converted into an attribute table file according to a target conversion method, and the compilation configuration information corresponding to the target object is obtained from the attribute table file. The candidate class library set of the target object is determined according to the compilation configuration information corresponding to the target object. The path corresponding to each candidate class library in the candidate class library set is obtained from the attribute table file. For any candidate class library in the candidate class library set, all files under the path corresponding to the candidate class library are scanned, and reference files matching the specified file format are determined from all files. The class library information of the project engineering file is determined according to the reference file corresponding to each candidate class library. While determining the class library information corresponding to the target object according to the project engineering file, the attribute configuration information of the project engineering file is obtained. The class library information and attribute configuration information of the project engineering file are displayed on the file parsing interface. By implementing the above method, the file parsing speed can be accelerated and the data processing efficiency can be improved.
[0082] To better understand the data processing method provided in the embodiment of the present application, the following takes the project engineering file as an Xcode project engineering file and the target conversion method as the JSONDecoder class in the Swift method as an example. Figure 5b The process shown in the figure is further explained. Figure 5b As shown, you can first import the project engineering file to obtain the project engineering file. Specifically, you can load the file according to the path of the project engineering file and the suffix of the project engineering file, where the suffix can be xcodeproj and xcworkspace. After obtaining the project engineering file, you can parse the project engineering file according to the created parser to obtain library class information and property configuration information, where the class library includes the following four types: ordinary application (Application), dynamic library (Framework), static library (StaticLibrary): software package (Package). Among them, when obtaining the class library information and property configuration information of the project engineering file, the class library information and property configuration information can be obtained in a parallel processing manner to speed up the parsing speed.
[0083] In the process of determining the class library information, it can be understood that there may not be only one target object (Target) in the Xcode project, and each target object may correspond to one or more class libraries. Therefore, the class libraries of all target objects in the project file can be organized and deduplicated to obtain the final class library information. The project file can be converted into a property table file for reading by calling the JSONDecoder().decode interface in the Swift method, and then the editing configuration information of each target object can be obtained in the property table file. The compilation configuration information may include BuildSettings and BuildPhases (Compile Sources / Link Binary WithLibraries / Copy Bundle Resources, etc.). BuildSettings mainly includes compilation configuration, including file references between class libraries, and BuildPhases also includes the class libraries referenced by the target object. Then, through the reference relationship of the class libraries in BuildSettings and BuildPhases, one or more candidate class libraries of the target object, that is, the candidate class library set, can be obtained. After obtaining the candidate class library set for each target object, the path of each candidate class library can be obtained from the property table file. Considering that the path in the property table file can be an absolute path or a relative path, the path of each candidate class library can also be an absolute path or a relative path. Xcode projects usually manage class libraries in the form of CocoaPods and SwiftPackage. Each class library will have a file with relevant functional information description, which is also a reference file. The file format can be any of plist, config and cache. For any candidate class library, all files under the path corresponding to the candidate class library can be scanned to determine the reference file from all files. Take the Pods folder or SourcePackages folder as the root directory and recursively traverse each file in the root directory to find the reference file. After obtaining the path of each candidate class library, you can start searching for folders according to the path. You can use a recursive algorithm to start searching from the root directory. You can put the root directory into an array (the array can be understood as a file list), and each element in the array corresponds to each folder or file in the root directory. Then, you can traverse the array, and the termination condition is that the subdirectory of a certain array element is empty. Each time a file is searched, the suffix of the searched file is matched. After matching any one of plist, config and cache, the content of the file can be read. If the content contains the class library name, class library version number, target object condition description, etc., the recursive traversal is stopped and the file is the reference file.Among them, the reference file may include the class library name and class library version number of the candidate class library, then, the target class library set can be determined according to the class library name and class library version number of the candidate class library, and after the target class library set is determined, it can also be determined to establish a mapping relationship between each target object and the class library in the target class library set (the mapping relationship can be referenced. Figure 5a The hash table shown in the figure) can be used to provide a basis for subsequent editing of the project, that is, the target library collection and the mapping relationship between each target object and the library in the target library collection can be used as the data source, which is more convenient for displaying the library information on the file parsing interface later.
[0084] While parsing the class library information, a child thread can be started to obtain the property configuration information. The property configuration information can be obtained by reading the configuration file of the project. The format of the configuration file can be shown in 3b. When creating any project, the configuration file can be placed in the work / configuration file directory of the project file. When parsing the project, the parser can obtain the configuration file in the directory through the path of the project file. If the configuration file is successfully obtained, the property configuration information of the project file is obtained from the configuration file; if the configuration file is not successfully obtained, the JSONDecoder().decode interface in the swift method can be called to convert the project file into a property table file, and then the property configuration information of the project file is obtained from the property table file. Among them, before obtaining the property configuration information, a project object model can be created inside the parser, and the member variables contained in the project object model can be (member variables can be understood as the fields described above) the properties used for editing the project. For example, the configuration properties used in the editing project function include four values: project name (project file name), App ID (application ID), Workspace ID (workspace ID) and BundleID (application unique ID). If the member variables contained in the project object model are the properties used in the project overview, the member variables contained may be the baseline version, type, last edited time, etc. Then, after obtaining the configuration file or the property table file, the data corresponding to the member variables contained in the project object model can be obtained from the configuration file or the property table file. The obtained data is the property configuration information, and the obtained data can be written into the project object model. After obtaining the property configuration information, the property configuration information can be displayed on the file parsing interface.
[0085] See also Figure 6 , Figure 6 1 is a schematic diagram of a data processing device according to an embodiment of the present application. The data processing device described in this embodiment includes:
[0086] The first acquisition unit 601 is used to acquire project engineering files;
[0087] The determining unit 602 is used to convert the project engineering file into a property table file according to the target conversion method, obtain the compilation configuration information corresponding to the target object from the property table file, and determine the class library information of the project engineering file according to the compilation configuration information corresponding to the target object;
[0088] The second acquisition unit 603 is used to acquire the property configuration information of the project engineering file while determining the class library information corresponding to the target object according to the project engineering file;
[0089] The display unit 604 is used to display the class library information and property configuration information of the project engineering file on the file parsing interface.
[0090] In one implementation, the determining unit 602 is specifically configured to:
[0091] Determine a candidate class library set of the target object according to the compilation configuration information corresponding to the target object, wherein the candidate class library set includes one or more candidate class libraries;
[0092] Obtaining a path corresponding to each candidate library in the candidate library set from the attribute table file;
[0093] For any candidate library in the candidate library set, scan all files under the path corresponding to the candidate library, and determine a reference file matching a specified file format from all the files;
[0094] The class library information of the project engineering file is determined according to the reference file corresponding to each candidate class library.
[0095] In one implementation, the determining unit 602 is specifically configured to:
[0096] Obtaining reference relationships between class libraries from compilation configuration information corresponding to the target object;
[0097] A set of candidate class libraries corresponding to the target object is determined according to the reference relationship between the class libraries.
[0098] In one implementation, there are multiple target objects, and each target object has a corresponding candidate class library set; the determining unit 602 is specifically configured to:
[0099] For any candidate library in the candidate library set, extract the library name and the library version number from the content of the reference file corresponding to the candidate library;
[0100] According to the library name and library version number of each candidate library in the candidate library set corresponding to each target object, deduplication processing is performed on multiple candidate library sets to obtain a target library set;
[0101] The class library information of the project engineering file is determined according to the class library name of each class library in the target class library set.
[0102] In one implementation, the second obtaining unit 603 is specifically configured to:
[0103] If the configuration file of the project engineering file is successfully obtained, the property configuration information of the project engineering file is obtained from the configuration file;
[0104] If the configuration file of the project engineering file is not successfully obtained, the project engineering file is processed to obtain the property configuration information of the project engineering file.
[0105] In one implementation, the second obtaining unit 603 is specifically configured to:
[0106] If the configuration file of the project engineering file is successfully obtained, then the corresponding property configuration information is obtained from the configuration file according to the reference information identifier;
[0107] The acquired property configuration information is determined as the property configuration information of the project engineering file.
[0108] In one implementation, the second obtaining unit 603 is specifically configured to:
[0109] If the configuration file of the project engineering file is not successfully obtained, converting the project engineering file into the attribute table file according to the target conversion method;
[0110] Acquire corresponding attribute configuration information from the attribute table file according to the reference information identifier;
[0111] The acquired property configuration information is determined as the property configuration information of the project engineering file.
[0112] It is understood that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional units in the embodiments of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.
[0113] See also Figure 7 , Figure 7701, memory 702, and network interface 703. The processor 701, memory 702, and network interface 703 can exchange data.
[0114] The processor 701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0115] The memory 702 may include a read-only memory and a random access memory, and provide program instructions and data to the processor 701. A portion of the memory 702 may also include a non-volatile random access memory. When the processor 701 calls the program instructions, it is used to execute:
[0116] Obtain project engineering documents;
[0117] Converting the project engineering file into a property table file according to a target conversion method, obtaining compilation configuration information corresponding to the target object from the property table file, and determining the class library information of the project engineering file according to the compilation configuration information corresponding to the target object;
[0118] While determining the class library information corresponding to the target object according to the project engineering file, obtaining the attribute configuration information of the project engineering file;
[0119] The class library information and property configuration information of the project engineering file are displayed on the file parsing interface.
[0120] In one implementation, the processor 701 is specifically configured to:
[0121] Determine a candidate class library set of the target object according to the compilation configuration information corresponding to the target object, wherein the candidate class library set includes one or more candidate class libraries;
[0122] Obtaining a path corresponding to each candidate library in the candidate library set from the attribute table file;
[0123] For any candidate library in the candidate library set, scan all files under the path corresponding to the candidate library, and determine a reference file matching a specified file format from all the files;
[0124] The class library information of the project engineering file is determined according to the reference file corresponding to each candidate class library.
[0125] In one implementation, the processor 701 is specifically configured to:
[0126] Obtaining reference relationships between class libraries from compilation configuration information corresponding to the target object;
[0127] A set of candidate class libraries corresponding to the target object is determined according to the reference relationship between the class libraries.
[0128] In one implementation, there are multiple target objects, and each target object has a corresponding candidate class library set; the processor 701 is specifically configured to:
[0129] For any candidate library in the candidate library set, extract the library name and the library version number from the content of the reference file corresponding to the candidate library;
[0130] According to the library name and library version number of each candidate library in the candidate library set corresponding to each target object, deduplication processing is performed on multiple candidate library sets to obtain a target library set;
[0131] The class library information of the project engineering file is determined according to the class library name of each class library in the target class library set.
[0132] In one implementation, the processor 701 is specifically configured to:
[0133] If the configuration file of the project engineering file is successfully obtained, the property configuration information of the project engineering file is obtained from the configuration file;
[0134] If the configuration file of the project engineering file is not successfully obtained, the project engineering file is processed to obtain the property configuration information of the project engineering file.
[0135] In one implementation, the processor 701 is specifically configured to:
[0136] If the configuration file of the project engineering file is successfully obtained, then the corresponding property configuration information is obtained from the configuration file according to the reference information identifier;
[0137] The acquired property configuration information is determined as the property configuration information of the project engineering file.
[0138] In one implementation, the processor 701 is specifically configured to:
[0139] If the configuration file of the project engineering file is not successfully obtained, converting the project engineering file into the attribute table file according to the target conversion method;
[0140] Acquire corresponding attribute configuration information from the attribute table file according to the reference information identifier;
[0141] The acquired property configuration information is determined as the property configuration information of the project engineering file.
[0142] The present application also provides a computer storage medium in which program instructions are stored. When the program is executed, it may include: Figure 2 or Figure 4 Part or all of the steps of the data processing method in the corresponding embodiment.
[0143] It should be noted that, for the above-mentioned various 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 be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0144] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0145] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the server reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the server executes the steps performed in the embodiments of the above methods.
[0146] The above is a detailed introduction to a data processing method, device, server and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data processing method, characterized in that: include: Get project engineering documents; Convert the project engineering file into a property table file according to a target conversion method, and obtain the compilation configuration information corresponding to the target object from the property table file; Determine a candidate class library set of the target object according to the compilation configuration information corresponding to the target object, wherein the candidate class library set includes one or more candidate class libraries; Obtaining a path corresponding to each candidate library in the candidate library set from the attribute table file; for any candidate library in the candidate library set, scanning all files under the path corresponding to the candidate library, and determining a reference file matching a specified file format from all the files; Determine the class library information of the project engineering file according to the reference file corresponding to each candidate class library; While determining the class library information corresponding to the target object according to the project engineering file, obtaining the attribute configuration information of the project engineering file; The class library information and property configuration information of the project engineering file are displayed on the file parsing interface.
2. The method according to claim 1, characterized in that The step of determining a candidate class library set of the target object according to the compilation configuration information corresponding to the target object includes: Obtaining reference relationships between class libraries from compilation configuration information corresponding to the target object; A set of candidate class libraries corresponding to the target object is determined according to the reference relationship between the class libraries.
3. The method according to claim 1 or 2, characterized in that: There are multiple target objects, and each target object has a corresponding candidate library set; The determining the class library information of the project engineering file according to the reference file corresponding to each candidate class library includes: For any candidate library in the candidate library set, extract the library name and the library version number from the content of the reference file corresponding to the candidate library; According to the library name and library version number of each candidate library in the candidate library set corresponding to each target object, deduplication processing is performed on multiple candidate library sets to obtain a target library set; The class library information of the project engineering file is determined according to the class library name of each class library in the target class library set.
4. The method according to claim 1, characterized in that: The obtaining of the property configuration information of the project engineering file includes: If the configuration file of the project engineering file is successfully obtained, the property configuration information of the project engineering file is obtained from the configuration file; If the configuration file of the project engineering file is not successfully obtained, the project engineering file is processed to obtain the property configuration information of the project engineering file.
5. The method according to claim 4, characterized in that If the configuration file of the project engineering file is successfully obtained, the property configuration information of the project engineering file is obtained from the configuration file, including: If the configuration file of the project engineering file is successfully obtained, then the corresponding property configuration information is obtained from the configuration file according to the reference information identifier; The acquired property configuration information is determined as the property configuration information of the project engineering file.
6. The method according to claim 4, characterized in that If the configuration file of the project engineering file is not successfully obtained, the project engineering file is processed to obtain the property configuration information of the project engineering file, including: If the configuration file of the project engineering file is not successfully obtained, converting the project engineering file into the attribute table file according to the target conversion method; Acquire corresponding attribute configuration information from the attribute table file according to the reference information identifier; The acquired property configuration information is determined as the property configuration information of the project engineering file.
7. A data processing device, characterized in that: include: A first acquisition unit, used for acquiring project engineering files; A determination unit, configured to convert the project engineering file into a property table file according to a target conversion method, and obtain compilation configuration information corresponding to the target object from the property table file; The determining unit is further used to: determine a candidate class library set of the target object according to the compilation configuration information corresponding to the target object, the candidate class library set including one or more candidate class libraries; obtain a path corresponding to each candidate class library in the candidate class library set from the attribute table file; for any candidate class library in the candidate class library set, scan all files under the path corresponding to the candidate class library, and determine a reference file matching a specified file format from all the files; Determine the class library information of the project engineering file according to the reference file corresponding to each candidate class library; A second acquisition unit is used to acquire the property configuration information of the project engineering file while determining the class library information corresponding to the target object according to the project engineering file; The display unit is used to display the class library information and property configuration information of the project engineering file on the file parsing interface.
8. A server, characterized in that: The method comprises a processor, a memory and a network interface, wherein the processor, the memory and the network interface are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises program instructions, wherein the program instructions are stored in a computer-readable storage medium, a processor reads the program instructions from the computer-readable storage medium, and the processor executes the program instructions to perform the method according to any one of claims 1 to 6.
