A file generation method, device, server and storage medium

Obtain and display component information through a visual interface, and automatically generate Podfile files, which solves the problem of tedious and error-prone manual writing of Podfile files, and improves the speed and efficiency of file generation.

CN113434472BActive Publication Date: 2024-10-22PINGAN INT SMART CITY TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110716701.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-25
Publication Date
2024-10-22
Estimated Expiration
2041-06-25

AI Technical Summary

Technical Problem

During the application development process, when manually writing Podfile files, you need to frequently query component information of third-party libraries and handle dependency conflicts, which results in cumbersome, time-consuming and error-prone operations, which cannot improve work efficiency.

Method used

Obtain and display the required component information through the visual interface, reducing the time for users to query components in different files, avoiding manual writing of target files, using the server to obtain file generation requests, obtaining component information of specified files, and generating target files based on user selection operations.

Benefits of technology

It improves the speed of file generation, reduces the probability of file errors, simplifies the file management process, and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113434472B_ABST
    Figure CN113434472B_ABST
Patent Text Reader

Abstract

The embodiment of the present application relates to the field of data processing, and discloses a file generation method, device, server and storage medium, the method comprising: obtaining a file generation request, the file generation request carries identification information and path information for obtaining one or more specified files; obtaining one or more specified files corresponding to the identification information and path information; obtaining component information of the components of each specified file, and determining one or more target components according to the component information of the components of each specified file; displaying the component information corresponding to the one or more target components on the first parameter area of ​​the user configuration interface; obtaining the user's selection operation on the component information of one or more target components in the first parameter area, and generating the target file according to the selected component information. The file generation speed can be increased and the probability of file errors can be reduced. The present application relates to blockchain technology, such as the above information can be written into the blockchain for use in scenarios such as information search.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a file generation method, device, server and storage medium. Background Art

[0002] With the rapid development of computer technology, more and more applications are being developed. In the process of application development, a large number of third-party libraries are generally referenced. In order to facilitate the unified management of these third-party libraries, it is necessary to write the Podfile file first. The Podfile file is used to configure the dependencies, versions and other related information between the third-party libraries and the project. When developing an application, the source code program corresponding to the application development can be understood as a project. At present, Podfile files are usually written manually. When it is necessary to write Podfile files, manual writing methods are usually adopted. During the writing process, it is necessary to constantly query the component information of each warehouse or perform dependency conflict troubleshooting, and these operations are all performed manually, which is quite troublesome, time-consuming and labor-intensive, and it is easy to make mistakes during sorting, which cannot improve work efficiency. Summary of the invention

[0003] The embodiments of the present application provide a file generation method, device, server and storage medium. By implementing the above method, the required component information can be displayed on the interface using a visual interface, which can greatly reduce the time users spend searching for components in different files and avoid manual writing of target files, thereby improving the file generation speed and reducing the probability of file errors.

[0004] In a first aspect, an embodiment of the present application discloses a method for generating a file, the method comprising:

[0005] Obtaining a file generation request, wherein the file generation request carries identification information and path information for obtaining one or more specified files;

[0006] Acquire one or more specified files corresponding to the identification information and the path information carried in the file generation request;

[0007] Obtaining component information of a component of each of the one or more specified files, and determining one or more target components according to the component information of the component of each of the specified files;

[0008] Displaying component information corresponding to the one or more target components in a first parameter area of ​​a user configuration interface;

[0009] Acquire a user's selection operation on component information of the one or more target components in the first parameter area, and generate a target file according to the component information selected by the selection operation.

[0010] In a second aspect, an embodiment of the present application discloses a file generation device, the device comprising:

[0011] A first acquisition unit, used to acquire a file generation request, wherein the file generation request carries identification information and path information for acquiring one or more specified files;

[0012] A second acquisition unit, configured to acquire one or more specified files corresponding to the identification information and the path information carried in the file generation request;

[0013] a determining unit, configured to obtain component information of a component of each of the one or more specified files, and determine one or more target components according to the component information of the component of each of the specified files;

[0014] A display unit is used to display the component information corresponding to the one or more target components in the first parameter area of ​​the user configuration interface.

[0015] The generating unit is used to obtain a user's selection operation on the component information of the one or more target components in the first parameter area, and generate a target file according to the component information selected by the selection operation.

[0016] In a third aspect, an embodiment of the present application discloses a server, comprising a processor and a memory, 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.

[0017] In a fourth aspect, 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.

[0018] In an embodiment of the present application, the server can obtain a file generation request, which carries identification information and path information for obtaining one or more specified files, so that one or more specified files corresponding to the identification information and path information can be obtained. Then, the component information of the components of each specified file can be obtained, and one or more target components can be determined based on the component information of the components of each specified file, and the component information corresponding to the one or more target components can be displayed on the first parameter area of ​​the user configuration interface. Further, the user's selection operation on the component information of one or more target components in the first parameter area can be obtained, and the target file can be generated based on the component information selected by the selection operation. By implementing the above method, the required component information can be displayed on the interface using a visual interface, which can greatly reduce the time for users to query components in different files, avoid manually writing target files, thereby improving the file generation speed and reducing the probability of file errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] 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.

[0020] Figure 1 It is a flowchart of a file generation method provided in an embodiment of the present application;

[0021] Figure 2 It is a schematic diagram of a user configuration interface provided in an embodiment of the present application;

[0022] Figure 3 is an interface schematic diagram of another user configuration interface provided in an embodiment of the present application;

[0023] Figure 4 It is a structural diagram of a grouping component provided in an embodiment of the present application;

[0024] Figure 5 This is a schematic diagram of a structure in which selected component information is stored in a target file provided by an embodiment of the present application;

[0025] Figure 6 It is a flowchart of another file generation method provided in an embodiment of the present application;

[0026] Figure 7 It is a flowchart of another file generation method provided in an embodiment of the present application;

[0027] Figure 8It is a structural schematic diagram of a file generating device provided in an embodiment of the present application;

[0028] Fig. 9 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] See also Figure 1 , Figure 1 1 is a flowchart of a file generation method provided in an embodiment of the present application. The file generation method described in this embodiment is applied to a server and can be executed by the server. Figure 1 As shown, the file generation method includes the following steps:

[0031] S101: Obtain a file generation request, where the file generation request carries identification information and path information for obtaining one or more specified files.

[0032] In one implementation, the path information may be a warehouse path of the warehouse where the specified file is located, and the identification information may include a file suffix name identification. The warehouse described in this application may be understood as follows. For example, when a developer creates a project, a code repository (Code Repository) and a configuration repository (Code Repository) may be created in an area where a private library may be created. Among them, Code Repository is generally understood as a code warehouse, and the code generated when creating a project may be uploaded to this code warehouse. Code Repository is generally understood as a configuration warehouse, and configuration information about the project may be uploaded to this configuration warehouse, for example, the component name and version may be stored in the configuration warehouse, and the configuration warehouse is used to store Podspec files. Among them, the content in the Podspec file is relevant information for a component, for example, the relevant information may include source files on which the component depends, third-party components on which the component depends, download addresses of components, component versions, and other information. Code warehouses and configuration warehouses may usually be created locally and remotely, that is, the Podspec files of the configuration warehouse are also stored locally and remotely, so it can be understood that the following includes local paths and remote paths when describing the warehouse path. The warehouse in this application may be a configuration warehouse. The specified file may be a Podspec file.

[0033] In one implementation, the path information can be obtained by inputting relevant instructions in a user configuration interface. Optionally, the terminal display screen can output a user configuration interface, wherein the user configuration interface can be output on a Qt platform, and the Qt platform has a multi-warehouse management capability such as CocoaPods (CocoaPods is a class library management tool), and can visually select the required components to generate a Podfile file. The user configuration interface can include a first parameter area and a second parameter area, and the user configuration interface can be as follows: Figure 2 As shown, the first parameter region can be Figure 2 In the area marked by 201, the second parameter area can be as follows Figure 2 The area marked by 202 in the QProcess class. The second parameter area is used for the user to input various commands, so that after the server obtains the command input by the user, it performs the corresponding operation according to the command, and the first parameter area can be used to display the execution result obtained after executing the command. For example, when the present application wants to obtain a specified file, it is necessary to first determine the warehouse path of the warehouse where the specified file is located. Then, the warehouse information acquisition instruction can be entered in the second parameter area, and the warehouse information acquisition instruction can be the "podrepo" command in the QProcess class. After obtaining the warehouse information acquisition instruction, the instruction can be executed to obtain the warehouse information of all warehouses. The warehouse information may include warehouse name, warehouse type, warehouse path, etc. The warehouse path may be the path information in the present application. Then, the path information may include the warehouse path corresponding to each warehouse in all warehouses, or it may be the warehouse path corresponding to a pre-specified warehouse.

[0034] In one implementation, when the server obtains the warehouse information, the warehouse information can also be displayed in the first parameter area of ​​the user configuration interface. For example, multiple warehouse information can be output in the first parameter area according to a specified output format. The multiple warehouse information output in the first parameter area according to the specified output format can refer to the following. Figure 2 The area marked by 201, from Figure 2 It can be seen that when multiple warehouse information is displayed in the first parameter area, the warehouse information corresponding to one warehouse is displayed, for example, Figure 2The warehouse information about warehouse 1 and warehouse information about warehouse 2 are displayed in. Taking warehouse 1 as an example, warehouse 1 indicates that the warehouse name of a warehouse is warehouse 1, the warehouse type of warehouse 1 is git (branch), and the warehouse path of warehouse 1 may include a remote path (URL: remote git address of warehouse 1) and a local path (Path: local warehouse 1 path). Then, after obtaining the warehouse information of the warehouse according to the warehouse information acquisition instruction, the required warehouse information can be extracted from the warehouse information, and the warehouse information may include the warehouse name and warehouse path (remote path and local path) required in this application.

[0035] In one embodiment, before obtaining the file generation request, the component information of the components of the files included in the warehouse can also be updated to ensure that the component information of the components of each current file is the latest data, thereby avoiding errors in the subsequent generation of the target file. Specifically, the component update instruction can be entered in the second parameter area. For example, the component update instruction can be a "podrepoupdate" instruction in the QProcess class. Then, the server can obtain the component update instruction entered by the user in the second parameter area. The component update instruction can carry identification information and path information for updating one or more files to be updated. Among them, the corresponding files to be updated can be obtained based on the identification information and path information of the one or more files to be updated. After obtaining the one or more files to be updated, the component information of the components of each file to be updated in the one or more files to be updated can be updated according to the component update instruction.

[0036] S102: Acquire one or more designated files corresponding to the identification information and path information carried in the file generation request.

[0037] In one implementation, the corresponding warehouse can be found based on the path information, wherein the path information can be the above-mentioned local path, then all the warehouses can be found based on the warehouse paths of multiple warehouses. After all the warehouses are found, the specified file can be obtained in each warehouse. Among them, one or more files can be stored in a warehouse, and the specified file in the warehouse has a specific suffix name, which can include the podspec.json suffix name and the podspec suffix name, then the identification information can include the suffix name identifier. Then, the specified file can be obtained from the warehouse storing multiple files according to the suffix name identifier. Among them, a warehouse can include one or more specified files,

[0038] Optionally, a file search instruction may be entered in the second parameter area of ​​the user configuration interface. For example, the file search instruction may be of the QDir class. Then, after the server obtains the file search instruction, it may respond to the file search instruction to traverse all files in the repository and obtain all files with the suffix podspec.json or podspec.

[0039] S103: Obtain component information of a component of each of the one or more specified files, and determine one or more target components according to the component information of the component of each of the specified files.

[0040] In one implementation, component information of a component of each specified file in one or more specified files may be obtained, and the component information may include the component name, component version, and component description information of the component. Considering that there may be components in multiple specified files with the same component name and component version. In order to avoid the problem of confusion in importing components when subsequently generating a target file due to the existence of the same components in multiple specified files, and reduce the accuracy of the target file. Then, the components may be merged first to obtain the target component according to the merged components.

[0041] Optionally, the component name and component version in the component information of the component in each specified file can be obtained. When there is no component with the same component name and component version among the components of each specified file, the component of each specified file is determined as a target component. When there is a component with the same component name and component version among the components of each specified file, the components with the same component name and component version can be merged to obtain a merged component. Among them, there may be multiple identical files in multiple components, and one or more merged components can be obtained. For example, the component name of the component in the specified file 1 is component A, and the component version is version V1, and the component name of the component in the specified file 2 is also component A, and the component version is also version V1. Then, the component of the specified file 1 and the component of the specified file 2 can be merged into one component to obtain a merged component. After obtaining one or more merged components, the one or more merged components and the components of the components of each specified file that have not been merged can be determined as target components. For example, the components in the five specified files are component A1, component A3, component A1, component A2, and component A3. It can be seen that the same components exist in the components of the five specified files. Then, the two same components A1 can be merged into one component A1, and the two same components A3 can be merged into one component A3. The target components include component A1, component A2, and component A3.

[0042] S104: Displaying component information corresponding to one or more target components in the first parameter area of ​​the user configuration interface.

[0043] In one implementation, component information corresponding to one or more target components may be displayed in the first parameter area of ​​the user configuration interface. The component information corresponding to each component may include, in addition to the component name, component version, and component description information mentioned above, warehouse information of the warehouse where the component is located. The warehouse information may include the warehouse name (the name identifier in the above identification information) and the warehouse path (the above path information). Optionally, multiple target components may be displayed in the first parameter area of ​​the user configuration interface according to a preset target display method. The target display method may be a tree list method. For example, the display method of multiple target components may refer to the following. Figure 3 In the area marked by 203, the data marked by 204 is the first-level information, which may be the component name; the data marked by 205 is the second-level information, which may be the component version; the data marked by 206 is the third-level information, which may be the warehouse information; the data marked by 207 is the fourth-level information, and the first-level information may be the component description information.

[0044] Optionally, in order to display multiple target components in the above manner, one or more target components may be grouped according to a preset target grouping method to obtain multiple grouping components grouped by the component names of one or more target components, wherein the preset target grouping method may refer to grouping one or more target components in a tree-like manner with the component name as the key value, thereby obtaining multiple grouping components grouped by the component names of one or more target components. For example, each grouping component may include first-level information, second-level information, third-level information, and fourth-level information, wherein the first-level information may include the component name, the second-level information may include the component version, the third-level information may include the warehouse information, and the fourth-level information may include the component description information. It is understandable that each grouping component may include one or more component versions corresponding to the component name, and may include one or more warehouse information for each version number, and each warehouse information includes the component description information corresponding to the grouping component. Among them, the warehouse path of the warehouse information included in the third-level information may be any one or more of the above-mentioned local path and remote path. In this application, the remote path is used as an example for illustration.

[0045] From the above, we can see that to obtain multiple grouped components, it is necessary to integrate the component information of the target component, such as Figure 3As shown, the formation of a grouping component is taken as an example for explanation. First, a component name is selected from the component information of multiple target components, and the component name is component A (component A is the first-level information). Then, all component versions corresponding to the component name being component A are determined from the component information (all component versions corresponding to component A are the second-level information). For example, the component versions of component A include version V1, version V2, and version V3. Then, when the component name of the target component is component A and the component version is version V1, all warehouse information corresponding to the target component (all warehouse information is the third-level information) is determined. For example, the warehouse information includes two, namely, the information corresponding to warehouse 1 and the information corresponding to warehouse 2, and the two warehouse information indicate that the target component exists in both warehouses. Among them, the warehouse information corresponding to the target component can be obtained according to the following logic: in the above step of obtaining the target component, the warehouse is first determined according to the path information, and then the specified file is obtained from the warehouse, and then the target component is determined from the specified file. Then, through the above logic, the warehouse information corresponding to the target component can be determined. Finally, the component description information (the component description information is the fourth level information) when the component name is component A and the component version is version V1 is determined. According to the above method, the version information, warehouse information and component description information included in each group name can be determined, that is, multiple group components grouped by the component name of one or more target components can be obtained.

[0046] S104: Acquire a selection operation of the user on component information of one or more target components in the first parameter area, and generate a target file according to the component information selected by the selection operation.

[0047] In one implementation, the user can view component information about the target component in the first parameter area, for example, Figure 3 The component name, component version, warehouse information, and component description information of the target component displayed in the area marked by 203. The user can select the required information from the first parameter area. For example, when the user selects the area marked by 208, it indicates that the selected information of the target component includes component A, version V1, warehouse 1, and component description information. After the user performs a selection operation on the component information of one or more target components in the first parameter area, the server can obtain the user's selection operation on the component information of one or more target components in the first parameter area, thereby generating a target file according to the component information selected by the selection operation. Specifically, a target file can be created. For example, the file can be a Podfile file. After creating a target file, the component information selected by the selection operation can be written into the target file, thereby generating the required target file. Optionally, when writing the selected component information into the target file, the following can be done: Figure 5The component description information is usually a description of the component. When the component description information is in the first parameter area, the user can understand the component through the component description information. When the selected component information is written into the target file, the component description information can be written or not, which is not limited in this application.

[0048] In an embodiment of the present application, a file generation request is obtained, and the file generation request carries identification information and path information for obtaining one or more specified files, so that one or more specified files corresponding to the identification information and path information can be obtained, and then the component information of the components of each specified file can be obtained, and one or more target components can be determined according to the component information of the components of each specified file, and the component information corresponding to the one or more target components is displayed on the first parameter area of ​​the user configuration interface, and further, the user's selection operation on the component information of one or more target components in the first parameter area can be obtained, and the target file is generated according to the component information selected by the selection operation. By implementing the above method, a visual interface can be used, and related instructions can be used to perform the operations required in the file generation process, and the required component information can be displayed on the interface, which can greatly reduce the time for users to query components in different files, and also prevent the problem of confusion in importing components when multiple files have the same components, and avoid artificial writing of target files, thereby improving the file generation speed and reducing the probability of file errors.

[0049] See also Figure 6 , Figure 6 1 is a flowchart of a file generation method provided in an embodiment of the present application. The file generation method described in this embodiment is applied to a server and can be executed by the server. Figure 6 As shown, the file generation method includes the following steps:

[0050] S601: Obtain a file generation request.

[0051] S602: Acquire one or more specified files corresponding to the identification information and path information carried in the file generation request.

[0052] S603: Identify the file type of each designated file.

[0053] S604: When it is identified that the file type of the designated file is the first file type, component information of the components of each designated file is acquired using a first acquisition method, and one or more target components are determined according to the component information of the components of each designated file.

[0054] S605: When it is identified that the file type of the designated file is the second file type, the component information of each component of the designated file is acquired by using the second acquisition method, and one or more target components are determined according to the component information of each component of the designated file.

[0055] In step S603-step S605, it is considered that there are two types of files with suffixes in the specified file, namely, files with the suffix podspec.json and files with the suffix podspec. The contents of files with different suffixes can be stored in different forms. Therefore, in order to quickly obtain component information of components from the specified file, the component information of components of the specified file can be obtained according to different file suffixes and different acquisition methods. After obtaining the component information of the components of each specified file, one or more target components can be determined based on the component information of the components of each specified file. Among them, the specific implementation steps for determining the target component can refer to the above-mentioned step S103 and will not be repeated here.

[0056] In one implementation, for any specified file among multiple specified files, the file type of the specified file can be first identified, and the file type includes a file with a suffix of podspec.json or a file with a suffix of podspec. Then, identifying the file type of the specified file is to identify the suffix of the file. Specifically, when it is identified that the file type of the specified file is the first file type, it can be determined that the acquisition method corresponding to the specified file is the first acquisition method, and the component information of the components of the specified file is obtained by using the first acquisition method. When it is identified that the file type of the specified file is the second file type, it can be determined that the acquisition method corresponding to the specified file is the second acquisition method, and the component information of the components of the specified file is obtained by using the second acquisition method. Among them, the above-mentioned first file type can be a file with a suffix of podspec.json, and the second file type can be a file with a suffix of podspec, or the first file type can be a file with a suffix of podspec, and the second file type can be a file with a suffix of podspec.json. This application is explained by taking the first file type as a file with a suffix of podspec.json and the second file type as a file with a suffix of podspec as an example.

[0057] In one implementation, the specific implementation of the above-mentioned use of the first acquisition method to obtain the component information of the component of the specified file can be described as follows. Specifically, the specified file is a file with the suffix podspec.json, wherein the file with the suffix podspec.json is a json format file, that is, all the data in the specified file is stored in the form of key-value pairs, for example, the storage format of the data is k1:v1, k2:v2, etc., then, when obtaining relevant information, the value values ​​corresponding to k1 and k2, i.e., v1 and v2, can be obtained. From the above, it can be known that the component keywords corresponding to the required component information can be pre-set to facilitate the subsequent acquisition of the corresponding component information according to the component keywords, wherein the component information required by this application may include component name, component version and component description information, then the component keywords for the component name, the component keywords for the component version and the component keywords for the component description information can be pre-set. Then, when it is necessary to obtain the component information of the component from the specified file, the component information corresponding to the multiple component keywords can be obtained from the specified file of the first file type according to the preset multiple component keywords, and the obtained component information is the component information of the component of the specified file of the first file type. For example, name, version, and description are respectively used as component keywords for component name, component keywords for component version, and component keywords for component description information. The component name, component version, and component description information can be obtained by reading name, version, and description in the specified file.

[0058] In one implementation, the specific implementation of the above-mentioned use of the second acquisition method to obtain the component information of the component of the specified file can be described as follows. Specifically, the specified file is a file with a suffix of podspec, wherein the file with a suffix of podspec is a podfile format file, and all data in the file is stored in the form of a string. Then, the corresponding information can be obtained according to the string identification identifier. Optionally, multiple string identification identifiers corresponding to the second file type can be obtained, wherein the multiple string identification identifiers can include a string identification identifier for the component name, a string identification identifier for the component version, and a string identification identifier for the component description information. Then, the file content in the specified file of the second file type can be read line by line. When any string identification identifier among the multiple string identification identifiers is identified, the component information corresponding to the string identification identifier can be extracted from the specified position corresponding to the multiple string identification identifiers, and the component information obtained is the component information of the component of the specified file of the second file type. Among them, the specified position can refer to the position after the equal sign (=). For example, .name, .version, and .description are used as string identification identifiers for the component name, the component version, and the component description information, respectively. Assuming that .name is identified from the specified file, the content after the equal sign corresponding to .name can be extracted, and the content is the component name.

[0059] Optionally, a component information acquisition instruction can be entered in the second parameter area of ​​the user configuration interface. For example, the component information acquisition instruction can be a QFile class. Then, after the server obtains the component information acquisition instruction, it can respond to the component information acquisition instruction to read and parse the specified file and obtain the component name, component version and component description information from the specified file.

[0060] S606: Display component information corresponding to one or more target components in the first parameter area of ​​the user configuration interface.

[0061] S607: Acquire a selection operation of the user on component information of one or more target components in the first parameter area, and generate a target file according to the component information selected by the selection operation.

[0062] The specific implementation of steps S601-S602 and S606-S607 can refer to the specific description of steps S101-S102 and S104-S105 in the above embodiment, which will not be repeated here.

[0063] In an embodiment of the present application, the server can obtain a file generation request, and obtain one or more specified files corresponding to the identification information and path information carried by the file generation request. Then, the file type of each specified file can be identified. When the file type of the specified file is identified as the first file type, the component information of the components of each specified file is obtained using the first acquisition method, and one or more target components are determined according to the component information of the components of each specified file. When the file type of the specified file is identified as the second file type, the component information of the components of each specified file is obtained using the second acquisition method, and one or more target components are determined according to the component information of the components of each specified file. Further, the component information corresponding to one or more target components can be displayed on the first parameter area of ​​the user configuration interface, and when the user's selection operation of the component information of one or more target components in the first parameter area is obtained, the target file can be generated according to the component information selected by the selection operation. By implementing the above method, the component information of the component can be obtained from the file in different acquisition methods according to different file types, and a more suitable information acquisition method can be matched for different files, thereby effectively improving the information acquisition speed.

[0064] See also Figure 7 , is a flowchart of another file generation method provided in an embodiment of the present application. Figure 7 In the process, the server can update all current warehouses. After the component information of the components of the files in all warehouses is updated, the warehouse information of each warehouse can be obtained, wherein the warehouse information may include the warehouse name and the warehouse path, and then all warehouses are searched according to the warehouse path corresponding to each warehouse, and multiple specified files are obtained from all warehouses, and the component information of the target component is obtained from each of the multiple specified files respectively, and then the target components are grouped to obtain multiple grouped components grouped by the component name of the target component, and the multiple grouped components are displayed in the first parameter area of ​​the user configuration interface in a tree list display mode, and the component name, component version and corresponding warehouse information of the component selected by the user in the first parameter area are obtained, so as to generate the target file according to the selected information.

[0065] See also Figure 8 , Figure 8 1 is a schematic diagram of the structure of a file generation device provided in an embodiment of the present application. The file generation device comprises:

[0066] A first acquisition unit 801 is used to acquire a file generation request, where the file generation request carries identification information and path information for acquiring one or more specified files;

[0067] A second acquisition unit 802 is used to acquire one or more specified files corresponding to the identification information and the path information carried in the file generation request;

[0068] The determining unit 803 is used to obtain component information of a component of each of the one or more specified files, and determine one or more target components according to the component information of the component of each of the specified files;

[0069] A display unit 804, configured to display component information corresponding to the one or more target components in a first parameter area of ​​a user configuration interface;

[0070] The generating unit 805 is configured to obtain a selection operation of the user on the component information of the one or more target components in the first parameter area, and generate a target file according to the component information selected by the selection operation.

[0071] In one implementation, the component information includes a component name and a component version; the determining unit 803 is specifically configured to:

[0072] Obtain the component name and component version in the component information of each specified file;

[0073] When there is no component having the same component name and component version among the components of the respective designated files, the component of each designated file is determined as the target component.

[0074] In one implementation, the determining unit 803 is further configured to:

[0075] When there are components with the same component name and component version among the components of the specified files, the components with the same component name and component version are merged to obtain one or more merged components;

[0076] A component that has not been merged among the one or more merged components and the components of the respective specified files is determined as a target component.

[0077] In one implementation, the determining unit 803 is specifically configured to:

[0078] For any specified file among the one or more specified files, identifying a file type of the specified file;

[0079] When it is identified that the file type of the designated file is the first file type, determining that the acquisition method corresponding to the designated file is the first acquisition method, and using the first acquisition method to acquire component information of the components of the designated file;

[0080] When it is identified that the file type of the designated file is the second file type, it is determined that the acquisition method corresponding to the designated file is the second acquisition method, and the component information of the component of the designated file is acquired by using the second acquisition method.

[0081] In one implementation, the component information further includes component description information; the determining unit 803 is specifically configured to:

[0082] According to a plurality of preset component keywords, component information corresponding to the plurality of component keywords is acquired from a specified file of the first file type, wherein the plurality of component keywords include component keywords for component names, component keywords for component versions, and component keywords for component description information;

[0083] The acquired component information is determined as component information of a component of a specified file of the first file type.

[0084] In one implementation, the component information further includes component description information; the determining unit 803 is specifically configured to:

[0085] Acquire a plurality of string identification identifiers corresponding to the second file type, wherein the plurality of string identification identifiers include a string identification identifier for a component name, a string identification identifier for a component version, and a string identification identifier for component description information;

[0086] Reading file contents of the designated file of the second file type line by line, and when any string identification identifier among the plurality of string identification identifiers is identified, extracting component information corresponding to the string identification identifier from designated positions corresponding to the plurality of string identification identifiers;

[0087] The acquired component information is determined as component information of a component of a specified file of the second file type.

[0088] In one implementation, the apparatus further includes an updating unit 806, wherein the updating unit 806 is specifically configured to:

[0089] Acquire the component update instruction input by the user in the second parameter area, where the component update instruction carries identification information and path information for updating one or more files to be updated;

[0090] The component information of the component of each file in the one or more files to be updated is updated according to the component update instruction.

[0091] It is understandable that the functions of the functional units of the file generation device described in the embodiment of the present application can be based on Figure 1 or Figure 6The specific implementation process of the method in the method embodiment can be referred to Figure 1 or Figure 6 The relevant description of the method embodiment will not be repeated here.

[0092] In the embodiment of the present application, the first acquisition unit 801 acquires a file generation request, and the file generation request carries identification information and path information for acquiring one or more specified files; the second acquisition unit acquires one or more specified files corresponding to the identification information and the path information carried by the file generation request; the determination unit 803 acquires the component information of the components of each specified file in the one or more specified files, and determines one or more target components according to the component information of the components of each specified file; the display unit 804 displays the component information corresponding to the one or more target components on the first parameter area of ​​the user configuration interface; the generation unit 805 acquires the user's selection operation on the component information of the one or more target components in the first parameter area, and generates the target file according to the component information selected by the selection operation. By implementing the above method, the required component information can be displayed on the interface using a visual interface, which can greatly reduce the time for users to query components in different files, avoid manually writing target files, thereby improving the file generation speed and reducing the probability of file errors.

[0093] See also Fig. 9 , Fig. 9 9 is a schematic diagram of a server structure provided by an embodiment of the present application. The server includes: a processor 901, a memory 902 and a network interface 903. The processor 901, the memory 902 and the network interface 903 can exchange data.

[0094] The processor 901 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.

[0095] The memory 902 may include a read-only memory and a random access memory, and provide program instructions and data to the processor 901. A portion of the memory 902 may also include a random access memory. When the processor 901 calls the program instructions, it is used to execute:

[0096] Obtaining a file generation request, wherein the file generation request carries identification information and path information for obtaining one or more specified files;

[0097] Acquire one or more specified files corresponding to the identification information and the path information carried in the file generation request;

[0098] Obtaining component information of a component of each of the one or more specified files, and determining one or more target components according to the component information of the component of each of the specified files;

[0099] Displaying component information corresponding to the one or more target components in a first parameter area of ​​a user configuration interface;

[0100] Acquire a user's selection operation on component information of the one or more target components in the first parameter area, and generate a target file according to the component information selected by the selection operation.

[0101] In one implementation, the component information includes a component name and a component version; the processor 901 is specifically configured to:

[0102] Obtain the component name and component version in the component information of each specified file;

[0103] When there is no component having the same component name and component version among the components of the respective designated files, the component of each designated file is determined as the target component.

[0104] In one implementation, the processor 901 is further configured to:

[0105] When there are components with the same component name and component version among the components of the specified files, the components with the same component name and component version are merged to obtain one or more merged components;

[0106] A component that has not been merged among the one or more merged components and the components of the respective specified files is determined as a target component.

[0107] In one implementation, the processor 901 is specifically configured to:

[0108] For any specified file among the one or more specified files, identifying a file type of the specified file;

[0109] When it is identified that the file type of the designated file is the first file type, determining that the acquisition method corresponding to the designated file is the first acquisition method, and using the first acquisition method to acquire component information of the components of the designated file;

[0110] When it is identified that the file type of the designated file is the second file type, it is determined that the acquisition method corresponding to the designated file is the second acquisition method, and the component information of the component of the designated file is acquired by using the second acquisition method.

[0111] In one implementation, the component information further includes component description information; the processor 901 is specifically configured to:

[0112] According to a plurality of preset component keywords, component information corresponding to the plurality of component keywords is acquired from a specified file of the first file type, wherein the plurality of component keywords include component keywords for component names, component keywords for component versions, and component keywords for component description information;

[0113] The acquired component information is determined as component information of a component of a specified file of the first file type.

[0114] In one implementation, the component information further includes component description information; the processor 901 is specifically configured to:

[0115] Acquire a plurality of string identification identifiers corresponding to the second file type, wherein the plurality of string identification identifiers include a string identification identifier for a component name, a string identification identifier for a component version, and a string identification identifier for component description information;

[0116] Reading file contents of the designated file of the second file type line by line, and when any string identification identifier among the plurality of string identification identifiers is identified, extracting component information corresponding to the string identification identifier from designated positions corresponding to the plurality of string identification identifiers;

[0117] The acquired component information is determined as component information of a component of a specified file of the second file type.

[0118] In one implementation, the processor 901 is further configured to:

[0119] Acquire the component update instruction input by the user in the second parameter area, where the component update instruction carries identification information and path information for updating one or more files to be updated;

[0120] The component information of the component of each file in the one or more files to be updated is updated according to the component update instruction.

[0121] In a specific implementation, the processor 901 and the memory 902 described in the embodiments of the present application can execute the embodiments of the present application. Figure 1 or Figure 6 The implementation described in the provided file generation method can also be used to implement the embodiments of this application. Figure 8 The implementation method of the described file generation device will not be repeated here.

[0122] In an embodiment of the present application, the processor 901 can obtain a file generation request, the file generation request carries identification information and path information for obtaining one or more specified files; obtain one or more specified files corresponding to the identification information and the path information carried by the file generation request; obtain component information of the components of each specified file in the one or more specified files, and determine one or more target components based on the component information of the components of each specified file; display the component information corresponding to the one or more target components on the first parameter area of ​​the user configuration interface; obtain the user's selection operation on the component information of the one or more target components in the first parameter area, and generate a target file based on the component information selected by the selection operation. By implementing the above method, the required component information can be displayed on the interface using a visual interface, which can greatly reduce the time for users to query components in different warehouses, avoid manually writing target files, thereby improving the file generation speed and reducing the probability of file errors.

[0123] The present application also provides a computer-readable storage medium in which program instructions are stored. When the program is executed, it may include: Figure 1 or Figure 6 Part or all of the steps of the file generation method in the corresponding embodiment.

[0124] 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.

[0125] 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.

[0126] It should be emphasized that in order to further ensure the privacy and security of the above data, the above data can also be stored in a node of a blockchain. Among them, the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain can include the blockchain underlying platform, the platform product service layer, and the application service layer.

[0127] The above is a detailed introduction to a file generation 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 ideas of the present application, there will 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 application.

Claims

1. A file generation method, characterized in that: include: Get a file generation request, the file generation request carries identification information and path information for obtaining one or more specified files; the path information includes the warehouse path corresponding to each warehouse in all warehouses; the identification information includes the file suffix name identification, the suffix name identification includes the podspec.json suffix name identification and the podspec suffix name identification; Acquire one or more specified files corresponding to the identification information and the path information carried in the file generation request; Obtaining component information of a component of each of the one or more specified files, and determining one or more target components according to the component information of the component of each of the specified files; The obtaining of component information of components of each specified file in the one or more specified files includes: for any specified file in the one or more specified files, identifying the file type of the specified file; when it is identified that the file type of the specified file is the first file type, determining that the acquisition method corresponding to the specified file is the first acquisition method, and using the first acquisition method to obtain component information of the components of the specified file; when it is identified that the file type of the specified file is the second file type, determining that the acquisition method corresponding to the specified file is the second acquisition method, and using the second acquisition method to obtain component information of the components of the specified file; the file types include files with a suffix of podspec.json or files with a suffix of podspec; all data in files with a suffix of podspec.json are stored in the form of key-value pairs; all data in files with a suffix of podspec.json are stored in the form of strings; Displaying component information corresponding to the one or more target components in a first parameter area of ​​a user configuration interface; Acquire a user's selection operation on component information of the one or more target components in the first parameter area, and generate a target file according to the component information selected by the selection operation.

2. The method according to claim 1, characterized in that The component information includes a component name and a component version; and determining one or more target components according to the component information of each of the specified files includes: Obtain the component name and component version in the component information of each specified file; When there is no component having the same component name and component version among the components of the respective designated files, the component of each designated file is determined as the target component.

3. The method according to claim 2, characterized in that The method further comprises: When there are components with the same component name and component version among the components of the specified files, the components with the same component name and component version are merged to obtain one or more merged components; A component that has not been merged among the one or more merged components and the components of the respective specified files is determined as a target component.

4. The method according to claim 1, characterized in that: The component information also includes component description information; the using the first acquisition method to acquire the component information of the component of the specified file includes: According to a plurality of preset component keywords, component information corresponding to the plurality of component keywords is acquired from a specified file of the first file type, wherein the plurality of component keywords include component keywords for component names, component keywords for component versions, and component keywords for component description information; The acquired component information is determined as component information of a component of a specified file of the first file type.

5. The method according to claim 1, characterized in that The component information also includes component description information; the using the second acquisition method to acquire the component information of the component of the specified file includes: Acquire a plurality of string identification identifiers corresponding to the second file type, wherein the plurality of string identification identifiers include a string identification identifier for a component name, a string identification identifier for a component version, and a string identification identifier for component description information; Reading file contents of the designated file of the second file type line by line, and when any string identification identifier among the plurality of string identification identifiers is identified, extracting component information corresponding to the string identification identifier from designated positions corresponding to the plurality of string identification identifiers; The acquired component information is determined as component information of a component of a specified file of the second file type.

6. The method according to claim 1, characterized in that The user configuration interface further includes a second parameter area, where the second parameter area is used for the user to input a component update instruction; before obtaining the file generation request, the method further includes: Acquire the component update instruction input by the user in the second parameter area, where the component update instruction carries identification information and path information for updating one or more files to be updated; The component information of the component of each file in the one or more files to be updated is updated according to the component update instruction.

7. A file generating device, characterized in that: include: A first acquisition unit is used to acquire a file generation request, wherein the file generation request carries identification information and path information for acquiring one or more specified files; the path information includes a warehouse path corresponding to each warehouse in all warehouses; the identification information includes a file suffix name identifier, and the suffix name identifier includes a podspec.json suffix name identifier and a podspec suffix name identifier; A second acquisition unit, configured to acquire one or more specified files corresponding to the identification information and the path information carried in the file generation request; a determining unit, configured to obtain component information of a component of each of the one or more specified files, and determine one or more target components according to the component information of the component of each of the specified files; The obtaining of component information of components of each specified file in the one or more specified files includes: for any specified file in the one or more specified files, identifying the file type of the specified file; when it is identified that the file type of the specified file is the first file type, determining that the acquisition method corresponding to the specified file is the first acquisition method, and using the first acquisition method to obtain component information of the components of the specified file; when it is identified that the file type of the specified file is the second file type, determining that the acquisition method corresponding to the specified file is the second acquisition method, and using the second acquisition method to obtain component information of the components of the specified file; the file types include files with a suffix of podspec.json or files with a suffix of podspec; all data in files with a suffix of podspec.json are stored in the form of key-value pairs; all data in files with a suffix of podspec.json are stored in the form of strings; A display unit, configured to display component information corresponding to the one or more target components in a first parameter area of ​​a user configuration interface; The generating unit is used to obtain a user's selection operation on the component information of the one or more target components in the first parameter area, and generate a target file according to the component information selected by the selection operation.

8. A server, characterized in that: The method comprises a processor and a memory, 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.

Citation Information

Patent Citations

  • A method and server for managing software version information

    CN109086071A

  • Web page construction method and device

    CN112925513A

  • Plug-in update method and device, server and computer readable storage medium

    WO2020233045A1