Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, shall fall within the scope of protection of the present application.
Fig. 1 is a flowchart of a file naming method provided in an embodiment of the present application. In this embodiment, the file naming method includes the following steps:
s110: and when detecting that a new file is added under a target path, acquiring file names of at least two files under the target path.
In this document, the file naming method may be implemented on any form of terminal device, and the terminal device may be, for example, a Personal Computer (PC), a portable computer, a smart phone, a tablet computer (PAD), or the like as an execution subject of the file naming method.
The target path may be a storage path after the user downloads the file, may also be a storage path after synchronizing the file, and may also be a storage path after the file is transferred.
The files may be used interchangeably herein to refer to documents (e.g., word, txt, excel, pdf, etc.), images, audio, video, or any other form of file that may be present in a computer-based environment.
S120: it is identified whether the file names have the same naming rule therebetween.
And the terminal equipment identifies whether the file names have the same naming rule or not by analyzing the file names of the at least two files.
Specifically, the step S120: identifying whether the file names have the same naming rule may include:
and identifying whether a naming rule of numerical inference exists between the file names.
In this embodiment, the numerical reasoning is named according to a numerical sequence, that is, the terminal device identifies whether there is a rule in the numerical sequence between the file names. . For example, the first file name is "xx 01", the second file name is "xx 02", and since there is a rule that numerical values increase progressively between "01" and "02", the terminal device can recognize that there is a naming rule of numerical value inference between the file names, and the naming rule is "xx" and then adds numerical values.
Specifically, the step S120: identifying whether the file names have the same naming rule may include:
naming rules identifying whether letter inferences exist between the file names.
In this embodiment, the letter inference is named according to the letter sequence, that is, the terminal device identifies whether there is a rule in the letter sequence between the file names. For example, the first file name is "monkey a", the second file name is "monkey b", and since there is a rule in alphabetical order for "a" and "b", the terminal device can recognize that there is a naming rule deduced by letters between the file names, and the naming rule is "monkey" followed by letters.
S130: and if the file names have the same naming rule, changing the file name which does not accord with the naming rule in the original file under the target path into the file name which accords with the naming rule according to the naming rule.
The original file is a file existing before a new file is added under the condition of detecting a target path, namely, a file in the target path except the new file.
Some scenarios are listed below for illustration. The embodiment of the application can be applied to a file downloading scene, and the file name of an original file under a downloaded storage path (target path) is as follows: monkey, Monkey001, assume that the user downloaded the file with the file name Monkey002 to the storage path. When detecting that the file Monkey002 is newly added under the storage path, the terminal device acquires the file name of the file under the storage path as follows: monkey, Monkey001, Monkey002, further identify whether there are the same naming rules between the filenames, because the naming rule of filename "Monkey" is only Chinese, "Monkey" plus value "001" is the naming rule of English, "Monkey" plus value "001" is the naming rule of filename "Monkey 002" is English, "Monkey" plus value "002"; so it is recognized that "Monkey 001" and "Monkey 002" have the same naming convention, i.e., English "Monkey" plus a numerical value. The file name which does not accord with the naming rule in the original file under the storage path is only 'Monkey', so the file name 'Monkey' can be changed into the file name 'Monkey 003' which accords with the naming rule according to the naming rule. Thus, the file names of the files under the storage path are: monkey001, Monkey002, Monkey 003.
The embodiment of the application can also be applied to a synchronous file scene, including the synchronization of a file from a first terminal to a second terminal, or the synchronization of a file from a server to a terminal, and the like. The synchronization file may be considered to be a file on the a device copied to the B device. For example, the file names of the files in the mobile phone (first terminal) are: "Monkey", "Monkey 001", and "Monkey 002", if the user synchronizes the above three files in the mobile phone to the PAD (second terminal), and each time a file is synchronized, the PAD can detect the newly added file in the storage path, thereby executing steps S110 to S130. After synchronizing the files with the first file name 'monkey', the subsequent steps can not be executed because only one file exists in the storage path; after synchronizing the file with the second file name Monkey001, the subsequent steps cannot be executed because the file names Monkey and Monkey do not have the same naming rule; after synchronizing the files of the third file name "Monkey 002", since "Monkey 001" and "Monkey 002" have the same naming rule, that is, the english "Monkey" is added with a numerical value, the file name which does not conform to the naming rule in the original file under the storage path is only "Monkey", so that the file name "Monkey" can be changed into the file name "Monkey 003" which conforms to the naming rule according to the naming rule. Thus, the file names of the files under the storage path are: monkey001, Monkey002, Monkey 003. Similarly, for the example of synchronizing the file from the server to the terminal, the description is omitted here, similarly to the above example.
The embodiment of the application can also be applied to a file transfer scene, including transferring files from different paths. The different paths may be on the same device or on different devices. For example, files are copied from a USB flash disk to a personal computer, or files are copied or cut from the A folder of the personal computer to the B folder of the personal computer. For example, the file names of files existing in the usb disk include: "Monkey", "Monkey 001", and "Monkey 002", if the user transfers the above three files from the usb disk to the personal computer, the personal computer can detect the newly added file at the storage distance every time transferring one file, so as to execute steps S110 to S130. After transferring the file with the first file name 'monkey', because only one file exists in the storage path, the subsequent steps can not be executed; after the file with the second file name 'Monkey 001' is transferred, because the file names 'Monkey' and 'Monkey 001' do not have the same naming rule, the subsequent steps cannot be executed; after the file with the third file name "Monkey 002" is transferred, "Monkey 001" and "Monkey 002" have the same naming rule, that is, the addition of a numerical value to english "Monkey", the file name that does not conform to the naming rule in the original file in the storage path is only "Monkey", so that the file name "Monkey" can be changed to the file name "Monkey 003" that conforms to the naming rule according to the naming rule. Thus, the file names of the files under the storage path are: monkey001, Monkey002, Monkey 003. Similarly, for the example of copying or cutting files from the folder a of the personal computer to the folder B of the personal computer, the description is omitted here, similarly to the above example.
In practical applications, if there are multiple filenames that do not comply with the naming convention, the filenames that are modified to comply with the naming convention may be random.
In any of the scenarios described above, it is assumed that there is a file with the file name "XX" in addition to files with file names "Monkey", "Monkey 001", and "Monkey 002". Thus, the file names which do not conform to the naming rule are two, namely 'monkey' and 'XX'; then both file names are changed to file names that comply with the naming rules. Specifically, the method may be random, that is, the "Monkey" may be changed to "Monkey 003", "XX" may be changed to "Monkey 004", or the "Monkey" may be changed to "Monkey 004", and "XX" may be changed to Monkey003 ".
It should be noted that, for the newly added file in the target path, the file name may also be changed according to the obtained naming rule. For example, in a scenario of downloading a file, if the file name of the downloaded file does not meet the naming rule, the terminal device may change the file name of the downloaded file to the file name meeting the naming rule.
In a scene of downloading a file, the file to be downloaded is usually named when the file is downloaded, and in this embodiment, the file to be downloaded may be directly named as a file name that meets the naming rule according to the obtained naming rule. According to the embodiment, the terminal equipment identifies that the file names of the files under the target path have the same naming rule, and then changes the file names which do not accord with the naming rule into the file names which accord with the naming rule according to the naming rule. Therefore, the user does not need to manually change the file names of the files which do not accord with the naming rule one by one under the condition of entering the file directory, the efficiency of changing the file names is improved, and the user experience is improved.
In a specific embodiment of the present application, in the step S130, changing a file name of the original file in the target path that does not meet the naming rule into a file name that meets the naming rule according to the naming rule may specifically include:
and changing the file names which do not accord with the naming rule in the original files under the target path into the file names which accord with the naming rule according to the creation time sequence.
In this embodiment, the creation time may be the creation time of the file. The creation time is early, preceding in chronological order, the creation time is late, and following in chronological order. For example, the first time is 20 minutes 00 seconds at 22 o 'clock 1 month 1 day 2016 and the second time is 20 minutes 00 minutes at 22 o' clock 1 month 1 day 2016, and since the second time is earlier than the first time, the second time is chronologically before the first time.
Still follow the above example, that is, there exist files with file names "Monkey", "Monkey 001", "Monkey 002" and "XX" in the storage path, and after a file is newly added, the file names that do not conform to the naming rule in the original file in the storage path are "Monkey" and "XX". If the creation time of "Monkey" precedes "XX", then the filename "Monkey" can be changed to "Monkey 003" and the filename "XX" to "Monkey 004" according to the naming rules; on the contrary, if the creation time of "XX" precedes "Monkey, the file name" XX "can be changed to" Monkey003 "and the file name" Monkey "to" Monkey004 "according to the naming rule.
The embodiment is different from the previous embodiment in that the sequence of changing a plurality of file names which do not conform to the naming rule can be controlled by the creation time.
As shown in fig. 2, in a specific embodiment of the present application, the step S110 of obtaining file names of at least two files in the target path may specifically include the following steps:
s111: and acquiring file names of at least two files meeting preset conditions under the target path.
Correspondingly, the step S130 may specifically include:
s131: and if the file names have the same naming rule, changing the file names which do not accord with the naming rule in the original files which accord with the preset conditions under the target path into the file names which accord with the naming rule according to the naming rule.
In practical applications, a user does not necessarily want to change all file names under the target path that do not meet the naming rules. For example, a user of a file downloaded long before the target path does not want to change the file name, but only wants to change the file that does not meet the naming rules during the downloading process. Therefore, in the present embodiment, the application range of the present embodiment to the file under the target path is limited by the preset condition.
The preset condition may include at least one of newly increased in a preset time length and newly increased in the current startup. Specifically, the preset time period may be an empirical value set by a human. For example, file names of at least two newly added files within half an hour (preset duration) next to the target path are obtained.
According to the embodiment, the preset condition is set to limit the application range of the file naming method for changing the file name of the file under the target path, and the file name of the file which does not accord with the preset condition can not be changed even if the file does not accord with the naming rule.
As shown in fig. 3, in a specific embodiment of the present application, after the step S120 and before the step S130, the following steps may be further included:
s121: and if the file names have the same naming rule, judging whether a change instruction generated by triggering the confirmation button is received.
In practical application, the file name which does not accord with the naming rule in the original file under the target path is directly changed into the file name which accords with the naming rule according to the naming rule, and the user usually generates a conflicting emotion without being selected and determined by the user, so that the user experience is reduced. In this embodiment, after recognizing that the file names have the same naming rule, the terminal device may output a determination button at a preset position on the screen to prompt the user. If the user clicks the ok button, it is considered that the user agrees to change the file name that does not comply with the naming rule, and a change instruction is generated.
Correspondingly, the step S130 may specifically include:
s132: and if a change instruction generated by triggering the confirmation button is received, changing the file name which does not accord with the naming rule in the original file under the target path into the file name which accords with the naming rule according to the naming rule.
And after receiving a change instruction generated by triggering the determined button, the terminal equipment changes the file name which does not accord with the naming rule in the original file under the target path into the file name which accords with the naming rule according to the naming rule.
According to the embodiment, after the same naming rule is identified among the file names, the file names which do not accord with the naming rule are not directly changed, but the file names which do not accord with the naming rule can be changed only by receiving the change instruction generated after the user clicks the confirmation button. Therefore, the user experience can be improved, and the problem that the file name which does not accord with the naming rule is directly changed by the terminal equipment when the user does not want to change the file name is solved.
The embodiments of the present application also provide an apparatus, which can implement the above method steps, and the apparatus can be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, the logical device is formed by reading a corresponding computer program instruction into a memory by a Central Processing Unit (CPU) of a server to run.
Fig. 4 is a block diagram of a file naming apparatus according to an embodiment of the present application. In this embodiment, the file naming apparatus includes:
the obtaining unit 210 is configured to obtain file names of at least two files in a target path when a newly added file in the target path is detected;
an identifying unit 220 that identifies whether the file names have the same naming rule therebetween;
and the naming unit 230 is configured to change the file name which does not conform to the naming rule in the original file under the target path to the file name which conforms to the naming rule according to the naming rule when the file names have the same naming rule.
According to the embodiment, the terminal equipment identifies that the file names of the files under the target path have the same naming rule, and then changes the file names which do not accord with the naming rule into the file names which accord with the naming rule according to the naming rule. Therefore, the user does not need to manually change the file names of the files which do not accord with the naming rule one by one under the condition of entering the file directory, the efficiency of changing the file names is improved, and the user experience is improved.
Preferably, the obtaining unit 210 may specifically include:
the acquisition subunit acquires file names of at least two files meeting preset conditions under the target path;
accordingly, the naming unit 230 may specifically include:
and when the file names have the same naming rule, changing the file names which do not accord with the naming rule in the original files which accord with the preset conditions under the target path into the file names which accord with the naming rule according to the naming rule.
According to the embodiment, the preset condition is set to limit the application range of the file naming device for changing the file name of the file under the target path, and the file name of the file which does not accord with the preset condition can not be changed even if the file does not accord with the naming rule.
Preferably, the preset condition may include at least one of newly increased conditions within a preset time length and newly increased conditions within the current boot.
According to the embodiment, the file name of the file which is not newly added in the preset time length or the file which is not newly added in the starting process cannot be changed even if the file does not accord with the naming rule.
Preferably, the identification unit 220 specifically includes:
the first identification subunit is used for identifying whether a naming rule of numerical inference exists between the file names; wherein, the numerical reasoning is named according to numerical sequence;
or, the second identifying subunit identifies whether a naming rule deduced by letters exists between the file names; where trivial letters are inferred to be named in alphabetical order.
Through the embodiment, the terminal equipment identifies the naming rule of the numerical inference theory or the naming rule of the letter inference existing between the file names under the target path, and then changes the file name which does not conform to the naming rule of the numerical inference or the letter inference into the file name which conforms to the naming rule of the numerical inference or the letter inference according to the naming rule of the numerical inference or the letter inference. Therefore, the user does not need to manually change the file names of the files which do not accord with the naming rule of numerical inference or letter inference one by one under the condition of entering the file directory, the efficiency of changing the file names is improved, and the user experience is improved.
Preferably, the naming unit 230 may specifically include:
and the naming subunit is used for changing the file names which do not accord with the naming rule in the original file under the target path into the file names which accord with the naming rule according to the creating time sequence when the file names have the same naming rule.
The embodiment is different from the previous embodiment in that the sequence of changing a plurality of file names which do not conform to the naming rule can be controlled by the creation time.
Preferably, after the identifying unit 220 and before the naming unit 230, the method further includes:
the confirming unit is used for judging whether a change instruction generated by triggering a confirmation button is received or not when the file names have the same naming rule;
accordingly, the naming unit 230 may specifically include:
and when a change instruction generated by triggering a confirmation button is received, changing the file name which does not accord with the naming rule in the original file under the target path into the file name which accords with the naming rule according to the naming rule.
According to the embodiment, after the same naming rule is identified among the file names, the file names which do not accord with the naming rule are not directly changed, but the file names which do not accord with the naming rule can be changed only by receiving the change instruction generated after the user clicks the confirmation button. Therefore, the user experience can be improved, and the problem that the file name which does not accord with the naming rule is directly changed by the terminal equipment when the user does not want to change the file name is solved.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.