CN115687247A - File conversion method and device, computer equipment and computer readable storage medium - Google Patents

File conversion method and device, computer equipment and computer readable storage medium Download PDF

Info

Publication number
CN115687247A
CN115687247A CN202211395095.2A CN202211395095A CN115687247A CN 115687247 A CN115687247 A CN 115687247A CN 202211395095 A CN202211395095 A CN 202211395095A CN 115687247 A CN115687247 A CN 115687247A
Authority
CN
China
Prior art keywords
file
plug
converted
information
list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211395095.2A
Other languages
Chinese (zh)
Inventor
何辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An E Wallet Electronic Commerce Co Ltd
Original Assignee
Ping An E Wallet Electronic Commerce Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An E Wallet Electronic Commerce Co Ltd filed Critical Ping An E Wallet Electronic Commerce Co Ltd
Priority to CN202211395095.2A priority Critical patent/CN115687247A/en
Publication of CN115687247A publication Critical patent/CN115687247A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a file conversion method, a file conversion device, computer equipment and a computer readable storage medium, and relates to the technical field of Internet. The method comprises the following steps: receiving a disk path, and reading a file list to be converted according to the disk path, wherein the file list to be converted comprises a plurality of files to be converted; decompressing each file to be converted, extracting a display file from the decompressed file to be converted, and reading version data stored in the display file as identification information of the file to be converted; determining a corresponding plug-in list in the warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information; and recording the target plug-in information to obtain a target file corresponding to the file to be converted.

Description

File conversion method and device, computer equipment and computer readable storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a file conversion method, an apparatus, a computer device, and a computer-readable storage medium.
Background
With the continuous progress of internet technology, most of the projects of enterprises use micro-services at present, and an open source tool gradle is built by adopting project management tool software maven or project automation to complete compiling and packaging. There are some older projects that reference a specific jar file in the project in a conventional manner.
In the related technology, developers need to check versions corresponding to jar files from all codes, and then inquire corresponding maven versions from maven warehouses on the public network, so that file conversion is completed.
In carrying out the present application, the applicant has found that the related art has at least the following problems:
a large amount of manual processing is needed for file conversion, hundreds of jar files often exist in one project, manual workload is increased, manual errors such as query errors and input errors are easily generated by the large amount of manual processing, and accordingly file conversion efficiency is low and accuracy is poor.
Disclosure of Invention
In view of this, the present application provides a file conversion method, a file conversion apparatus, a computer device, and a computer readable storage medium, and mainly aims to solve the problems that at present, a large amount of manual processing easily causes human errors such as query errors and input errors, which further results in low file conversion efficiency and poor accuracy.
According to a first aspect of the present application, there is provided a file conversion method, including:
receiving a disk path, and reading a file list to be converted according to the disk path, wherein the file list to be converted comprises a plurality of files to be converted;
decompressing each file to be converted, extracting a display file from the decompressed file to be converted, and reading version data stored in the display file as identification information of the file to be converted, wherein the version data comprises a package name and a version number;
determining a corresponding plug-in list in a warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information;
and recording the target plug-in information to obtain a target file corresponding to the file to be converted.
According to a second aspect of the present application, there is provided a file converting apparatus, comprising:
the receiving module is used for receiving a disk path and reading a file list to be converted according to the disk path, wherein the file list to be converted comprises a plurality of files to be converted;
the decompression module is used for decompressing each file to be converted, extracting a display file from the decompressed file to be converted, and reading version data stored in the display file as identification information of the file to be converted, wherein the version data comprises a package name and a version number;
the pulling module is used for determining a corresponding plug-in list in a warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information;
and the recording module is used for recording the target plug-in information to obtain a target file corresponding to the file to be converted.
According to a third aspect of the present application, there is provided a computer device comprising a storage device, a processor and a computer program stored on the storage device and executable on the processor, the processor implementing the steps of the method according to any one of the first aspect when the program is executed.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any of the first aspects described above.
According to the technical scheme, the file conversion method, the file conversion device, the computer equipment and the computer readable storage medium are provided. And then, decompressing each file to be converted, extracting the display file from the decompressed file to be converted, and reading version data stored in the display file, namely the package name and the version number, as identification information of the file to be converted. And determining a corresponding plug-in list in the warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information. And finally, recording the target plug-in information to obtain a target file corresponding to the file to be converted. By the aid of the identification information of the file to be converted, plug-in information corresponding to the identification information is automatically inquired in the warehouse, and a target file corresponding to the file to be converted is obtained, so that human errors caused by manual file conversion are avoided, and file conversion efficiency and accuracy are improved.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
Various additional advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flowchart illustrating a file conversion method according to an embodiment of the present application;
fig. 2A illustrates a schematic flowchart of a file conversion method provided in an embodiment of the present application;
fig. 2B is a schematic flowchart illustrating a file conversion method according to an embodiment of the present application;
fig. 2C is a schematic flowchart illustrating a file conversion method according to an embodiment of the present application;
fig. 2D is a schematic flowchart illustrating a file conversion method according to an embodiment of the present application;
FIG. 3A is a schematic structural diagram of a file conversion apparatus provided in an embodiment of the present application;
FIG. 3B is a schematic structural diagram of a file conversion apparatus according to an embodiment of the present disclosure;
fig. 4 shows a schematic device structure diagram of a computer apparatus according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
An embodiment of the present application provides a file conversion method, as shown in fig. 1, the method includes:
101. and receiving a disk path, and reading a file list to be converted according to the disk path, wherein the file list to be converted comprises a plurality of files to be converted.
It should be noted that the method is applicable to a file conversion plug-in, and taking a file conversion plug-in written in a go language as an example, a source code file obtained by the file conversion plug-in may be jar-to-pom. And then compiling the source code file of the file conversion plug-in to generate an executable file. For example, in a Windows system, the file conversion plug-in can be started by directly double-clicking the executable file jar-to-pom. According to the method, batch conversion of jar files is realized through plug-ins, and a plurality of jar files under an old project are converted into pom files of a new project. The POM (project object model) is a description of a single item by Maven, that is, the POM is a core of Maven, and is implemented by the POM and drives the construction mode described by the model.
In the embodiment of the application, the jar files quoted by the old project are all in the libs directory of the project, so that after the storage path of the libs folder, namely the disk path, is input into the file conversion plug-in, the file conversion plug-in can read all jar files contained in the project by giving the disk path. Specifically, the file conversion plug-in receives a disk path and reads a file list to be converted according to the disk path, wherein the file list to be converted comprises a plurality of files to be converted, and the number of the files to be converted stored in the file list to be converted is not specifically limited.
102. And decompressing each file to be converted, extracting a display file from the decompressed file to be converted, and reading version data stored in the display file as identification information of the file to be converted, wherein the version data comprises a package name and a version number.
Further, for each read file to be converted, the file conversion plug-in may invoke an existing decompression tool to decompress the file to be converted, thereby obtaining a plurality of subfiles storing different data contents. And then, finding out a display file, namely a manifest.
103. And determining a corresponding plug-in list in the warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information.
In the embodiment of the application, the file conversion plug-in takes the read identification information as a keyword, traversal query is automatically carried out in the warehouse, and then the information identification of the plug-in information needing to be pulled is stored in a plug-in list. Further, the information in the plug-in list is pulled in the warehouse to identify the indicated plug-in information. In order to avoid the possibility that other plug-in information is loaded in webpage searching, after the plug-in information is pulled to the local, the plug-in information needs to be filtered, and finally, target plug-in information matched with the identification information is obtained through filtering.
104. And recording the target plug-in information to obtain a target file corresponding to the file to be converted.
In the embodiment of the application, the file conversion plug-in finally identifies the target plug-in information, and extracts and records the required information content in the target plug-in information, so as to obtain the required target pom file.
The method provided by the embodiment of the application comprises the steps of firstly receiving a disk path, and reading a plurality of files to be converted contained in a file list to be converted according to the disk path. And then, decompressing each file to be converted, extracting the display file from the decompressed file to be converted, and reading the version data, namely the package name and the version number, stored in the display file as the identification information of the file to be converted. And determining a corresponding plug-in list in the warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information. And finally, recording the target plug-in information to obtain a target file corresponding to the file to be converted. By the aid of the identification information of the files to be converted, plug-in information corresponding to the identification information is automatically inquired in the warehouse, and then target files corresponding to the files to be converted are obtained, manual errors caused by manual file conversion are avoided, and file conversion efficiency and accuracy are improved.
An embodiment of the present application provides a file conversion method, as shown in fig. 2A, the method includes:
201. and receiving a disk path, and reading a file list to be converted according to the disk path, wherein the file list to be converted comprises a plurality of files to be converted.
With the continuous progress of internet technology, most of the projects of enterprises use microservices at present, and complete compiling and packaging by adopting project management tool software maven or project automation construction open source tool gradle. There are some older projects that reference a specific jar file in the project in a conventional manner. At present, developers need to check versions corresponding to jar files from all codes, and then inquire corresponding maven versions from a maven warehouse on a public network, so that file conversion is completed. However, the applicant recognizes that a large amount of manual processing is needed for file conversion, hundreds of jar files are often stored in a project, and further the workload of manual work is increased, and a large amount of manual processing is easy to generate human errors such as query errors and input errors, so that the efficiency of file conversion is low, and the accuracy is poor.
Therefore, the present application provides a file conversion method, device, computer device, and computer readable storage medium, where the present application first receives a disk path, and reads a plurality of files to be converted included in a file list to be converted according to the disk path. And then, for each file to be converted in the plurality of files to be converted, decompressing the file to be converted, and determining identification information corresponding to the file to be converted in a display file of the file to be converted. And determining a corresponding plug-in list in the warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information. And finally, recording the target plug-in information to obtain a target file corresponding to the file to be converted. By the aid of the identification information of the file to be converted, plug-in information corresponding to the identification information is automatically inquired in the warehouse, and a target file corresponding to the file to be converted is obtained, so that human errors caused by manual file conversion are avoided, and file conversion efficiency and accuracy are improved.
In the embodiment of the application, it should be noted that the method is suitable for a file conversion plug-in, the batch conversion of the jar files is realized through the plug-in, and the jar files under the old project are converted into the pom files of the new project. It should be noted that the file conversion plug-in may be written in a go language or a java language, and the script language used for writing the file conversion plug-in is not specifically limited in the present application. In the actual operation process, in consideration of the fact that the source code file of the go language can be compiled to generate a cross-platform executable file, the embodiment of the application takes the file conversion plug-in written by the go language as an example for explanation. The source code file of the file conversion plug-in can be jar-to-pom. And then compiling the source code file of the file conversion plug-in to generate an executable file. This executable file may be an exe-terminated file suitable for Windows systems or a sh-terminated file suitable for linux systems.
The file conversion method provided by the application is suitable for the file conversion plug-in, and as shown in fig. 2B, the jar files cited by the old project are all under the libs directory of the project, so that the storage path of the libs folder is sent to the file conversion plug-in as a disk path. The file conversion plug-in receives the disk path, reads a file list to be converted according to the position indicated by the disk path, wherein the file list to be converted contains all jar files required by the project. Further, each jar file in the list to be converted is processed circularly, and specifically, each jar folder is input to a legal file detection module by the file conversion plug-in for legality detection. And after the jar file passes the legality detection, inputting the jar file into a jar file processing module for file conversion to obtain a corresponding target file. And after all jar files stored in the file list to be converted are converted, ending the circular processing to obtain all target files corresponding to the project.
202. And carrying out validity detection on each file to be converted.
In the embodiment of the application, in order to ensure the system operation safety of the service execution system, the file conversion plug-in needs to call a legal file detection module to perform validity detection on each file to be converted before the file to be converted is converted.
Firstly, for each file to be converted, the file conversion plug-in calls a legal file detection module to perform content detection, format detection and virus detection on the file to be converted, and determines a content detection sub-result, a format detection sub-result and a virus detection sub-result of the file to be converted. Specifically, as shown in fig. 2C, after the file conversion plug-in inputs the jar file into the legal detection module, when the legal detection module performs content detection, the file to be converted is read, and the plug-in organization information G in the file to be converted is determined: group, plug-in project name A: artifacted, plug-in version number V: the coordinate information of version and the storage state of the specified file. It should be noted that the storage state is the existing state only when all the plug-in organization information, the plug-in item name, the coordinate information of the plug-in version number, and the specified file class file exist, and otherwise, the storage state is the non-existing state. And when the storage state meets a preset storage state, namely the existence state, generating a content detection sub-result for indicating normal, otherwise, generating a content detection sub-result for indicating abnormal. That is, the content detection sub-result indicating normality is generated only when all of the plug-in organization information, the plug-in item name, the coordinate information of the plug-in version number, and the specified file exist. When format detection is carried out, the file conversion plug-in reads the suffix name of the file to be converted, and when the suffix name meets the preset suffix name jar, a format detection sub-result used for indicating normal is generated, otherwise, a format detection sub-result used for indicating abnormal is generated. The format detection is to detect whether the file to be converted is a jar suffix file, and only the jar file can be subjected to file conversion. When virus detection is carried out, a file virus scanning module is called to scan a file to be converted, when the result output by the file virus scanning module indicates that no virus exists, a virus detection sub-result used for indicating normal is generated, otherwise, a virus detection sub-result used for indicating abnormal is generated.
Further, when all the content detection sub-result, the format detection sub-result and the virus detection sub-result indicate normality, a detection result for indicating that the file to be converted is normal is generated, and otherwise, a detection result for indicating that the file to be converted is abnormal is generated.
And finally, identifying the detection result of the file to be converted, and if the detection result indicates that the file to be converted is normal, inputting the file to be converted into a jar file processing module for file conversion to obtain a target file corresponding to the file to be converted, namely executing the following step 203. And if the detection result indicates that the file to be converted is abnormal, generating alarm information, sending the alarm information to the background terminal for displaying, wherein the alarm information is used for triggering the background terminal to upload a modification instruction of the file to be converted.
203. And when the detection result indicates that the files to be converted are normal, decompressing each file to be converted, extracting the display file from the decompressed files to be converted, and reading the version data stored in the display file as the identification information of the files to be converted.
And further, after the detection result indicates that the file to be converted is normal, inputting the file to be converted to a jar file processing module for file conversion, and for each file to be converted, the file conversion plug-in can call the existing decompression tool to decompress the file to be converted to obtain a plurality of subfiles. The file conversion plug-in, in turn, needs to find the display file, i.e., the manifest file, mt, among the plurality of subfiles, which defines the data associated with the extension and the package. Mt files read the stored package name and version number as the identification information corresponding to the files to be converted.
204. And determining a corresponding plug-in list in the warehouse according to the identification information, pulling the plug-in information indicated by the plug-in list, obtaining target plug-in information matched with the identification information, recording the target plug-in information, and obtaining a target file corresponding to the file to be converted.
The file conversion plug-in automatically performs traversal query in the warehouse by taking the read identification information as a keyword, and then stores the information identification of the plug-in information needing to be pulled into a plug-in list. Further, the plug-in information indicated by the information identification in the plug-in list is pulled in the warehouse. In order to avoid the possibility that other plug-in information is loaded in webpage searching, after the plug-in information is pulled to the local, the plug-in information needs to be filtered, and finally, target plug-in information matched with the identification information is obtained through filtering.
Specifically, the corresponding plugin information is queried in the warehouse through the package name and the version number, and a plugin list is generated. And pulling the plug-in information indicated by the plug-in list in the warehouse according to the plug-in list. It should be noted that the warehouse includes private server warehouse of company intranet, public network warehouse, and public network central warehouse. Further, considering that network search may load information of other plug-ins, the file conversion plug-in analyzes the plug-in information in the returned plug-in list, deletes the plug-in information which does not match with the identification information, and takes the remaining plug-in information after deletion as target plug-in information.
205. And recording the target plug-in information to obtain a target file corresponding to the file to be converted.
In the embodiment of the application, the file conversion plug-in finally identifies the target plug-in information, and extracts and records the required plug-in organization information, the plug-in project name and the plug-in version number in the target plug-in information, so as to obtain the required target pom file.
It should be noted that the method is further provided with a reverse verification link for performing reverse verification on the plug-in list. Specifically, whether data content exists in the plug-in list is checked, if the data content does not exist in the plug-in list, the file conversion plug-in does not pull corresponding plug-in information from the warehouse, at this time, the failure reason of the plug-in information pulling failure needs to be recorded, and after the conversion of the jar package of the group is completed, the failure reason is returned to the background terminal for displaying. In addition, related workers can check which jar files are failed to be converted and corresponding failure reasons at a background terminal, and then file conversion is carried out again according to failure reason checking errors. If the data content exists in the plug-in list, the plug-in information corresponding to the file to be converted is pulled, and at the moment, the corresponding plug-in information is read for file conversion.
In summary, for the conversion process of a single jar file, as shown in fig. 2D, an existing decompression tool is first invoked to decompress a file to be converted, a manifest. Next, by using the package name and the version number, the corresponding plug-in information is inquired in the warehouse, and a plug-in list is generated. And pulling the plug-in information indicated by the plug-in list in the warehouse according to the plug-in list. And then analyzing the plug-in information in the returned plug-in list, deleting the plug-in information which is not matched with the identification information, and taking the residual plug-in information after deletion as target plug-in information. And finally, identifying the target plug-in information, and extracting and recording the required plug-in organization information, the plug-in project name and the plug-in version number in the target plug-in information so as to obtain the required target pom file. Meanwhile, a reverse checking link is arranged and used for performing reverse checking on the plug-in list and judging whether plug-in information is pulled from the warehouse or not.
The method provided by the embodiment of the application comprises the steps of firstly receiving a disk path, and reading a plurality of files to be converted contained in a file list to be converted according to the disk path. And then, decompressing each file to be converted, extracting the display file from the decompressed file to be converted, and reading version data stored in the display file, namely the package name and the version number, as identification information of the file to be converted. And determining a corresponding plug-in list in the warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information. And finally, recording the target plug-in information to obtain a target file corresponding to the file to be converted. By the aid of the identification information of the files to be converted, plug-in information corresponding to the identification information is automatically inquired in the warehouse, and then target files corresponding to the files to be converted are obtained, manual errors caused by manual file conversion are avoided, and file conversion efficiency and accuracy are improved.
Further, as a specific implementation of the method shown in fig. 1, an embodiment of the present application provides a file conversion apparatus, and as shown in fig. 3A, the apparatus includes: the device comprises a receiving module 301, a decompressing module 302, a pulling module 303 and a recording module 304.
The receiving module 301 is configured to receive a disk path, and read a to-be-converted file list according to the disk path, where the to-be-converted file list includes multiple to-be-converted files;
the decompression module 302 is configured to decompress each file to be converted, extract a display file from the decompressed file to be converted, and read version data stored in the display file as identification information of the file to be converted, where the version data includes a package name and a version number;
the pulling module 303 is configured to determine a corresponding plugin list in the warehouse according to the identification information, and pull plugin information indicated by the plugin list to obtain target plugin information matched with the identification information;
the recording module 304 is configured to record the target plug-in information to obtain a target file corresponding to the file to be converted.
In a specific application scenario, as shown in fig. 3B, the apparatus further includes: a detection module 305 and a generation module 306.
The detecting module 305 is configured to perform validity detection on each file to be converted, and generate a detection result for each file to be converted, where the validity detection includes content detection, format detection, and virus detection;
the decompression module 302 is configured to convert the file to be converted into the target file if the detection result indicates that the file to be converted is normal;
the generating module 306 is configured to generate warning information if the detection result indicates that the file to be converted is abnormal, send the warning information to a background terminal for displaying, where the warning information is used to trigger the background terminal to upload a modification instruction for the file to be converted.
In a specific application scenario, the detecting module 305 is configured to invoke a legal file detecting module, perform the content detection, the format detection, and the virus detection on the file to be converted, and determine a content detection sub-result, a format detection sub-result, and a virus detection sub-result of the file to be converted; and generating a detection result for indicating that the file to be converted is normal when all the content detection sub-result, the format detection sub-result and the virus detection sub-result indicate normal, otherwise, generating a detection result for indicating that the file to be converted is abnormal.
In a specific application scenario, the detecting module 305 is configured to, when performing the content detection, read the file to be converted, determine storage states of the insert organization information, the insert item name, the insert version number, and the specified file in the file to be converted, generate a sub-result for indicating normal content detection when the storage states satisfy a preset storage state, and otherwise generate a sub-result for indicating abnormal content detection; reading a suffix name of the file to be converted when the format detection is carried out, and generating a format detection sub-result for indicating normal when the suffix name meets a preset suffix name, or generating a format detection sub-result for indicating abnormal when the suffix name does not meet the preset suffix name; when the virus detection is carried out, a file virus scanning module is called to scan the file to be converted, when the result output by the file virus scanning module indicates that no virus exists, a virus detection sub-result used for indicating normal is generated, otherwise, a virus detection sub-result used for indicating abnormal is generated.
In a specific application scenario, the pulling module 303 is configured to query the repository for plugin information corresponding to the identification information, generate the plugin list, and pull plugin information indicated by the plugin list in the repository according to the plugin list, where the repository includes a private company intranet repository, a public network repository, and a central public network repository; and analyzing the plug-in information, deleting the plug-in information which is not matched with the identification information, and taking the residual plug-in information after deletion as the target plug-in information.
In a specific application scenario, the pulling module 303 is configured to check the plug-in list in a reverse direction, record a failure reason for a failure in pulling the plug-in information if the plug-in list does not have data content, and return the failure reason to the background terminal for displaying.
In a specific application scenario, the recording module 304 is configured to identify the target plug-in information, record plug-in organization information, a plug-in item name, and a plug-in version number in the target plug-in information, and store the plug-in organization information, the plug-in item name, and the plug-in version number as the target file.
The device provided by the embodiment of the application receives the disk path at first, and reads a plurality of files to be converted contained in the file list to be converted according to the disk path. And then, decompressing each file to be converted, extracting the display file from the decompressed file to be converted, and reading the version data, namely the package name and the version number, stored in the display file as the identification information of the file to be converted. And determining a corresponding plug-in list in the warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information. And finally, recording the target plug-in information to obtain a target file corresponding to the file to be converted. By the aid of the identification information of the files to be converted, plug-in information corresponding to the identification information is automatically inquired in the warehouse, and then target files corresponding to the files to be converted are obtained, manual errors caused by manual file conversion are avoided, and file conversion efficiency and accuracy are improved.
It should be noted that other corresponding descriptions of the functional units related to the file conversion apparatus provided in the embodiment of the present application may refer to the corresponding descriptions in fig. 1 and fig. 2A to fig. 2D, and are not described herein again.
In an exemplary embodiment, referring to fig. 4, there is further provided a device including a communication bus, a processor, a memory, and a communication interface, and further including an input/output interface and a display device, wherein the functional units may communicate with each other through the bus. The memory stores computer programs, and the processor is used for executing the programs stored in the memory and executing the file conversion method in the embodiment.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the file conversion method.
Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by hardware, and can also be implemented by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application.
Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios.
The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

Claims (10)

1. A method of file conversion, comprising:
receiving a disk path, and reading a file list to be converted according to the disk path, wherein the file list to be converted comprises a plurality of files to be converted;
decompressing each file to be converted, extracting a display file from the decompressed file to be converted, and reading version data stored in the display file as identification information of the file to be converted, wherein the version data comprises a package name and a version number;
determining a corresponding plug-in list in a warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information;
and recording the target plug-in information to obtain a target file corresponding to the file to be converted.
2. The method according to claim 1, wherein after receiving the disk path and reading the list of files to be converted according to the disk path, the method further comprises:
carrying out validity detection on each file to be converted, and generating a detection result for each file to be converted, wherein the validity detection comprises content detection, format detection and virus detection;
if the detection result indicates that the file to be converted is normal, converting the file to be converted into the target file;
and if the detection result indicates that the file to be converted is abnormal, generating alarm information, and sending the alarm information to a background terminal for displaying, wherein the alarm information is used for triggering the background terminal to upload a modification instruction of the file to be converted.
3. The method according to claim 2, wherein the performing validity detection on each of the files to be converted and generating a detection result for each of the files to be converted includes:
calling a legal file detection module to respectively perform the content detection, the format detection and the virus detection on the file to be converted, and determining a content detection sub-result, a format detection sub-result and a virus detection sub-result of the file to be converted;
and generating a detection result for indicating that the file to be converted is normal when all the content detection sub-result, the format detection sub-result and the virus detection sub-result indicate normal, otherwise, generating a detection result for indicating that the file to be converted is abnormal.
4. The method according to claim 3, wherein the performing the content detection, the format detection and the virus detection on the file to be converted respectively, and determining the content detection sub-result, the format detection sub-result and the virus detection sub-result of the file to be converted comprise:
when the content detection is carried out, reading the file to be converted, determining the insert organization information, the insert project name, the coordinate information of the insert version number and the storage state of the specified file in the file to be converted, and generating a content detection sub-result for indicating normal when the storage state meets a preset storage state, otherwise, generating a content detection sub-result for indicating abnormal;
reading a suffix name of the file to be converted when the format detection is carried out, and generating a format detection sub-result for indicating normal when the suffix name meets a preset suffix name, otherwise, generating a format detection sub-result for indicating abnormal;
when the virus detection is carried out, a file virus scanning module is called to scan the file to be converted, when the result output by the file virus scanning module indicates that no virus exists, a virus detection sub-result used for indicating normal is generated, otherwise, a virus detection sub-result used for indicating abnormal is generated.
5. The method according to claim 1, wherein the determining a corresponding plug-in list in a warehouse according to the identification information, and pulling plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information comprises:
inquiring the plug-in information hit by the package name and the version number in the warehouse to generate a plug-in list, and pulling the plug-in information indicated by the plug-in list in the warehouse according to the plug-in list, wherein the warehouse comprises a private company intranet server warehouse, a public network warehouse and a central public network warehouse;
and analyzing the plug-in information, deleting the plug-in information which is not matched with the identification information, and taking the residual plug-in information after deletion as the target plug-in information.
6. The method of claim 5, wherein prior to parsing the plug-in information, the method further comprises: and reversely checking the plug-in list, if the plug-in list does not have data content, recording the failure reason of the plug-in information pulling failure, and returning the failure reason to the background terminal for displaying.
7. The method according to claim 1, wherein the recording the target plug-in information to obtain a target file corresponding to the file to be converted includes: and identifying the target plug-in information, recording plug-in organization information, plug-in project names and plug-in version numbers in the target plug-in information, and storing the plug-in organization information, the plug-in project names and the plug-in version numbers as the target files.
8. A file conversion apparatus, comprising:
the receiving module is used for receiving a disk path and reading a file list to be converted according to the disk path, wherein the file list to be converted comprises a plurality of files to be converted;
the decompression module is used for decompressing each file to be converted, extracting a display file from the decompressed file to be converted, and reading version data stored in the display file as identification information of the file to be converted, wherein the version data comprises a package name and a version number;
the pulling module is used for determining a corresponding plug-in list in a warehouse according to the identification information, and pulling the plug-in information indicated by the plug-in list to obtain target plug-in information matched with the identification information;
and the recording module is used for recording the target plug-in information to obtain a target file corresponding to the file to be converted.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program performs the steps of the method according to any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202211395095.2A 2022-11-08 2022-11-08 File conversion method and device, computer equipment and computer readable storage medium Pending CN115687247A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211395095.2A CN115687247A (en) 2022-11-08 2022-11-08 File conversion method and device, computer equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211395095.2A CN115687247A (en) 2022-11-08 2022-11-08 File conversion method and device, computer equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115687247A true CN115687247A (en) 2023-02-03

Family

ID=85050748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211395095.2A Pending CN115687247A (en) 2022-11-08 2022-11-08 File conversion method and device, computer equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115687247A (en)

Similar Documents

Publication Publication Date Title
US8782609B2 (en) Test failure bucketing
JP5208635B2 (en) Information processing apparatus, information processing system, programming support method and program for supporting programming
CN111078481B (en) Method, device, electronic equipment and storage medium for acquiring configuration checklist
CN110019067B (en) Log analysis method and system
CN111144839A (en) Project construction method, continuous integration system and terminal equipment
CN112395305A (en) SQL statement analysis method and device, electronic equipment and storage medium
US11422917B2 (en) Deriving software application dependency trees for white-box testing
CN113568604B (en) Method and device for updating wind control strategy and computer readable storage medium
CN113553064B (en) Web front-end code conversion method
CN114416481A (en) Log analysis method, device, equipment and storage medium
CN111352631B (en) Interface compatibility detection method and device
CN113760617A (en) Fault processing method and device, equipment and storage medium
CN111026604B (en) Log file analysis method and device
CN116795486A (en) Analysis method and device for container mirror image file purification, storage medium and terminal
CN111966630A (en) File type detection method, device, equipment and medium
JP2021140430A (en) Database migration method, database migration system, and database migration program
CN115687247A (en) File conversion method and device, computer equipment and computer readable storage medium
US8819645B2 (en) Application analysis device
CN110096281B (en) Code analysis method, analysis server, storage medium and device
CN111767213B (en) Database check point testing method and device, electronic equipment and storage medium
CN114756868A (en) Network asset and vulnerability association method and device based on fingerprint
CN114090514A (en) Log retrieval method and device for distributed system
CN113037521B (en) Method for identifying state of communication equipment, communication system and storage medium
CN111338956A (en) Automatic pressure measurement method, device, equipment and storage medium
CN111291130A (en) Hive table consistency checking method, system, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination