CN115687245A - Project file migration method and device, computer equipment and storage medium - Google Patents

Project file migration method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115687245A
CN115687245A CN202211382702.1A CN202211382702A CN115687245A CN 115687245 A CN115687245 A CN 115687245A CN 202211382702 A CN202211382702 A CN 202211382702A CN 115687245 A CN115687245 A CN 115687245A
Authority
CN
China
Prior art keywords
file
migration
migrated
project
menu
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
CN202211382702.1A
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.)
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology Co Ltd
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology 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 Industrial and Commercial Bank of China Ltd ICBC, ICBC Technology Co Ltd filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202211382702.1A priority Critical patent/CN115687245A/en
Publication of CN115687245A publication Critical patent/CN115687245A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a project file migration method, a project file migration device, computer equipment and a storage medium, and relates to the technical field of computers. Can be used in the field of financial science and technology or other related fields. The method comprises the following steps: acquiring a project file migration instruction, wherein the project file migration instruction carries a menu file to be migrated of a project to be migrated; determining a file root directory of the item to be migrated according to a preset migration strategy; identifying a dependent file corresponding to the menu file to be migrated from files in the file root directory according to the preset migration strategy; and migrating the menu file to be migrated and the dependent file to a target project according to the preset migration strategy. By adopting the method, the project file migration efficiency can be improved.

Description

Project file migration method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a project file migration method, an apparatus, a computer device, a storage medium, and a computer program product.
Background
The project is to use various methods to organize resources such as manpower, materials, finance and the like, and carry out an independent one-time or long-term indefinite work task according to the related planning arrangement of a business model so as to achieve the target defined by quantity and quality indexes. To facilitate uniform management of the project, the enterprise migrates the data of the branch sub-project to the main project. In a traditional project file migration mode, dependent files corresponding to a menu to be migrated in a project are manually screened for migration. However, manual migration requires file-dependent screening of each file, and the migration efficiency of project files is low due to the large amount of files.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a project file migration method, a project file migration apparatus, a computer device, a computer readable storage medium, and a computer program product, which can improve the efficiency of project file migration.
In a first aspect, the present application provides a project file migration method. The method comprises the following steps:
acquiring a project file migration instruction, wherein the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project;
determining a file root directory of an item to be migrated according to a preset migration strategy;
according to a preset migration strategy, identifying a dependent file corresponding to a menu file to be migrated from files in a file root directory;
and migrating the menu file to be migrated and the dependent file to the target project according to a preset migration strategy.
In one embodiment, identifying a dependent file corresponding to a menu file to be migrated from files in a file root directory according to a preset migration policy includes:
identifying the file type of the file under the file root directory according to a preset migration strategy;
and determining a dependent file corresponding to the menu file to be migrated according to the identified file type.
In one embodiment, identifying the file type of the file under the file root directory according to the preset migration policy includes:
identifying a file extension name of a file under a file root directory according to a preset migration strategy;
and determining the file type of the corresponding file under the file root directory according to the identified file extension name.
In one embodiment, the method further includes:
when the file under the file root directory does not have the file extension, performing feature identification on the file without the file extension according to a preset migration strategy to obtain file features;
and determining the file type of the file without the file extension according to the file characteristics.
In one embodiment, the performing feature identification on the file without the file extension according to the preset migration policy to obtain the file feature includes:
acquiring a plurality of naming standard files according to a preset migration strategy;
file characteristics in files for which no file extension exists are identified from the plurality of naming-criteria files.
In one embodiment, the performing feature identification on the file without the file extension according to the preset migration policy to obtain the file feature includes:
identifying database languages in files without file extensions according to a preset migration strategy to obtain database table identifiers;
and determining the database table identification as the file characteristics corresponding to the file without the file extension.
In a second aspect, the application further provides a project file migration device. The device comprises:
the menu file acquisition module is used for acquiring a project file migration instruction, wherein the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project;
the root directory determining module is used for determining a file root directory of the item to be migrated according to a preset migration strategy;
the dependent file identification module is used for identifying a dependent file corresponding to the menu file to be migrated from the files in the file root directory according to a preset migration strategy;
and the file migration module is used for migrating the menu file to be migrated and the dependent file to the target project according to a preset migration strategy.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
acquiring a project file migration instruction, wherein the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project;
determining a file root directory of an item to be migrated according to a preset migration strategy;
according to a preset migration strategy, identifying a dependent file corresponding to a menu file to be migrated from files in a file root directory;
and migrating the menu file to be migrated and the dependent file to the target project according to a preset migration strategy.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring a project file migration instruction, wherein the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project;
determining a file root directory of an item to be migrated according to a preset migration strategy;
according to a preset migration strategy, identifying a dependent file corresponding to a menu file to be migrated from files in a file root directory;
and migrating the menu file to be migrated and the dependent file to the target project according to a preset migration strategy.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
acquiring a project file migration instruction, wherein the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project;
determining a file root directory of an item to be migrated according to a preset migration strategy;
according to a preset migration strategy, identifying a dependent file corresponding to a menu file to be migrated from files in a file root directory;
and migrating the menu file to be migrated and the dependent file to the target project according to a preset migration strategy.
According to the project file migration method, the project file migration device, the computer equipment, the storage medium and the computer program product, the to-be-migrated menu file of the to-be-migrated project is obtained by analyzing the project file migration instruction, so that the file root directory of the to-be-migrated project is automatically determined according to the preset migration strategy, the dependent file corresponding to the to-be-migrated menu file is identified in the files under the file root directory according to the preset migration strategy, and the to-be-migrated menu file and the dependent file are migrated to the target project according to the preset migration strategy. The dependent files can be automatically identified according to the preset migration strategy, the migration of the menu files to be migrated and the dependent files is realized, and the migration efficiency of the project files is improved.
Drawings
FIG. 1 is a diagram of an application environment of a project file migration method in one embodiment;
FIG. 2 is a flowchart illustrating a method for migrating a project file according to an embodiment;
FIG. 3 is a schematic diagram of a migration interface in one embodiment;
FIG. 4 is a partial schematic view of a migration result tree in one embodiment;
fig. 5 is a schematic flowchart illustrating a step of identifying a dependent file corresponding to a menu file to be migrated from files in a file root directory according to a preset migration policy in an embodiment;
FIG. 6 is a diagram illustrating a default migration policy in one embodiment;
FIG. 7 is a block diagram showing the construction of a project file migration apparatus according to one embodiment;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The project file migration method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. The terminal 102 has a project migration application running thereon in advance. And the project migration application acquires a project file migration instruction, and analyzes the project file migration instruction to obtain a menu file to be migrated of the project to be migrated. The item migration application determines a file root directory of an item to be migrated according to a preset migration strategy, acquires files under the file root directory in the server 104 according to the preset migration strategy, identifies dependent files corresponding to the menu file to be migrated from the files under the file root directory, and migrates the menu file to be migrated and the dependent files to a target item according to the preset migration strategy. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In an embodiment, as shown in fig. 2, a project file migration method is provided, which is described by taking the application of the method to the terminal in fig. 1 as an example, and includes the following steps:
step 202, a project file migration instruction is obtained, and the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project.
The project file migration instruction is used for indicating a project migration application in the terminal to perform project file migration. The item to be migrated refers to an independent one-time or long-term indefinite work task needing to migrate data. The item to be migrated may include a plurality of menus. The menu file to be migrated is a menu file corresponding to a menu to be migrated selected from a plurality of menus of the item to be migrated.
Specifically, the terminal has a project migration application running in advance, and is an application program. The project migration tool may be developed using javafx (a Java library for building rich internet applications). The project personnel can log in the project migration application in the terminal, and when the project migration application receives the selection operation of the project to be migrated, a migration interface is displayed. The item migration application may receive a selection operation acting on the selection component in the migration interface, and search for a corresponding menu file through paths of the plurality of menus according to the selection operation acting on the selection component. And when the item migration application acquires the selection operation of the menu file, determining the menu file to be migrated of the item to be migrated according to the selection operation of the menu file, and displaying the menu file to be migrated in the corresponding menu display area. The menu file to be migrated may include menu parameters related to the menu function to be migrated, such as a menu display diagram, a menu title, and the like.
And then, the project migration application can receive the project migration instruction in the migration interface, and analyze the project migration instruction to obtain the menu file to be migrated of the project to be migrated. And the project migration application identifies the dependent file corresponding to the menu file to be migrated based on the project file migration instruction, and migrates the menu file to be migrated and the dependent file to the target project to obtain a migration result. And the item migration application displays the migration result in the corresponding migration result display area.
FIG. 3 is a schematic diagram of a migration interface. The migration interface comprises a menu selection component, a function menu display area, a deleting component and a clearing component which correspond to the function menu display area, a migration result display area, a clearing component and a result component which correspond to the migration result display area, and a migration component. And the project personnel selects the menu file to be migrated by triggering a menu selection component of the migration interface, and generates menu selection operation based on the selected menu file to be migrated. The menu file to be migrated may be a java file or a jsp file. The item migration application can receive a menu selection operation acting on the migration interface, acquire a to-be-migrated menu file of the item to be migrated according to the menu selection operation, and display the to-be-migrated menu file in the function menu display area. The item migration application may receive a trigger operation of a deletion component corresponding to the function menu display area, and delete the to-be-migrated menu file displayed in the function menu display area according to the trigger operation. The item migration application can receive a trigger operation of an emptying component corresponding to the function menu display area, and according to the trigger operation, emptying the menu file to be migrated displayed in the function menu display area. When the project personnel trigger the migration component, the project migration application receives a project file migration instruction. And analyzing the item file migration instruction to obtain a menu file to be migrated. And the project migration application identifies the dependent file corresponding to the menu file to be migrated, and migrates the menu file to be migrated and the dependent file to the target project to obtain a migration result. And displaying the migration result in the migration result area. The item migration application may receive a trigger operation of an emptying component corresponding to the migration result display area, and perform an emptying operation on the migration result displayed in the migration result display area according to the trigger operation. And when the project migration application acquires the trigger operation of the result tree component, displaying the migration result in the migration result display area in the form of a result tree according to the trigger operation.
Optionally, the menu file to be migrated of the item to be migrated may be a menu file to be migrated of a menu function newly added to the item to be migrated.
Optionally, the number of the menu files to be migrated of the item to be migrated may be multiple, which may enable simultaneous migration of multiple menu functions.
And 204, determining a file root directory of the item to be migrated according to a preset migration strategy.
The preset migration policy refers to a principle or a mode of migration of the project file, and the project migration application in the terminal may perform migration of the project data according to the preset migration policy. The file root directory refers to the top directory of the item to be migrated.
The project migration application may perform the data migration operation according to a preset migration policy. The preset migration policy may include a data migration manner. Specifically, the item migration application may first determine a file root directory of the item to be migrated according to a preset migration policy. The file root directory may include a plurality of subdirectories, and each subdirectory may include a plurality of files. The menu file to be migrated may be a file in a subdirectory.
And step 206, identifying a dependent file corresponding to the menu file to be migrated from the files in the file root directory according to a preset migration strategy.
The dependent file refers to a file related to a menu file to be migrated, that is, a file that must be depended on to implement a menu function.
The data migration method in the preset migration policy may be to determine a file root directory of the item to be migrated first, and then identify a dependent file corresponding to the menu file to be migrated from files in the file root directory. After determining the file root directory, the item migration application may acquire all files under the file root directory. All files under the root directory of a file may include files under multiple subdirectories. The item migration application in the terminal identifies the dependent file corresponding to the menu file to be migrated from all files in the file root directory. Since the file type of the dependent file corresponding to the menu file to be migrated is determined, the item migration application may determine the dependent file by identifying the file type of the file under the file root directory. The file types of the dependent files may include jsp (java server page, dynamic web program file written in java language), js (javascript, file written in javascript language), css (cascading style sheets), images (picture files), java (file written in java language), storage process, and database table.
Further, the preset migration policy may include migration policies corresponding to a plurality of dependent files. Since there are multiple file types depending on the file, the migration policy corresponding to each dependent file may be different. In the process of identifying the dependent file, the item migration application may identify the dependent file corresponding to the menu file to be migrated from the files under the file root directory according to a plurality of migration policies of the preset migration policy. Each migration policy may identify dependent files of the corresponding file type. The method and the device can adopt a unique migration strategy aiming at various dependent files, and improve the accuracy of dependent file identification.
And 208, migrating the menu file to be migrated and the dependent file to the target item according to a preset migration strategy.
The target item is an item to which menu migration is required.
And after identifying the dependent file corresponding to the menu file to be migrated by the item migration application in the terminal, extracting the dependent file, and migrating the dependent file and the menu file to be migrated to the target item. Specifically, when the item migration application migrates the menu file to be migrated and the dependent file according to the preset migration policy, the dependent file may be captured first, and then the menu file to be migrated and the dependent file are migrated to the target item.
Alternatively, the item to be migrated may be a branch child of the target item. For example, the items to be migrated may be cm2006 items.
Further, when the terminal runs the project migration application for the first time, the project migration application generates directory configuration reminding information, and configures the root directory and the target directory of the project to be migrated according to the directory configuration reminding information. The root directory and the target directory are identical in structure. In the subsequent project file migration process, the dependent file corresponding to the menu file to be migrated can be automatically identified, so that the menu file to be migrated and the dependent file are automatically migrated to the target directory, and the original directory structure is maintained.
In one embodiment, the item migration application migrates the menu file to be migrated and the dependent file to the target item according to a preset migration policy, and then obtains a migration result. The migration result refers to the directory structure of the target directory after migration. The project migration application may display the migration result in the form of a result tree in the migration result display area. Fig. 4 is a partial schematic view of a fruit tree migration. Wherein the dependent file with the file extension of ". Jsp" is a jsp file.
In one embodiment, after the migration of the project file is completed, the migration result may be verified. Specifically, the migration result may be sent to a terminal corresponding to the project staff, and the migration result is compared with the project to be migrated through the terminal, so as to verify whether the migration result is accurate. The method can also be used for carrying out spot check in a mode of manually comparing the migration files, and can also be used for carrying out verification through the migration result displayed by the project migration application.
Further, after the migration of the project file is completed, the terminal can also start a log according to the project of the project to be migrated, and check whether the menu file to be migrated and the dependent file are completely migrated. After the project is started, the migration function of the project migration application can be checked at the same time.
In a traditional project file migration mode, migration is performed by manually screening a dependent file corresponding to a menu to be migrated in a project. The method needs to screen each file depending on the file, and the migration efficiency of the project file is low due to the fact that the quantity of the files is large, time and labor are wasted, and the project file migration efficiency is low. Manual migration is easy to miss, menu functions are lost, and the migration accuracy of the project files is low. When a plurality of persons migrate, the migrated files are repeated, so that not only is the repeated work performed, but also the problem of duplicate removal of the same files needs to be solved subsequently, and the migration process is complex. When the files are migrated, the contents of the files need to be traversed, dependent files are identified correctly by manpower, and the migration difficulty is high.
In this embodiment, after the item migration application obtains the item file migration instruction, the item file migration instruction is analyzed to obtain the menu file to be migrated of the item to be migrated, so that the file root directory of the item to be migrated is automatically determined according to the preset migration policy, the dependent file corresponding to the menu file to be migrated is identified in the file under the file root directory according to the preset migration policy, and the menu file to be migrated and the dependent file are migrated to the target item according to the preset migration policy. The dependent files can be automatically identified according to the preset migration strategy, the migration of the menu files to be migrated and the dependent files is realized, and the migration efficiency of the project files is improved. Because all related files of the item to be migrated are included in the file root directory, the dependent file corresponding to the menu file to be migrated is identified in the files in the file root directory according to the preset migration strategy, and the accuracy of the migration of the item file can be improved. In addition, the file migration is carried out through the project migration application, the problem of repeated file migration is solved, and the migration process is simple. When the files are migrated, the dependent files can be automatically identified for migration, manual identification of the dependent files is not needed, and the problem that the dependent files are difficult to search is solved.
In an embodiment, as shown in fig. 5, identifying, according to a preset migration policy, a dependent file corresponding to a menu file to be migrated from files in a file root directory includes:
step 502, identifying the file type of the file under the file root directory according to a preset migration strategy.
Step 504, determining a dependent file corresponding to the menu file to be migrated according to the identified file type.
The preset migration policy may include a general migration policy and a feature recognition policy. The universal migration strategy refers to a dependent file identification mode applicable to files in a file root directory. The characteristic identification strategy is a personalized dependent file identification mode adopted when the general migration strategy cannot identify the dependent file.
Specifically, the project migration application may first identify a file type of a file in the file root directory according to a general migration policy in the preset migration policies. And determining a dependent file corresponding to the menu file to be migrated according to the identified file type. And when the file type of the file under the file root directory cannot be identified by the general migration strategy, identifying the file type of the file under the file root directory according to the characteristic identification strategy, thereby determining the dependent file. Wherein the generic migration policy may be an extension identifying the file. The characteristic identification strategy can be to identify the file characteristics of the file, and the file type is determined by the file characteristics. And when the file type is a preset type, determining the file as a dependent file corresponding to the menu file to be migrated. The preset types can comprise jsp, js, css, images, java, storage process and database table.
Further, the common migration policy and the feature identification policy may identify the dependent file in the files under the file root directory by using a regular expression.
In this embodiment, the file type of the file under the file root directory is identified according to the preset migration policy, and the dependent file corresponding to the menu file to be migrated is determined according to the identified file type. Because the dependent file has a specific file type, the dependent file can be quickly identified by identifying the file type, so that the project file migration efficiency is improved.
In one embodiment, in step 502, identifying the file type of the file under the file root directory according to the preset migration policy includes: identifying a file extension name of a file under a file root directory according to a preset migration strategy; and determining the file type of the corresponding file under the file root directory according to the identified file extension name.
The project migration application may identify a file extension of a file in the file root directory according to a general migration policy in the preset migration policies, and determine a file type of the file in the file root directory according to a correspondence table between the file extension and the file type. When jsp, js, css and images files under the file root directory are written by adopting Java specifications, the files can be identified by adopting a migration strategy. For example, when the file extension of the file is identified as ". Jsp", the file type of the file is a jsp file. When the file extension of the file is identified as ". Gif,". Png ",". Jpeg ", or". Jpg ", the file type of the file is an images picture file. When the file extension of the file is identified as ". Css", the file type of the file is a css file. When the file extension of the file is identified as ". Js", the file type of the file is a js file.
Further, determining the file type of the file by the migration policy may further include identifying a relative path and an absolute path of the file. For example, when a relative path to a file is identified as "a/b.jsp", it indicates that the file type of the file is a jsp file. When the relative path of the file is identified as "./a.jpg", the file type of the file is indicated as an images picture file.
In this embodiment, the file extension of the file in the file root directory is identified according to the preset migration policy, so that the file type of the corresponding file in the file root directory is determined according to the identified file extension. Dependent files that satisfy a common migration policy can be quickly identified.
In one embodiment, the method further comprises: when the file under the file root directory does not have the file extension name, performing feature identification on the file without the file extension name according to a preset migration strategy to obtain file features; and determining the file type of the file without the file extension according to the file characteristics.
Because the coding modes of the files are various, the naming specifications of the dependent files are not uniform. The project migration application in the terminal may perform individual analysis on files that are not applicable to the general migration policy according to the feature recognition policy in the preset migration policy.
Specifically, when the project migration application file identifies that the file under the root directory does not have the file extension, the file without the file extension is subjected to feature identification according to a feature identification strategy in a preset migration strategy, and file features are obtained. The characteristic identification policy may include a file identifier for identifying the file, a reference relationship in the identified file, an API (interface) in the parsed file, a description language in the parsed file, and the like. For example, a file characteristic may be a class name, a package name, a reference relationship in the file, a stored procedure name, and a database table name. And determining the file type of the file without the file extension according to the file characteristics. For example, when the file characteristic is identified as the name of a java class, the name of a java package or a java class referenced in the file, the file type of the file is determined to be a java file. And when the identified file characteristic is the name of the stored process, determining the file type of the file as the file of the stored process. And when the identified file characteristic is the name of the database table, determining the file type of the file as the database table.
Further, the item migration application determines a reference relation of the file in the file without the file extension, identifies whether the reference relation has a java class referenced by the import, and if so, determines that the file is a java file.
Further, the project migration application may identify an API in a file for which a file extension does not exist, and identify interface information such as a storage name, an entry parameter, and an exit parameter by parsing the API. And determining the file as a stored process file according to the stored process name in the interface information.
In this embodiment, feature identification is performed on a file without a file extension according to a preset migration policy to obtain file features, and a file type of the file without the file extension is determined according to the file features. The method and the device can identify the dependent files with different writing method specifications, and improve the identification accuracy of the dependent files.
In one embodiment, the performing feature identification on the file without the file extension according to the preset migration policy to obtain the file feature includes: acquiring a plurality of naming standard files according to a preset migration strategy; file characteristics in files for which no file extension exists are identified from the plurality of naming criteria files.
And the project migration application acquires a plurality of naming standard files according to a preset migration strategy. The plurality of naming standard files include naming standard files corresponding to a plurality of file types. The naming standard file for each file type may include a plurality of different writing specifications for the file type. For example, the naming standard file may include a java package path naming specification and a java class naming specification corresponding to the java file, and a stored procedure naming specification corresponding to the stored procedure file.
And searching corresponding naming information in the file without the file extension according to the plurality of naming standard files. And determining the naming information as the file characteristics corresponding to the file without the file extension. The naming information may be class names, package names, reference relationships in files, and stored procedure names. For example, when the java package path name or the java class name is found in the file, the file is determined as a java file. When the stored procedure name is found in the file, the file is determined as the stored procedure file.
In this embodiment, a plurality of naming standard files are obtained according to a preset migration policy, and file features in files without file extensions are identified according to the plurality of naming standard files. The method can accurately identify various writing methods of different dependent files, and further improves the accuracy of dependent file identification.
In one embodiment, the performing feature identification on the file without the file extension according to the preset migration policy to obtain the file feature includes: identifying database languages in files without file extensions according to a preset migration strategy to obtain database table identifiers; and determining the database table identification as the file characteristics corresponding to the file without the file extension name.
The project migration application can identify the database language in the file without the file extension according to a feature identification strategy in a preset migration strategy to obtain a database table identifier. The database Language may be SQL (Structured Query Language). Database table identification refers to a unique marker used to distinguish different database tables. And taking the identified database table identification as the file characteristic corresponding to the file without the file extension name, and further determining the dependent file corresponding to the menu file to be migrated according to the file characteristic. By identifying the database table identification, the database table on which the menu file to be migrated depends can be determined.
In this embodiment, the database language in the file without the file extension is identified according to the preset migration policy to obtain the identifier of the database table, so that the database table on which the menu file to be migrated depends can be accurately determined.
In one embodiment, the feature identification policy of the item migration application may further include an item specification identification policy. And identifying whether the picture files in the dependent files are international files according to the project specification identification strategy, and if so, migrating the picture files to a plurality of subdirectories of the target directory. And if the picture file is not the internationalized file, migrating the picture file to a corresponding subdirectory of the target directory.
Furthermore, whether the java class in the java file is a file in jar can be identified according to the project specification identification strategy, and if the java class is the file in jar, migration is required. If not, migration is not required.
In one embodiment, as shown in fig. 6, a schematic diagram of a preset migration policy is shown. Wherein, the dotted line arrow represents the dependency relationship, and the solid line arrow represents the precedence relationship of the flow. The menu migration entry is used for acquiring a file to be migrated of the item to be migrated, and may be configured in filemoveverservice. And the general migration strategy can be configured in the BaseServer. The preset migration strategy also comprises a characteristic identification strategy, and the java file migration strategy is used for identifying the personalized writing method of the java file and can be configured in JavaService. The jsp, js and image file migration strategy is used for identifying the personalized writing method of the jsp, js and image file, and can be configured in the ResourceServer. The cs migration policy is used for identifying the personalized writing method of the cs file, and can be configured in the cssService. The storage process + database table policy is used for identifying a storage process and a database table, and can be configured in the SqlService. The regular expression identification file refers to an identification method on which a characteristic identification strategy depends, and the characteristic identification strategy can identify a corresponding dependent file through a regular expression in the regular expression identification file. The regular expression identification file can comprise a plurality of java capture rules, a plurality of jsp capture rules, a plurality of js capture rules, a plurality of image capture rules, a plurality of css capture rules, a plurality of capture rules in the storage process and a plurality of capture rules in the database table. The regular expression identification file may be configured in RegexUtil.
In another embodiment, a project file migration method is provided, which includes:
acquiring a project file migration instruction, wherein the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project;
determining a file root directory of an item to be migrated according to a preset migration strategy;
identifying a file extension name of a file under a file root directory according to a preset migration strategy;
determining the file type of the corresponding file under the file root directory according to the identified file extension name;
when the file under the file root directory does not have the file extension name, performing feature identification on the file without the file extension name according to a preset migration strategy to obtain file features;
determining the file type of the file without the file extension name according to the file characteristics;
determining a dependent file corresponding to the menu file to be migrated according to the identified file type;
and migrating the menu file to be migrated and the dependent file to the target project according to a preset migration strategy.
In this embodiment, the dependent file can be automatically identified according to the preset migration policy through the project migration application, and the migration of the menu file to be migrated and the dependent file is realized, so that the migration efficiency of the project file is improved. Because all the related files of the item to be migrated are included in the file root directory, the dependent file corresponding to the menu file to be migrated is identified in the files in the file root directory according to the preset migration strategy, and the accuracy of the migration of the item file can be improved. In addition, the file migration is carried out through the project migration application, the problem of repeated file migration is solved, and the migration process is simple. When the files are migrated, the dependent files can be automatically identified for migration, manual identification of the dependent files is not needed, and the problem that the dependent files are difficult to search is solved.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a project file migration apparatus for implementing the project file migration method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the method, so the specific limitations in one or more embodiments of the project file migration device provided below can refer to the limitations on the project file migration method in the foregoing, and details are not described here again.
In one embodiment, as shown in fig. 7, there is provided a project file migration apparatus including: a menu file obtaining module 702, a root directory determining module 704, a dependent file identifying module 706, and a file migrating module 708, wherein:
the menu file obtaining module 702 is configured to obtain a project file migration instruction, where the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project.
A root directory determining module 704, configured to determine a file root directory of the item to be migrated according to a preset migration policy.
And a dependent file identification module 706, configured to identify, according to a preset migration policy, a dependent file corresponding to the menu file to be migrated from the files in the file root directory.
The file migration module 708 is configured to migrate the menu file to be migrated and the dependent file to the target item according to a preset migration policy.
In one embodiment, dependent file identification module 706 includes:
the file type identification module is used for identifying the file type of the file under the file root directory according to a preset migration strategy;
and the dependent file determining module is used for determining a dependent file corresponding to the menu file to be migrated according to the identified file type.
In one embodiment, the file type identification module is further configured to identify a file extension of a file in the file root directory according to a preset migration policy; and determining the file type of the corresponding file under the file root directory according to the identified file extension name.
In one embodiment, the file type identification module is further configured to, when a file under the file root directory does not have a file extension, perform feature identification on the file without the file extension according to a preset migration policy to obtain file features; and determining the file type of the file without the file extension according to the file characteristics.
In one embodiment, the file type identification module is further configured to obtain a plurality of naming standard files according to a preset migration policy; file characteristics in files for which no file extension exists are identified from the plurality of naming criteria files.
In one embodiment, the file type identification module is further configured to identify a database language in a file without a file extension according to a preset migration policy to obtain a database table identifier; and determining the database table identification as the file characteristics corresponding to the file without the file extension name.
The modules in the project file migration apparatus can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 8. The computer apparatus includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device. The processor, the memory and the input/output interface are connected by a system bus, and the communication interface, the display unit and the input device are connected by the input/output interface to the system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The input/output interface of the computer device is used for exchanging information between the processor and an external device. The communication interface of the computer device is used for communicating with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a project file migration method. The display unit of the computer device is used for forming a visual visible picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 8 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: acquiring a project file migration instruction, wherein the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project; determining a file root directory of an item to be migrated according to a preset migration strategy; according to a preset migration strategy, identifying a dependent file corresponding to a menu file to be migrated from files in a file root directory; and migrating the menu file to be migrated and the dependent file to the target project according to a preset migration strategy.
In one embodiment, the processor when executing the computer program further performs the steps of: identifying the file type of the file under the file root directory according to a preset migration strategy; and determining a dependent file corresponding to the menu file to be migrated according to the identified file type.
In one embodiment, the processor, when executing the computer program, further performs the steps of: identifying a file extension name of a file under a file root directory according to a preset migration strategy; and determining the file type of the corresponding file under the file root directory according to the identified file extension name.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the file under the file root directory does not have the file extension, performing feature identification on the file without the file extension according to a preset migration strategy to obtain file features; and determining the file type of the file without the file extension according to the file characteristics.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a plurality of naming standard files according to a preset migration strategy; file characteristics in files for which no file extension exists are identified from the plurality of naming criteria files.
In one embodiment, the processor, when executing the computer program, further performs the steps of: identifying database languages in files without file extensions according to a preset migration strategy to obtain database table identifiers; and determining the database table identification as the file characteristics corresponding to the file without the file extension name.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a project file migration instruction, wherein the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project; determining a file root directory of an item to be migrated according to a preset migration strategy; according to a preset migration strategy, identifying a dependent file corresponding to a menu file to be migrated from files in a file root directory; and migrating the menu file to be migrated and the dependent file to the target project according to a preset migration strategy.
In one embodiment, the computer program when executed by the processor further performs the steps of: identifying the file type of the file under the file root directory according to a preset migration strategy; and determining a dependent file corresponding to the menu file to be migrated according to the identified file type.
In one embodiment, the computer program when executed by the processor further performs the steps of: identifying a file extension of a file under a file root directory according to a preset migration strategy; and determining the file type of the corresponding file under the file root directory according to the identified file extension name.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the file under the file root directory does not have the file extension name, performing feature identification on the file without the file extension name according to a preset migration strategy to obtain file features; and determining the file type of the file without the file extension according to the file characteristics.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a plurality of naming standard files according to a preset migration strategy; file characteristics in files for which no file extension exists are identified from the plurality of naming criteria files.
In one embodiment, the computer program when executed by the processor further performs the steps of: identifying database languages in files without file extensions according to a preset migration strategy to obtain database table identifiers; and determining the database table identification as the file characteristics corresponding to the file without the file extension name.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) referred to in the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with the relevant laws and regulations and standards of the relevant countries and regions.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, databases, or other media used in the embodiments provided herein can include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A project file migration method, the method comprising:
acquiring a project file migration instruction, wherein the project file migration instruction carries a menu file to be migrated of a project to be migrated;
determining a file root directory of the item to be migrated according to a preset migration strategy;
according to the preset migration strategy, identifying a dependent file corresponding to the menu file to be migrated from files in the file root directory;
and migrating the menu file to be migrated and the dependent file to a target project according to the preset migration strategy.
2. The method according to claim 1, wherein the identifying, according to the preset migration policy, a dependent file corresponding to the menu file to be migrated from the files in the file root directory includes:
identifying the file type of the file under the file root directory according to a preset migration strategy;
and determining a dependent file corresponding to the menu file to be migrated according to the identified file type.
3. The method according to claim 2, wherein the identifying the file type of the file under the file root directory according to the preset migration policy comprises:
identifying the file extension of the file under the file root directory according to a preset migration strategy;
and determining the file type of the corresponding file under the file root directory according to the identified file extension.
4. The method of claim 3, further comprising:
when the file under the file root directory does not have the file extension name, performing feature identification on the file without the file extension name according to the preset migration strategy to obtain file features;
and determining the file type of the file without the file extension according to the file characteristics.
5. The method according to claim 4, wherein the performing feature recognition on the file without the file extension according to the preset migration policy to obtain the file feature comprises:
acquiring a plurality of naming standard files according to the preset migration strategy;
file characteristics in files for which no file extension exists are identified from the plurality of naming-criteria files.
6. The method according to claim 4, wherein the performing feature recognition on the file without the file extension according to the preset migration policy to obtain file features comprises:
identifying database languages in the files without the file extension according to the preset migration strategy to obtain database table identifiers;
and determining the database table identification as the file characteristics corresponding to the file without the file extension.
7. A project file migration apparatus, characterized in that the apparatus comprises:
the menu file acquisition module is used for acquiring a project file migration instruction, wherein the project file migration instruction carries a to-be-migrated menu file of a to-be-migrated project;
the root directory determining module is used for determining a file root directory of the item to be migrated according to a preset migration strategy;
the dependent file identification module is used for identifying a dependent file corresponding to the menu file to be migrated from the files in the file root directory according to the preset migration strategy;
and the file migration module is used for migrating the menu file to be migrated and the dependent file to a target project according to the preset migration strategy.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. 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 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202211382702.1A 2022-11-07 2022-11-07 Project file migration method and device, computer equipment and storage medium Pending CN115687245A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211382702.1A CN115687245A (en) 2022-11-07 2022-11-07 Project file migration method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211382702.1A CN115687245A (en) 2022-11-07 2022-11-07 Project file migration method and device, computer equipment and storage medium

Publications (1)

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

Family

ID=85049329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211382702.1A Pending CN115687245A (en) 2022-11-07 2022-11-07 Project file migration method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115687245A (en)

Similar Documents

Publication Publication Date Title
US10725981B1 (en) Analyzing big data
US9361320B1 (en) Modeling big data
US10628463B2 (en) Applying geo-tags to digital media captured without location information
CN102880714B (en) File clean-up method and device
CN107004008B (en) Relevant file identification using automated queries of different data storage locations
CN102880713B (en) File clean-up method and device
US9251157B2 (en) Enterprise node rank engine
KR101976220B1 (en) Recommending data enrichments
CA2790421C (en) Indexing and searching employing virtual documents
US20150256475A1 (en) Systems and methods for designing an optimized infrastructure for executing computing processes
US11531658B2 (en) Criterion-based retention of data object versions
CN106991175B (en) Customer information mining method, device, equipment and storage medium
CN106873952B (en) Data processing system and method for mobile terminal webpage development and application device
US20170277662A1 (en) Systems and methods for displaying digital forensic evidence
US20160188584A1 (en) System for tracking and displaying changes in a set of related electronic documents.
CN107357794A (en) Optimize the method and apparatus of the data store organisation of key value database
CN106503186A (en) A kind of data managing method, client and system
CN107533544B (en) Element identifier generation
US10528536B1 (en) Managing data object versions in a storage service
CN116167441A (en) Knowledge graph of network security risk assessment and construction method
KR20130126012A (en) Method and apparatusfor providing report of business intelligence
Noskov et al. Open-data-driven embeddable quality management services for map-based web applications
US9256644B1 (en) System for identifying and investigating shared and derived content
CN115687245A (en) Project file migration method and device, computer equipment and storage medium
CN115809304A (en) Method and device for analyzing field-level blood margin, computer 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