Method and apparatus for modifying file name, and storage medium
By acquiring and responding to operation instructions, the names of the target file and its collection of files with the same name are determined and modified, solving the problem of low efficiency in file name modification and realizing efficient and flexible batch file name modification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2020-05-19
- Publication Date
- 2026-05-12
AI Technical Summary
The existing technology is not efficient in modifying file names, especially when there are a large number of files, which can easily lead to omissions and errors. In particular, the letter 'l' and the number '1' are difficult to recognize in some non-standard fonts.
By obtaining operation instructions, the target file and its set of files with the same name are identified, and the unified name modification is performed in response to the instructions, including selecting, skipping or replacing files with the same name, thus realizing batch file name modification.
It improves the efficiency of file name modification, reduces redundant operations, and enhances the flexibility and accuracy of modification.
Smart Images

Figure CN113688102B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically, to a method, apparatus, and storage medium for modifying file names. Background Technology
[0002] If you need to modify files required for a mini-program page, you'll need to repeat the renaming process at least multiple times. Furthermore, when there are many files, relying on the human eye to identify files with the same name can lead to omissions and errors. For example, in some non-standard fonts, the letter "l" and the number "1" may be difficult to distinguish. Therefore, there's a problem with the inefficiency of modifying file names.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This invention provides a method, apparatus, and storage medium for modifying file names, thereby at least solving the technical problem of low efficiency in modifying file names.
[0005] According to one aspect of the present invention, a method for modifying a file name is provided, comprising: determining a first target file whose name is to be modified, wherein the first target file is currently located in a target level directory and the current file name of the first target file is a first file name; obtaining a first operation instruction triggered by performing an operation on the first target file, wherein the first operation instruction is used to instruct to perform a name modification operation on object files in a file set, the object files in the file set are located in the target level directory and have the same file name as the first target file; and in response to the first operation instruction, modifying the file name of the object files in the file set from the first file name to a second file name.
[0006] As an optional implementation, the above-mentioned acquisition of the first operation instruction triggered by the operation performed on the first target file includes: acquiring the second operation instruction triggered by the operation performed on the first target file, wherein the second operation instruction is used to request the acquisition of all files in the target level directory that have the same file name as the first target file; in response to the second operation instruction, displaying all the files; determining the object file in the file set from the all the files, and generating the first operation instruction based on the file set.
[0007] As an optional implementation, determining the object file in the file set from all the files includes: selecting the files corresponding to the configuration items of each of the files as the object file in the file set; while determining the object file from all the files, it also includes: obtaining the configured second file name.
[0008] As an optional implementation, when modifying the file name of the object file in the file set from the first file name to the second file name, the method further includes: obtaining a first adjustment instruction when at least one of the object files has the same name as a file under the target level directory, wherein the same name indicates that the files have the same file name and the same file extension, and the first adjustment instruction indicates that the name modification of the object files in the file set should be stopped; in response to the first adjustment instruction, obtaining the current modification progress, wherein the current modification progress indicates that the name modification of i object files in the object set has been completed, where i is an integer greater than 1 and less than N, and N is the number of object files in the file set; and stopping the name modification of the (i+1)th to Nth object files in the object set.
[0009] As an optional implementation, when the name modification of the (i+1)th to the Nth object files in the object set is stopped, the method further includes: restoring the file names of the first i object files in the object set to the first file name.
[0010] As an optional implementation, when modifying the file name of the object file in the above file set from the first file name to the second file name, the method further includes: if at least one of the object files has the same name as a file under the target level directory, determining at least one of the object files as a first target object file; obtaining a second adjustment instruction, wherein the second adjustment instruction is used to instruct to skip the first target object file and obtain the next object file for name modification.
[0011] As an optional implementation, when modifying the file name of the object file in the above file set from the first file name to the second file name, the method further includes: if at least one of the object files has the same name as a file under the target level directory, determining at least one of the object files as a second target object file, and the file with the same name as the second target object file as a conflicting file; obtaining a third adjustment instruction, wherein the third adjustment instruction is used to instruct the second target object file to replace the conflicting file.
[0012] According to another aspect of the present invention, a file name modification apparatus is also provided, comprising: a determining unit, configured to determine a first target file whose name is to be modified, wherein the first target file is currently located in a target level directory and the current file name of the first target file is a first file name; an acquiring unit, configured to acquire a first operation instruction triggered by performing an operation on the first target file, wherein the first operation instruction is used to instruct to perform a name modification operation on object files in a file set, wherein the object files in the file set are located in the target level directory and have the same file name as the first target file; and a responding unit, configured to respond to the first operation instruction by modifying the file name of the object files in the file set from the first file name to a second file name.
[0013] As an optional implementation, the acquisition unit includes: a first acquisition module, configured to acquire a second operation instruction triggered by performing an operation on the first target file, wherein the second operation instruction is configured to request the acquisition of all files in the target level directory that have the same file name as the first target file; a first response module, configured to respond to the second operation instruction and display all the files; and a first determination module, configured to determine the object file in the file set from the all the files and generate the first operation instruction based on the file set.
[0014] As an optional implementation, the determination module includes: a selection subunit, used to select the files from the configuration items corresponding to each of the above-mentioned files as the object files in the above-mentioned file set; and further includes: an acquisition subunit, used to acquire the configured second file name at the same time as the object files determined from the above-mentioned files.
[0015] As an optional implementation, it further includes: a second acquisition module, configured to acquire a first adjustment instruction when, during the modification of the file name of the object file in the file set from the first file name to the second file name, at least one of the object files has the same name as a file under the target level directory, wherein the same name indicates that the files have the same file name and the same file extension, and the first adjustment instruction is used to instruct the cessation of name modification of the object files in the file set; a second response module, configured to respond to the first adjustment instruction and acquire the current modification progress when, during the modification of the file name of the object file in the file set from the first file name to the second file name, the current modification progress is used to indicate that name modification of i object files in the object set has been completed, where i is an integer greater than 1 and less than N, and N is the number of object files in the file set; and a stop module, configured to stop name modification of the (i+1)th to the Nth object files in the object set when, during the modification of the file name of the object file in the file set from the first file name to the second file name.
[0016] As an optional implementation, it further includes: a recovery module, used to restore the file names of the first i object files in the object set to the first file name when the name modification of the (i+1)th to the Nth object files in the object set is stopped.
[0017] As an optional implementation, it further includes: a second determining module, configured to determine at least one object file as the first target object file when the file name of the object file in the file set is changed from the first file name to the second file name, provided that at least one object file has the same name as a file in the target level directory; and a third obtaining module, configured to obtain a second adjustment instruction when the file name of the object file in the file set is changed from the first file name to the second file name, wherein the second adjustment instruction is used to instruct to skip the first target object file and obtain the next object file for name modification.
[0018] As an optional implementation, it further includes: a third determining module, used to determine at least one object file as a second target object file and a file with the same name as a file under the target level directory when the file name of the object file in the file set is changed from the first file name to the second file name; and a fourth obtaining module, used to obtain a third adjustment instruction when the file name of the object file in the file set is changed from the first file name to the second file name, wherein the third adjustment instruction is used to instruct the replacement of the conflicting file with the second target object file.
[0019] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the above-described method for modifying the file name when it is run.
[0020] According to another aspect of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described file name modification method through the computer program.
[0021] In this embodiment of the invention, a first target file whose name is to be modified is determined, wherein the first target file is currently located in a target level directory and its current file name is a first file name; a first operation instruction triggered by performing an operation on the first target file is obtained, wherein the first operation instruction is used to instruct the object file in the file set to perform a name modification operation, wherein the object file in the file set is located in the target level directory and has the same file name as the first target file; in response to the first operation instruction, the file name of the object file in the file set is modified from the first file name to a second file name. By uniformly modifying the names of files located in the target level directory and having the same name, the technical objective of reducing redundant operations in the file name modification process is achieved, thereby improving the technical effect of improving the efficiency of file name modification and solving the technical problem of low file name modification efficiency. Attached Figure Description
[0022] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0023] Figure 1 This is a schematic diagram of the application environment of an optional file name modification method according to an embodiment of the present invention;
[0024] Figure 2 This is a schematic diagram of a flowchart of an optional method for modifying a file name according to an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of an optional method for modifying a file name according to an embodiment of the present invention;
[0026] Figure 4 This is a schematic diagram of another optional method for modifying file names according to an embodiment of the present invention;
[0027] Figure 5 This is a schematic diagram of another optional method for modifying file names according to an embodiment of the present invention;
[0028] Figure 6 This is a schematic diagram of another optional method for modifying file names according to an embodiment of the present invention;
[0029] Figure 7 This is a schematic diagram of another optional method for modifying file names according to an embodiment of the present invention;
[0030] Figure 8 This is a schematic diagram of another optional method for modifying file names according to an embodiment of the present invention;
[0031] Figure 9 This is a schematic diagram of another optional method for modifying file names according to an embodiment of the present invention;
[0032] Figure 10 This is a schematic diagram of a flowchart illustrating another optional method for modifying a file name according to an embodiment of the present invention;
[0033] Figure 11 This is a schematic diagram of a flowchart illustrating another optional method for modifying a file name according to an embodiment of the present invention;
[0034] Figure 12 This is a schematic diagram of an optional file name modification device according to an embodiment of the present invention;
[0035] Figure 13 This is a schematic diagram of another optional file name modification device according to an embodiment of the present invention;
[0036] Figure 14 This is a schematic diagram of another optional file name modification device according to an embodiment of the present invention;
[0037] Figure 15 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. Detailed Implementation
[0038] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0040] According to one aspect of the present invention, a method for modifying a file name is provided. Optionally, as an optional implementation, the above-described method for modifying a file name can be applied to, but is not limited to, [examples of other methods]. Figure 1 The environment shown may include, but is not limited to, user equipment 102, network 110, and server 112. The user equipment 102 may include, but is not limited to, a display 108, a processor 106, and a memory 104.
[0041] The specific process can be summarized in the following steps:
[0042] In step S102, the user equipment 102 determines the first target file whose name is to be modified (the file name at this time is called the first file name 1022) by obtaining the selection operation on the display screen 108, and determines the first operation instruction by obtaining the modification operation performed on the first target file on the display screen 108.
[0043] In steps S104-S106, user equipment 102 sends the first target file and the first operation command to server 112 via network 110;
[0044] In step S108, server 112 searches for a set of files located in the target level directory that have the same file name 1026 as the first target file through database 114, and processes the file names in the file set through processing engine 116 to generate the modification result;
[0045] In steps S110-S112, server 112 sends the modification result to user device 102 via network 110;
[0046] In step S114, the processor 106 in the user equipment 102 modifies the first file name 1022 to the second file name 1024 according to the modification result, displays the modification result on the display 108, and stores the modified file name and corresponding file information in the memory 104. Optionally, the modification result may be generated or stored in the server 112 or the user equipment 102, but is not limited to this step.
[0047] Alternatively, as an alternative implementation method, such as Figure 2 As shown, the methods for changing the file name include:
[0048] S202, determine the first target file whose name is to be modified, wherein the first target file is currently located in the target level directory, and the current file name of the first target file is called the first file name;
[0049] S204, obtain the first operation instruction triggered by the operation performed on the first target file, wherein the first operation instruction is used to instruct the object file in the file set to perform a name modification operation, the object file in the file set is located in the target level directory and has the same file name as the first target file;
[0050] S206, in response to the first operation instruction, change the file name of the object file in the file set from the first file name to the second file name.
[0051] Optionally, in this embodiment, the method for modifying file names can be applied, but is not limited to, in scenarios where multiple files with the same name are renamed in batches to become files with the same name under another name. The file name can include, but is not limited to, the filename and extension. Optionally, in this embodiment, the filename can be, but is not limited to, the filename. Files under the target directory level can have, but are not limited to, the same filename.
[0052] It should be noted that: First, the target file whose name is to be modified is determined, wherein the first target file is currently located in the target level directory, and the current filename of the first target file is the first filename; a first operation instruction triggered by performing an operation on the first target file is obtained, wherein the first operation instruction is used to instruct the object files in the file set to perform a name modification operation, the object files in the file set are located in the target level directory, and have the same filename as the first target file; in response to the first operation instruction, the filename of the object files in the file set is changed from the first filename to the second filename.
[0053] Further examples, optional, such as Figure 3As shown, the system includes an interactive interface 302 for detecting operation execution, a first target file 304, and other files belonging to the same target level directory 306 as the first target file 304. The filenames of the first target file 304 and the other files are both the first filename, and together they form a file set 305. The specific steps are as follows: Step S302: Obtain the first operation instruction (not shown in the figure) triggered by performing an operation on the first target file 304 (selecting the first target file 304), and in response to the execution of the first operation, change the filename of the files in the file set 308 from the first filename to the second filename.
[0054] The embodiments provided in this application determine a first target file whose name needs to be modified. The first target file is currently located in a target-level directory and its current filename is a first filename. A first operation instruction triggered by performing an operation on the first target file is obtained. This first operation instruction instructs the execution of a name modification operation on object files in a file set, where the object files are located in the target-level directory and have the same filename as the first target file. In response to the first operation instruction, the filename of the object files in the file set is modified from the first filename to a second filename. By uniformly modifying the names of files located in the target-level directory and having the same name, the technical objective of reducing redundant operations in the filename modification process is achieved, thereby improving the efficiency of filename modification.
[0055] As an optional approach, obtaining the first operation instruction triggered by performing an operation on the first target file includes:
[0056] S1, obtain the second operation instruction triggered by the operation performed on the first target file, wherein the second operation instruction is used to request all files in the target level directory that have the same file name as the first target file;
[0057] S2, responding to the second operation command, displays all files;
[0058] S3 identifies the object file in the file set from all files and generates the first operation instruction based on the file set.
[0059] It should be noted that the second operation instruction triggered by the operation performed on the first target file is obtained. The second operation instruction is used to request all files in the target level directory that have the same file name as the first target file; in response to the second operation instruction, all files are displayed; the object file in the file set is determined from all files, and the first operation instruction is generated based on the file set.
[0060] Further examples, optional, such as Figure 4As shown, a command list 402 is included to control the execution of corresponding command instructions on the selected first target file 304 whose name is to be modified. Optionally, as shown in the figure, the command list 402 includes multiple executable commands such as "Open on the side", "Select for comparison", "Cut", "Copy", "Copy path", "Copy relative path", "Rename the file with the same name as "logs" in the same directory", and "Delete". The specific steps are as follows: Step S402, obtain the second operation instruction triggered by the operation performed on the first target file (selecting "Rename the file with the same name as "logs" in the same directory" in the command list 402), and respond to the second operation instruction by displaying all files (all files in the file set 308).
[0061] The embodiments provided in this application obtain a second operation instruction triggered by performing an operation on a first target file. The second operation instruction is used to request all files in the target level directory that have the same file name as the first target file. In response to the second operation instruction, all files are displayed. The object file in the file set is determined from all files, and a first operation instruction is generated based on the file set. This achieves the purpose of selecting multiple files to execute the command together, thereby improving the efficiency of command execution.
[0062] As an alternative solution,
[0063] S1, The object files in the file set are determined from all files, including the files selected from the configuration items corresponding to each of the files, which are used as object files in the file set;
[0064] S2, in addition to determining the object file from all files, also includes: obtaining the configured second file name.
[0065] It should be noted that determining the object files in the file set from all files includes: selecting the files that are checked in the corresponding configuration items of all files as object files in the file set; in addition to determining the object files from all files, it also includes: obtaining the configured second file name.
[0066] Further examples, optional, such as Figure 5 As shown, the interface includes an interactive interface 502 for obtaining operation signals, and multiple files (i.e., all files with the same name) in a file set 510 under the target directory 504. The original file name "logs" is the first file name 506, and the renamed file name "Test" is the second file name 508. The specific steps are as follows: Select the files (shaded) from the configuration items corresponding to each file, and use them as object files in the file set 510, and obtain the configured second file name 508.
[0067] The embodiments provided in this application determine the object files in the file set from all files by selecting the files corresponding to the configuration items of each of all files as the object files in the file set. In addition to determining the object files from all files, the method also includes obtaining the configured second file name, thereby achieving the purpose of selectively modifying file names in batches and improving the flexibility of file modification.
[0068] As an optional approach, when changing the filename of the object file in the file collection from the first filename to the second filename, the following is also included:
[0069] S1, if at least one object file has the same name as a file in the target level directory, obtain a first adjustment instruction, wherein the same name indicates that the files have the same file name and the same file extension, and the first adjustment instruction is used to indicate to stop renaming the object files in the file set;
[0070] S2, respond to the first adjustment instruction and obtain the current modification progress, where the current modification progress is used to indicate that the name modification of i object files in the object set has been completed, i is an integer greater than 1 and less than N, and N is the number of object files in the file set;
[0071] S3, stop renaming the (i+1)th to Nth object files in the object set.
[0072] It should be noted that, if at least one object file has the same name as a file in the target level directory, a first adjustment instruction is obtained. Here, "same name" indicates that the files have the same filename and the same file extension. The first adjustment instruction instructs the cessation of name modification on the object files in the file set. In response to the first adjustment instruction, the current modification progress is obtained, indicating that name modification has been completed on the i object files in the object set, where i is an integer greater than 1 and less than N, and N is the number of object files in the file set. Name modification is then stopped on the (i+1)th to the Nth object files in the object set. Optionally, N is a positive integer greater than or equal to 1. Optionally, the filename can be, but is not limited to, the filename, where the filename and file extension can, but are not limited to, jointly constitute the filename, and the filename can, but is not limited to, be used to distinguish different files on the computer.
[0073] Further examples, optional, such as Figure 6 As shown, this includes a prompt box 602 for indicating "A file with the same name already exists in the same directory," where optional options include... Figure 6As shown, the message "A file named 'logs.js' already exists in the same directory, replace the existing file" is recorded. In prompt box 602, there is also a location for detecting adjustment instructions, with options as shown in the figure, such as "Stop," "Skip," and "Replace." The specific steps are as follows: Step S602, obtain the file name modification operation instruction (e.g., the instruction to change the first file name to the second file name); Step S604, obtain the first adjustment instruction (shaded "Stop"), where the first adjustment instruction is used to indicate stopping the name modification of object files in the file collection (e.g., stopping the instruction to change the first file name to the second file name).
[0074] Through the embodiments provided in this application, when at least one object file has the same name as a file under the target level directory, a first adjustment instruction is obtained, wherein "same name" indicates that the files have the same file name and the same file extension. The first adjustment instruction is used to instruct the cessation of name modification on the object files in the file set. In response to the first adjustment instruction, the current modification progress is obtained, wherein the current modification progress indicates that name modification has been completed on the i object files in the object set, where i is an integer greater than 1 and less than N, and N is the number of object files in the file set. Name modification is stopped on the (i+1)th to the Nth object files in the object set. This achieves the purpose of stopping name modification on the object files in the file set when the first adjustment instruction is obtained, thereby improving the flexibility of file name modification.
[0075] As an optional approach, when stopping name modification of the (i+1)th to Nth object files in the object collection, the following is also included:
[0076] Restore the filenames of the first i object files in the object collection to the first filename.
[0077] It should be noted that the filenames of the first i object files in the object set are restored to the first filename.
[0078] To further illustrate, an alternative example is that when renaming the (i+1)th to the Nth object files in the object set is stopped, the file names of the first i object files in the object set are restored to the first file name. In other words, the files whose names have been modified will not be renamed, but will retain their previous names, and all renaming operations will end prematurely.
[0079] The embodiments provided in this application restore the file names of the first i object files in the object set to the first file name, thereby achieving the purpose of ending the name modification operation when modification stops, and improving the efficiency of file name modification.
[0080] As an optional approach, when changing the filename of the object file in the file collection from the first filename to the second filename, the following is also included:
[0081] S1, if at least one object file has the same name as a file in the target level directory, determine at least one object file as the first target object file;
[0082] S2, obtain the second adjustment instruction, wherein the second adjustment instruction is used to indicate skipping the first target object file and obtaining the next object file for name modification.
[0083] It should be noted that if at least one object file has the same name as a file in the target level directory, at least one object file is identified as the first target object file; a second adjustment instruction is obtained, wherein the second adjustment instruction is used to indicate that the first target object file is skipped and the next object file is obtained for name modification.
[0084] Further examples, optional, such as Figure 7 As shown, the specific steps are as follows: Step S702, obtain the file name modification operation instruction (e.g., the modification operation instruction to change the first file name to the second file name); Step S704, obtain the second adjustment instruction (shaded "skip"), wherein the second adjustment instruction is used to indicate skipping the name modification of the object file in the file set (e.g., skipping the name modification of the object file and continuing the modification operation instruction of changing the first file name to the second file name of other files in the file set).
[0085] Through the embodiments provided in this application, when at least one object file has the same name as a file under the target level directory, at least one object file is identified as the first target object file; a second adjustment instruction is obtained, wherein the second adjustment instruction is used to instruct to skip the first target object file and obtain the next object file for name modification, thereby achieving the purpose of skipping the name modification of the object file and continuing to modify the file names of other files in the file set when the file name modification operation instruction is obtained, thus improving the efficiency of file name modification.
[0086] As an optional approach, when changing the filename of the object file in the file collection from the first filename to the second filename, the following is also included:
[0087] S1, if at least one object file has the same name as a file in the target level directory, determine at least one object file as the second target object file, and the file with the same name as the second target object file as the conflicting file;
[0088] S2, obtain the third adjustment instruction, wherein the third adjustment instruction is used to instruct the replacement of the conflicting file with the second target object file.
[0089] It should be noted that if at least one object file has the same name as a file in the target level directory, at least one object file is identified as the second target object file, and the file with the same name as the second target object file is identified as the conflicting file; a third adjustment instruction is obtained, wherein the third adjustment instruction is used to instruct the second target object file to replace the conflicting file.
[0090] Further examples, optional, such as Figure 8 As shown, the specific steps are as follows: Step S802, obtain the file name modification operation instruction (e.g., the modification operation instruction to change the first file name to the second file name); Step S804, obtain the third adjustment instruction (shaded "replace"), wherein the third adjustment instruction is used to instruct the object files in the file collection to modify their names and replace the files with the same name (file main name, e.g. "logs") and the same type (file extension, e.g. "js") with the modified names.
[0091] Through the embodiments provided in this application, when at least one object file has the same name as a file under the target level directory, at least one object file is identified as a second target object file, and the file with the same name as the second target object file is identified as a conflicting file; a third adjustment instruction is obtained, wherein the third adjustment instruction is used to instruct the second target object file to replace the conflicting file, thereby achieving the purpose of replacing the file with the same name after the name has been modified, and realizing the effect of improving the flexibility of file modification.
[0092] As an optional approach, the first target file whose name is to be changed includes:
[0093] S1, Display the editor directory tree corresponding to the target folder, wherein the target folder contains at least the first target file;
[0094] S2, determine the first target file in the editor's directory tree.
[0095] It should be noted that the editor's directory tree corresponding to the target folder is displayed, and the target folder must contain at least the first target file; the first target file is identified in the editor's directory tree.
[0096] Further examples, optional, such as Figure 9As shown, the interface includes a target folder 902 displayed on the interactive interface and an editor directory tree 904. The editor directory tree 904 of the target folder 902 includes a first target file 304 and other files with the same name. The specific steps are as follows: Step S902, the first target file 304 is determined in the editor directory tree 904. Optionally, but not limited to, the determination operation can be triggered by the right or left arrow as shown in the figure.
[0097] The embodiments provided in this application display the editor directory tree corresponding to the target folder, wherein the target folder includes at least a first target file; the first target file is determined in the editor directory tree, thereby achieving the purpose of accurately determining the first target file in the editor directory tree and realizing the effect of accurate determination of the first target file.
[0098] Alternatively, as an alternative implementation, for example Figure 10 The specific front-end application scenario shown below, with the following steps:
[0099] Step S1002: Detect the right-click selection signal at the location of the target file in the interactive interface.
[0100] Step S1004: Determine whether there is a set of files with the same name in the same directory as the target file;
[0101] In step S1006, the command option "Rename the file with the same name" is displayed at the location of the target file in the interactive interface. If yes, proceed to step S1008; otherwise, proceed to step S1010.
[0102] Step S1008: Detect the operation signal at the command option location and obtain all files that will be modified and their renames;
[0103] Step S1010: Perform a renaming operation to change the original name of the target file to the renamed name.
[0104] Alternatively, as an alternative implementation, for example Figure 11 The specific front-end application scenario shown below, with the following steps:
[0105] Step S1102: Perform the renaming operation;
[0106] Step S1104: Determine whether the renamed file conflicts with the existing file. If yes, proceed to step S1106; otherwise, proceed to step S1110.
[0107] Step S1106: Display a prompt pop-up window, which is used to trigger the processing signal for the conflicting file;
[0108] Step S1108: Process the conflicting files according to the processing signal;
[0109] Step S1110: Perform the renaming operation.
[0110] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0111] According to another aspect of the present invention, a file name modification apparatus for implementing the above-described file name modification method is also provided. For example... Figure 12 As shown, the device includes:
[0112] The determining unit 1202 is used to determine the first target file whose name is to be modified, wherein the first target file is currently located in the target level directory, and the current file name of the first target file is called the first file name;
[0113] The acquisition unit 1204 is used to acquire a first operation instruction triggered by performing an operation on the first target file, wherein the first operation instruction is used to instruct to perform a name modification operation on the object files in the file set, the object files in the file set are located in the target level directory and have the same file name as the first target file;
[0114] The response unit 1206 is used to respond to the first operation instruction and change the file name of the object file of the file set from the first file name to the second file name.
[0115] Optionally, in this embodiment, the file name modification device can be applied, but is not limited to, in scenarios where multiple files with the same name are renamed in batches to become files with the same name under another name. The file name can include, but is not limited to, a filename and an extension. Optionally, in this embodiment, the filename can be, but is not limited to, the filename. The filenames of files under the target directory can be, but are not limited to, the same (files with the same name).
[0116] It should be noted that: First, the target file whose name is to be modified is determined, wherein the first target file is currently located in the target level directory, and the current filename of the first target file is the first filename; a first operation instruction triggered by performing an operation on the first target file is obtained, wherein the first operation instruction is used to instruct the object files in the file set to perform a name modification operation, the object files in the file set are located in the target level directory, and have the same filename as the first target file; in response to the first operation instruction, the filename of the object files in the file set is changed from the first filename to the second filename.
[0117] For specific implementation examples, please refer to the example shown in the above-mentioned method for modifying the file name; these examples will not be repeated here.
[0118] The embodiments provided in this application determine a first target file whose name needs to be modified. The first target file is currently located in a target-level directory and its current filename is a first filename. A first operation instruction triggered by performing an operation on the first target file is obtained. This first operation instruction instructs the execution of a name modification operation on object files in a file set, where the object files are located in the target-level directory and have the same filename as the first target file. In response to the first operation instruction, the filename of the object files in the file set is modified from the first filename to a second filename. By uniformly modifying the names of files located in the target-level directory and having the same name, the technical objective of reducing redundant operations in the filename modification process is achieved, thereby improving the efficiency of filename modification.
[0119] As an optional solution, the acquisition unit 1204 includes:
[0120] The first acquisition module 1302 is used to acquire a second operation instruction triggered by performing an operation on the first target file, wherein the second operation instruction is used to request the acquisition of all files in the target level directory that have the same file name as the first target file;
[0121] The first response module 1304 is used to respond to the second operation command and display all files;
[0122] The first determining module 1306 is used to determine the object file in the file set from all files and generate a first operation instruction based on the file set.
[0123] For specific implementation examples, please refer to the example shown in the above-mentioned method for modifying the file name; these examples will not be repeated here.
[0124] As an optional solution, the first determining module includes: a checkbox subunit, used to select the files that are checked in the configuration items corresponding to each of all files, as object files in the file set;
[0125] It also includes: a sub-unit for obtaining the configured second file name while determining the object file from all files.
[0126] For specific implementation examples, please refer to the example shown in the above-mentioned method for modifying the file name; these examples will not be repeated here.
[0127] As an optional solution, it also includes:
[0128] The second acquisition module is used to acquire a first adjustment instruction when, during the modification of the file name of the object file in the file set from the first file name to the second file name, at least one object file has the same name as a file in the target level directory. The same name indicates that the files have the same file name and the same file extension. The first adjustment instruction is used to indicate that the name modification of the object file in the file set is stopped.
[0129] The second response module is used to respond to the first adjustment instruction and obtain the current modification progress when the file name of the object file in the file set is changed from the first file name to the second file name. The current modification progress is used to indicate that the name modification of i object files in the object set has been completed, where i is an integer greater than 1 and less than N, and N is the number of object files in the file set.
[0130] The stop module is used to stop renaming the (i+1)th to Nth object files in the object set when the file name of the object file in the file set is changed from the first file name to the second file name.
[0131] For specific implementation examples, please refer to the example shown in the above-mentioned method for modifying the file name; these examples will not be repeated here.
[0132] As an optional solution, it also includes:
[0133] The recovery module is used to restore the file names of the first i object files in the object set to the first file name when the renaming of the (i+1)th to the Nth object files in the object set is stopped.
[0134] For specific implementation examples, please refer to the example shown in the above-mentioned method for modifying the file name; these examples will not be repeated here.
[0135] As an optional solution, it also includes:
[0136] The second determining module is used to determine at least one object file as the first target object file when the file name of the object file of the file set is changed from the first file name to the second file name, and at least one object file has the same name as a file under the target level directory.
[0137] The third acquisition module is used to acquire a second adjustment instruction when the file name of the object file in the file set is changed from the first file name to the second file name. The second adjustment instruction is used to indicate that the first target object file should be skipped and the next object file should be acquired for name modification.
[0138] For specific implementation examples, please refer to the example shown in the above-mentioned method for modifying the file name; these examples will not be repeated here.
[0139] As an optional solution, it also includes:
[0140] The third determination module is used to determine, when the file name of the object file of the file set is changed from the first file name to the second file name, that at least one object file has the same name as a file under the target level directory, at least one object file is the second target object file, and the file with the same name as the second target object file is the conflicting file.
[0141] The fourth acquisition module is used to acquire a third adjustment instruction when the file name of the object file in the file set is changed from the first file name to the second file name. The third adjustment instruction is used to instruct the conflicting file to be replaced with the second target object file.
[0142] For specific implementation examples, please refer to the example shown in the above-mentioned method for modifying the file name; these examples will not be repeated here.
[0143] As an optional solution, the determining unit 1202 includes:
[0144] Display module 1402 is used to display the editor directory tree corresponding to the target folder, wherein the target folder includes at least the first target file;
[0145] The fourth determination module 1404 is used to determine the first target file in the editor's directory tree.
[0146] For specific implementation examples, please refer to the example shown in the above-mentioned method for modifying the file name; these examples will not be repeated here.
[0147] According to another aspect of the present invention, an electronic device for implementing the above-described method for modifying document names is also provided, such as... Figure 15As shown, the electronic device includes a memory 1502 and a processor 1504. The memory 1502 stores a computer program, and the processor 1504 is configured to execute the steps of any of the above method embodiments via the computer program.
[0148] Optionally, in this embodiment, the electronic device may be located in at least one of a plurality of network devices in a computer network.
[0149] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0150] S1, determine the first target file whose name is to be modified, wherein the first target file is currently located in the target level directory, and the current file name of the first target file is called the first file name;
[0151] S2, obtain the first operation instruction triggered by the operation performed on the first target file, wherein the first operation instruction is used to instruct the object file in the file set to perform a name modification operation, the object file in the file set is located in the target level directory and has the same file name as the first target file;
[0152] S3, in response to the first operation instruction, changes the file name of the object file in the file set from the first file name to the second file name.
[0153] Alternatively, as those skilled in the art will understand, Figure 15 The structure shown is for illustrative purposes only. The electronic device can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile internet device (MID), a PAD, and other terminal devices. Figure 15 This does not limit the structure of the aforementioned electronic device. For example, the electronic device may also include components that are more... Figure 15 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 15 The different configurations shown.
[0154] The memory 1502 can be used to store software programs and modules, such as the program instructions / modules corresponding to the file name modification method and apparatus in this embodiment of the invention. The processor 1504 executes various functional applications and data processing by running the software programs and modules stored in the memory 1502, thereby implementing the aforementioned file name modification method. The memory 1502 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1502 may further include memory remotely located relative to the processor 1504, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1502 may be used, but is not limited to, to store information such as a first file name, a first operation instruction, and a second file name. As an example, such as... Figure 15 As shown, the memory 1502 may include, but is not limited to, the determining unit 1202, the acquiring unit 1204, and the responding unit 1206 in the file name modification device. Furthermore, it may include, but is not limited to, other module units in the file name modification device, which will not be elaborated upon in this example.
[0155] Optionally, the transmission device 1506 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1506 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1506 is a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0156] In addition, the above-mentioned electronic device also includes: a display 1508 for displaying information such as the first file name, the first operation command and the second file name; and a connection bus 1510 for connecting the various module components in the above-mentioned electronic device.
[0157] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0158] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store a computer program for performing the following steps:
[0159] S1, determine the first target file whose name is to be modified, wherein the first target file is currently located in the target level directory, and the current file name of the first target file is called the first file name;
[0160] S2, obtain the first operation instruction triggered by the operation performed on the first target file, wherein the first operation instruction is used to instruct the object file in the file set to perform a name modification operation, the object file in the file set is located in the target level directory and has the same file name as the first target file;
[0161] S3, in response to the first operation instruction, changes the file name of the object file in the file set from the first file name to the second file name.
[0162] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0163] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0164] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0165] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0166] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0167] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0168] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0169] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for modifying a file name, characterized in that, include: Determine the first target file whose name is to be modified, wherein the first target file is currently located in the target level directory, and the current file name of the first target file is called the first file name; If a file with the same name as the first target file exists in the target level directory, the second operation instruction is used to obtain all files in the target level directory that have the same file name as the first target file, and the files selected in the configuration items corresponding to each of the files are taken as object files in the file set. Obtain the second file name, and modify the file name of the object file in the file set from the first file name to the second file name through the first operation instruction.
2. The method according to claim 1, characterized in that, When modifying the file name of the object file in the file set from the first file name to the second file name, the method further includes: If at least one of the object files has the same name as a file under the target level directory, a first adjustment instruction is obtained, wherein the same name indicates that the files have the same file name and the same file extension, and the first adjustment instruction is used to instruct to stop the name modification of the object files in the file set; In response to the first adjustment instruction, the current modification progress is obtained, wherein the current modification progress is used to indicate that the name modification of i object files in the object set has been completed, i is an integer greater than 1 and less than N, and N is the number of object files in the file set; Stop renaming the (i+1)th to Nth object files in the object set.
3. The method according to claim 2, characterized in that, When stopping the renaming of the (i+1)th to Nth object files in the object set, the method further includes: Restore the filenames of the first i object files in the object set to the first filename.
4. The method according to claim 1, characterized in that, When modifying the file name of the object file in the file set from the first file name to the second file name, the method further includes: If at least one of the object files has the same name as a file under the target level directory, then at least one of the object files is identified as the first target object file. Obtain a second adjustment instruction, wherein the second adjustment instruction is used to instruct to skip the first target object file and obtain the next object file for name modification.
5. The method according to claim 1, characterized in that, When modifying the file name of the object file in the file set from the first file name to the second file name, the method further includes: If at least one of the object files has the same name as a file under the target level directory, at least one of the object files is identified as a second target object file, and the file with the same name as the second target object file is identified as a conflicting file. Obtain a third adjustment instruction, wherein the third adjustment instruction is used to instruct the conflicting file to be replaced with the second target object file.
6. The method according to any one of claims 1 to 5, characterized in that, The first target file for determining the name to be modified includes: Display the editor's directory tree corresponding to the target folder, wherein the target folder includes at least the first target file; The first target file is located in the editor's directory tree.
7. A device for modifying file names, characterized in that, include: The determining unit is used to determine the first target file whose name is to be modified, wherein the first target file is currently located in the target level directory, and the current file name of the first target file is called the first file name; The acquisition unit is used to, when there is a file with the same name as the first target file in the target level directory, acquire all files with the same file name as the first target file in the target level directory through a second operation instruction, and take the files selected in the configuration items corresponding to each of the files as object files in the file set; The response unit is used to obtain the second file name and, through a first operation instruction, modify the file name of the object file in the file set from the first file name to the second file name.
8. The apparatus according to claim 7, characterized in that, Also includes: The second acquisition module is used to acquire a first adjustment instruction when, during the modification of the file name of the object file in the file set from the first file name to the second file name, at least one of the object files has the same name as a file under the target level directory, wherein the same name indicates that the files have the same file name and the same file extension, and the first adjustment instruction is used to instruct to stop modifying the name of the object file in the file set; The second response module is used to respond to the first adjustment instruction and obtain the current modification progress when the file name of the object file in the file set is changed from the first file name to the second file name. The current modification progress is used to indicate that the name modification of i object files in the object set has been completed, where i is an integer greater than 1 and less than N, and N is the number of object files in the file set. The stop module is used to stop renaming the (i+1)th to the Nth object files in the object set when the file name of the object file in the file set is changed from the first file name to the second file name.
9. The apparatus according to claim 8, characterized in that, Also includes: The recovery module is used to restore the file names of the first i object files in the object set to the first file name when the name modification of the (i+1)th to the Nth object files in the object set is stopped.
10. A computer-readable storage medium comprising a stored program, wherein, When the program is run, it executes the method described in any one of claims 1 to 6.
11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 6 through the computer program.