A file location method, computing device and storage medium
By obtaining the first character combination and matching method of the file name's pinyin in the file manager, the problem of not being able to quickly locate Chinese and mixed Chinese and English files in the existing technology is solved, and flexible and efficient file location is achieved.
Patent Information
- Application Number
- CN202210199259.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-02
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-03-02
AI Technical Summary
Existing file managers cannot quickly locate files with Chinese names or mixed Chinese and English names, resulting in low flexibility and failing to meet the needs of most users.
By obtaining the first character of the pinyin corresponding to each Chinese character in the file name and combining them into a file name string, or combining them with English characters into a file name string, the system performs matching and positioning. Combined with user input, the system selects between sequential and reverse matching methods and controls the character interval time to achieve single-character or multi-character matching.
It enables fast matching and location of Chinese and mixed Chinese-English filenames, improving the flexibility and location efficiency of the file manager.
Smart Images

Figure CN114564452B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer and operating system technology, and in particular to a file location method, computing device, and storage medium. Background Technology
[0002] Most mainstream operating system file managers currently offer the ability to quickly locate files by entering single or multiple characters in the file view, avoiding the need to scroll through a file list. However, existing file managers lack the ability to quickly locate files with Chinese names or mixed Chinese and English names, and they don't support precise file location by matching multiple letters in the filename. This results in limited flexibility and applicability for file managers in quickly locating files, failing to meet the needs of most users.
[0003] Therefore, a file location method is needed to solve the problems existing in the above technical solutions. Summary of the Invention
[0004] Therefore, the present invention provides a file location method in an attempt to solve or at least alleviate the problems mentioned above.
[0005] According to one aspect of the present invention, a file location method is provided, executed in a file manager of a computing device, the method comprising the steps of: receiving an operation of inputting a search character in a current file directory, the current file directory including one or more files, the search character being a second feature character; obtaining a filename string corresponding to each file in the current file directory, wherein, for each file whose filename includes a first feature character, each first feature character in the filename is sequentially obtained, and a second feature string corresponding to each first feature character is obtained, the first character of the second feature string corresponding to each first feature character is extracted and combined to obtain a filename string corresponding to the file; matching each filename string with the search character in a predetermined order, and determining the first filename string that matches the search character as the target filename string; and locating the corresponding target file based on the target filename string.
[0006] Optionally, in the file location method according to the present invention, the step of extracting the first character of the second feature string corresponding to each first feature character and combining them to obtain a file name string corresponding to the file includes: for each file whose file name includes the first feature character and the second feature character, extracting the first character of the second feature string corresponding to each first feature character in the file name and combining it with one or more second feature characters in the file name to obtain a file name string corresponding to the file.
[0007] Optionally, in the file location method according to the present invention, the step of obtaining the second feature string corresponding to each first feature character includes: obtaining a dictionary file, wherein each item in the dictionary file includes a unified code and a corresponding second feature string; converting each first feature character into a corresponding unified code, and obtaining the corresponding second feature string from the dictionary file based on the unified code.
[0008] Optionally, in the file location method according to the present invention, before receiving the operation of inputting search characters in the current file directory, the method further includes the step of reading the dictionary file into memory.
[0009] Optionally, in the file location method according to the present invention, receiving the operation of inputting search characters in the current file directory includes: receiving the operation of inputting at least two search characters in the current file directory; and the step of matching each file name string with the search characters in a predetermined order includes: determining the time interval between inputting the first search character and inputting the second search character, and determining whether the time interval exceeds a predetermined duration; if it exceeds the predetermined duration, then performing single-character matching of each file name string with each search character in a predetermined order; if it does not exceed the predetermined duration, then performing multi-character matching of each file name string with the at least two search characters in a predetermined order.
[0010] Optionally, in the file location method according to the present invention, the predetermined order includes a first predetermined order and a second predetermined order, and the step of matching each filename string with the search character in the predetermined order includes: determining whether the operation of entering the search character in the current file directory includes pressing a predetermined key; if the operation of pressing a predetermined key is not included, then each filename string is matched with the search character in the first predetermined order; if the operation of pressing a predetermined key is included, then each filename string is matched with the search character in the second predetermined order.
[0011] Optionally, in the file location method according to the present invention, the current file directory includes the currently selected file, wherein matching each filename string with the search character in a first predetermined order includes: matching the filename strings corresponding to one or more files below the currently selected file with the search character in a top-to-bottom order; matching each filename string with the search character in a second predetermined order includes: matching the filename strings corresponding to one or more files above the currently selected file with the search character in a bottom-to-top order.
[0012] Optionally, in the file location method according to the present invention, the step of matching each file name string with the search characters in a predetermined order includes: extracting a corresponding number of characters at the beginning of each file name string based on the number of search characters, and determining whether they are the same as the search characters; if they are the same, then determining that the file name string matches the search characters.
[0013] Optionally, in the file location method according to the present invention, the display interface of the file manager includes a file view, which is adapted to display one or more files in the file list corresponding to the current file directory, each file occupying one line and corresponding to a line number index value; after locating the corresponding target file based on the target file name string, the method further includes the steps of: determining the line number index value corresponding to the target file, and determining whether the line where the target file is located exceeds the range of the file view based on the line number index value; if so, controlling the scrolling of the file list corresponding to the current file directory so that the target file is displayed in the file view.
[0014] Optionally, in the document location method according to the present invention, the second feature character is an English character.
[0015] According to one aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the file location method as described above.
[0016] According to one aspect of the present invention, a readable storage medium storing program instructions is provided, which, when read and executed by a computing device, causes the computing device to perform the method described above.
[0017] According to the technical solution of the present invention, a file location method is provided. For Chinese filenames or filenames containing both Chinese and English characters, the method obtains the pinyin corresponding to each Chinese character in the filename, extracts the first character of the pinyin, and combines the first characters of the pinyin corresponding to each Chinese character into a filename string, or combines the first characters of the pinyin corresponding to each Chinese character with the English characters in the filename into a filename string. Thus, based on the search characters input by the user, the present invention can match the filename string corresponding to each file containing Chinese characters with the search characters to obtain a target filename string that matches the search characters, and quickly locate the corresponding target file based on the target filename string. Therefore, according to the technical solution of the present invention, rapid matching and location of files with Chinese filenames or filenames containing both Chinese and English characters can be achieved.
[0018] Furthermore, the present invention can select sequential matching or reverse matching based on the user's actual operation when inputting search characters (whether a predetermined key is pressed), which is beneficial to improving the flexibility of filename matching and file location when there are many files.
[0019] Furthermore, when entering multiple characters, users can control the time interval between two characters to use single-character matching or multi-character matching, allowing for fuzzy or precise matching based on actual conditions and needs, thus further improving the flexibility of locating files.
[0020] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0021] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.
[0022] Figure 1 A schematic diagram of a computing device 100 according to an embodiment of the present invention is shown;
[0023] Figure 2 A flowchart of a file location method 200 according to an embodiment of the present invention is shown;
[0024] Figure 3 A schematic diagram of a file manager display interface 300 according to an embodiment of the present invention is shown; and
[0025] Figure 4 A schematic diagram of the matching order according to an embodiment of the present invention is shown. Detailed Implementation
[0026] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0027] Figure 1This is a schematic block diagram of an example computing device 100.
[0028] like Figure 1 As shown, in the basic configuration 102, the computing device 100 typically includes system memory 106 and one or more processors 104. Memory bus 108 can be used for communication between processor 104 and system memory 106.
[0029] Depending on the desired configuration, processor 104 can be any type of processor, including but not limited to: microprocessor (UP), microcontroller (UC), digital information processor (DSP), or any combination thereof. Processor 104 may include one or more levels of cache such as L1 cache 110 and L2 cache 112, processor core 114, and registers 116. Example processor core 114 may include an arithmetic logic unit (ALU), floating-point unit (FPU), digital signal processing core (DSP core), or any combination thereof. Example memory controller 118 may be used with processor 104, or in some implementations, memory controller 118 may be an internal part of processor 104.
[0030] Depending on the desired configuration, system memory 106 can be any type of memory, including but not limited to volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 106 may include operating system 120, one or more applications 122, and program data 124. In some embodiments, application 122 may be arranged to execute instructions on the operating system using program data 124 by one or more processors 104.
[0031] The computing device 100 also includes a storage device 132, which includes a removable storage device 136 and a non-removable storage device 138.
[0032] The computing device 100 may also include a storage interface bus 134. The storage interface bus 134 enables communication from storage devices 132 (e.g., removable storage 136 and non-removable storage 138) to the basic configuration 102 via a bus / interface controller 130. At least a portion of the operating system 120, application 122, and data 124 may be stored on the removable storage 136 and / or the non-removable storage 138, and loaded into system memory 106 via the storage interface bus 134 when the computing device 100 is powered on or when application 122 is to be executed, and executed by one or more processors 104.
[0033] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via a bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices such as displays or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via a network communication link through one or more communication ports 164.
[0034] A network communication link can be an example of a communication medium. A communication medium can typically be embodied in a modulated data signal, such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A “modulated data signal” can be a signal whose data set, or its modifications, can be encoded as information within the signal. As a non-limiting example, a communication medium can include wired media such as wired networks or leased lines, and various wireless media including sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term “computer-readable medium” as used herein can include both storage media and communication media.
[0035] The computing device 100 can be implemented as a personal computer, including desktop and laptop computer configurations. Of course, the computing device 100 can also be implemented as part of a small-sized portable (or mobile) electronic device, such as a cellular phone, digital camera, personal digital assistant (PDA), personal media player device, wireless network browsing device, personal head-mounted device, application-specific device, or a hybrid device that may include any of the above functions. It can even be implemented as a server, such as a file server, database server, application server, and web server. The embodiments of the present invention do not limit this.
[0036] In an embodiment of the present invention, a computing device 100 is configured to execute a file location method 200 according to the present invention. The application of the computing device 100 includes multiple program instructions for executing the file location method 200 of the present invention, such that the file location method 200 of the present invention can be executed in the computing device 100.
[0037] According to one embodiment of the present invention, a file manager 125 runs in the operating system of the computing device 100. The file manager 125 contains multiple program instructions for executing the file location method 200 of the present invention, so that the file location method 200 of the present invention can be executed in the file manager 125.
[0038] Figure 2 A flowchart of a file location method 200 according to an embodiment of the present invention is shown. The file location method 200 can be executed in a file manager 125 of a computing device (e.g., the aforementioned computing device 100). The file manager 125 includes a corresponding display interface so that a user can interact with the file manager 125 via the display interface.
[0039] like Figure 2 As shown, method 200 begins with step S210.
[0040] In step S210, the system receives an operation from the user to input one or more search characters in the current file directory. Here, the search characters are the second feature characters.
[0041] It should be noted that the current file directory includes one or more files, and the filename of each file may include a first characteristic character and / or a second characteristic character. For example, the files in the current file directory may include: files whose filenames contain only a number of first characteristic characters, files whose filenames contain only a number of second characteristic characters, and files whose filenames contain a number of first characteristic characters and a number of second characteristic characters. It should be pointed out that this invention does not impose specific restrictions on the types of characters in the filenames of each file in the current file directory.
[0042] Figure 3 A schematic diagram of a file manager display interface 300 according to an embodiment of the present invention is shown. Figure 3 As shown, the file manager's display interface 300 includes a file view 310, which can display one or more files in the current file directory. Each file in the current file directory occupies one line and corresponds to a line number index value.
[0043] Subsequently, in step S220, the filename string corresponding to each file in the current file directory is obtained. Specifically, for each file whose filename includes a first characteristic character, each first characteristic character in the filename is sequentially obtained, and the corresponding second characteristic string is obtained. Next, the first character of the second characteristic string corresponding to each first characteristic character in the filename is extracted, and the first characters of the second characteristic strings corresponding to each first characteristic character in the filename are combined to obtain the filename string corresponding to the file.
[0044] It should be noted that the filename string corresponding to each file obtained in step S220 is a string composed of one or more second feature characters that can be matched with the search characters (second feature characters). Based on this, for filenames containing only second feature characters, the filename itself is a filename string suitable for matching with the search characters, thus the filename can be directly obtained as the filename string corresponding to the file. Specifically, for each file whose filename contains only second feature characters, each second feature character in the filename is sequentially obtained and combined to obtain the filename string corresponding to the file.
[0045] For filenames containing first characteristic characters that are different from the second characteristic characters, since the filename contains first characteristic characters that cannot be matched with the search characters, it is necessary to convert the filename into a filename string composed of one or more second characteristic characters. That is, each first characteristic character in the filename is sequentially obtained, and the corresponding second characteristic string is obtained for each first characteristic character. Then, the first character of the second characteristic string corresponding to each first characteristic character in the filename is extracted, and the first characters of the second characteristic strings corresponding to each first characteristic character in the filename are combined to obtain the filename string corresponding to the file. In embodiments of the present invention, the second characteristic character can be an English character. The first characteristic character is a non-English character. It should be noted that the present invention does not limit the type of the first characteristic character, as long as there is a way in the prior art to convert the first characteristic character into a representation using English characters. For example, the first characteristic character can be a Chinese character, a Japanese character, a Korean character, a Greek character, etc.
[0046] In one embodiment, the first feature character can be implemented as a Chinese character. The second feature string corresponding to each first feature character can be implemented as Pinyin. In this embodiment, the filenames of one or more files may include one or more Chinese characters. For each filename, by obtaining the Pinyin corresponding to each Chinese character in the filename, extracting the first letter of the Pinyin, and combining the first letters of the Pinyin corresponding to each Chinese character, the corresponding filename string can be obtained.
[0047] For example, the current file directory includes a file named "Weekly Summary". For this file, each first characteristic character (Chinese character) in the file name, namely "本", "周", "总", "结", is obtained in sequence. Furthermore, the second characteristic strings (pinyin) corresponding to each first characteristic character in the obtained file name are respectively "ben", "zhou", "zong", "jie", and the first characters of each second characteristic string are respectively extracted and combined to obtain the string "bzzj". This string "bzzj" is the file name string corresponding to the file named "Weekly Summary".
[0048] It should be noted that for each file name, each first characteristic character is taken out from the file name in sequence from left to right, and the first characters of the second characteristic strings corresponding to each first characteristic character are combined based on the order of each first characteristic character in the file name to obtain the file name string.
[0049] In addition, according to an embodiment of the present invention, the file name may further include one or more second characteristic characters (such as English characters). The file location method 200 of the present invention is applicable to file names including one or more first characteristic characters and one or more second characteristic characters (such as file names mixed with Chinese and English).
[0050] It should be noted that for a file whose file name includes one or more first characteristic characters and one or more second characteristic characters, during the process of extracting and combining the first characters of the second characteristic strings corresponding to each first characteristic character in the file name, the one or more second characteristic characters in the file name remain unchanged, and there is no need to perform operations of converting and extracting the first characters on them.
[0051] Specifically, for a file whose file name includes one or more first characteristic characters and one or more second characteristic characters, each first characteristic character and second characteristic character in the file name are obtained in sequence, and the second characteristic string corresponding to each first characteristic character is obtained. Furthermore, the first character of the second characteristic string corresponding to each first characteristic character is extracted, and the first character of the second characteristic string corresponding to each first characteristic character is combined with the one or more second characteristic characters in the file name to obtain the file name string corresponding to the file.
[0052] For example, the current file directory includes a file named "Summary of This Q". For this file, each first characteristic character (Chinese character) and second characteristic character (English character) in the file name are obtained in sequence as "This", "Q", "Summary", "Conclusion". Furthermore, the second characteristic string (pinyin) corresponding to each first characteristic character in the file name is obtained while keeping the second characteristic characters in the file name unchanged, which are "ben", "Q", "zong", "jie" respectively. Subsequently, the first character of each second characteristic string (pinyin) is extracted, and the string obtained by combining the first character of the second characteristic string (pinyin) corresponding to each first characteristic character (Chinese character) with one or more second characteristic characters in the file name is "bQzj". This string "bQzj" is the file name string corresponding to the file named "Summary of This Q".
[0053] It should be noted that for each file name including first characteristic characters and second characteristic characters, each first characteristic character and each second characteristic character are sequentially taken out from the file name in the order from left to right, and the first character of the second characteristic string corresponding to each first characteristic character and one or more second characteristic characters in the file name are combined based on the order corresponding to each character in the file name to obtain the file name string.
[0054] In this way, by executing step S220, the file name string corresponding to each file in the current file directory can be obtained, that is, a string containing only one or more second characteristic characters that can be used to match the retrieval characters input by the user.
[0055] Next, in step S230, the file name string corresponding to each file in the current file directory is matched with the received retrieval characters in a predetermined order, and the first file name string that matches the retrieval characters is determined as the target file name string.
[0056] Finally, in step S240, in the current file directory, the target file is located based on the target file name string.
[0057] In one embodiment, the predetermined order includes a first predetermined order and a second predetermined order, and the first predetermined order and the second predetermined order can be opposite orders. For example, the first predetermined order is in the order of files from top to bottom, and the first predetermined order is in the order of files from bottom to top. Among them, the first predetermined order or the second predetermined order can be determined according to the actual operation of the retrieval characters input by the user.
[0058] Specifically, it is determined whether the user's input of search characters in the current file directory, received in step S210, includes pressing and holding a preset key. That is, it is determined whether the user inputs search characters while pressing and holding the preset key.
[0059] If the operation of entering search characters in the current file directory does not include holding down a predetermined key, then the filename strings corresponding to each file in the current file directory are matched with the search characters in a first predetermined order. Furthermore, the first filename string that matches the search characters is determined as the target filename string. In one implementation, the predetermined key can be, for example, the Shift key, but the invention is not limited to this.
[0060] If the operation of entering search characters in the current file directory includes pressing and holding a preset key (pressing and holding the preset key while entering search characters), then the filename strings corresponding to each file in the current file directory will be matched against the search characters in a second predetermined order. Furthermore, the first filename string that matches the search characters will be determined as the target filename string.
[0061] It should be further explained that the current file directory includes the currently selected file. Specifically, before receiving the user's input of search characters in the current file directory, the system will first receive the user's selection of at least one file in the current file directory, and designate that file as the currently selected file.
[0062] Based on this, if the operation of entering search characters in the current file directory does not include holding down the preset key, then the filename strings corresponding to one or more files below the currently selected file will be matched with the search characters in a top-to-bottom order (sequential matching), and the first filename string that matches the search characters will be determined as the target filename string. If the operation of entering search characters in the current file directory includes holding down the preset key, then the filename strings corresponding to one or more files above the currently selected file will be matched with the search characters in a bottom-to-top order (reverse matching), and the first filename string that matches the search characters will be determined as the target filename string.
[0063] It should be noted that the present invention can select sequential matching or reverse matching based on the user's actual operation when inputting search characters (whether a predetermined key is pressed). This is beneficial for improving the flexibility of filename matching and file location when there are many files.
[0064] In one implementation, after determining the filename string corresponding to each file, an association can be established between the line number index value of each file and the filename string corresponding to the file, so that the corresponding filename string can be obtained based on the line number index value.
[0065] Figure 4 Shows a schematic diagram of the matching order according to an embodiment of the present invention.
[0066] As Figure 4 shown, where index = 0 represents the first file displayed in the file view, a total of row_count files are displayed in the current file view, and the currently selected file is index = 3 (current = 3). Assume that at this time the user inputs a search character, and its matching process (that is, the process of matching the file name strings corresponding to one or more files with the search character in a predetermined order) is as follows:
[0067] Define an increment variable row of the line number index value (row < row_count), and the corresponding line number index value can be obtained according to the predetermined order during matching.
[0068] Among them, when matching in the first predetermined order (sequential matching), row = current + row, which is equivalent to: row = (current + row) % row_count.
[0069] When matching in the second predetermined order (reverse matching), row = (row_count + current - row) % row_count.
[0070] After obtaining each line number index value row, the corresponding file name string can be obtained based on the line number index value row. Subsequently, it is determined whether the file name string matches the search character. Specifically, based on the number of search characters, the corresponding number of characters at the head of each file name string is extracted and it is determined whether it is the same as the search character. If it is the same, it is determined that the file name string corresponding to the line number index value matches the search character, and the file name string corresponding to the line number index value is determined as the target file name string, and the operation of selecting the row corresponding to the line number index value selectItem(row) is performed, so as to implement selecting the target file corresponding to the line number index value.
[0071] If the corresponding number of characters at the head of each file name string extracted based on the number of search characters is not the same as the search character, it means that the file name string corresponding to the line number index value does not match the search character. Furthermore, continue to obtain the next line number index value, and obtain the next file name string based on the line number index value to match with the search character until the file name string corresponding to the line number index value matches the search character, or until each file name string corresponding to the line number index value has been matched with the search character.
[0072] It should be noted that the number of search characters may be less than the number of characters contained in the filename string. Therefore, in one implementation, when matching the filename strings corresponding to one or more files with the search characters in a predetermined order, it can be determined whether the corresponding number of characters at the beginning of each filename string (the same as the number of search characters) are the same as the search characters. If they are the same, it is determined that the filename string matches the search characters; otherwise, it is determined that the filename string does not match the search characters.
[0073] According to one embodiment of the present invention, the number of search characters includes at least two. In other words, receiving the user's input of search characters in the current file directory includes receiving the user's input of at least two search characters in the current file directory. The present invention also determines whether to use a single-character matching method or a multi-character matching method to match the filename string based on the time interval between the two search characters input by the user. Specifically, when the time interval between the two input search characters is long, a single-character matching method can be used for fuzzy searching of the file. When the time interval between the two input search characters is short, a multi-character matching method can be used for more precise searching of the file.
[0074] Specifically, in step S230, each filename string in the current file directory is matched with the search characters in a predetermined order, which can be performed according to the following method:
[0075] The time interval between the user's input of the first search character and the input of the second search character is determined, and it is checked whether this time interval exceeds a predetermined duration. If it exceeds the predetermined duration, a single-character matching method is used, that is, each filename string in the current file directory is matched against each search character input by the user in a predetermined order. If it does not exceed the predetermined duration, a multi-character matching method is used, that is, each filename string in the current file directory is matched against at least two search characters input by the user in a predetermined order.
[0076] In one implementation, each search character received from user input can be stored in a second feature string variable V. A timer is created in the file manager, with a predetermined trigger duration of T. An event handler function is registered after the trigger. When the time interval between the input of the first and second search characters exceeds the predetermined duration T (the user inputs the first second feature character, and then inputs the second second feature character after the predetermined duration T), the handler function clears the currently stored search characters in the second feature string variable V, triggering a single-character matching method. This method matches each filename string in the current directory with each search character in a predetermined order. Otherwise, a multi-character matching method is used.
[0077] It should be noted that each file directory corresponds to a file list, which includes one or more files (i.e., files under the file directory), with each file occupying one line in the file list. In an embodiment of the present invention, the file view 310 can display one or more files from the file list corresponding to the current file directory, with each file occupying one line and corresponding to a line number index value.
[0078] When there are many files in the current directory, the file view can only display a portion of them, and there may be cases where the target file exceeds the file view and is not displayed. Therefore, after locating the target file based on its filename string, the line number index of the target file is determined. This line number index is used to determine if the line containing the target file exceeds the range of the file view. If it does, the file list in the current directory is scrolled to ensure the target file is displayed. In one implementation, when the line containing the target file exceeds the range of the file view, the file manager can execute a `scrolltorow(row)` operation, using the line number index of the target file as a parameter to control the scrolling of the file list in the current directory, thus ensuring the line containing the target file is displayed in the current file view.
[0079] Furthermore, whether a line containing the target file exceeds the scope of the file view depends not only on the line number index of that line, but also on the line height of each line and the current file view height. Therefore, a comprehensive assessment can be made based on the line number index, line height, and file view height of the target file to determine whether a line containing the target file exceeds the scope of the file view.
[0080] In one implementation, in step S220, the file manager 125 can obtain a dictionary file and retrieve the second characteristic string corresponding to each first characteristic character in the filename by querying the dictionary file. It should be noted that each entry in the dictionary file includes a Unicode encoding and a corresponding second characteristic string (e.g., Pinyin). Based on this, by converting each first characteristic character in the filename to its corresponding Unicode encoding and querying the dictionary file based on the Unicode encoding, the second characteristic string corresponding to the Unicode encoding can be obtained from the dictionary file; that is, the second characteristic string corresponding to the first characteristic character.
[0081] Furthermore, in order to improve the efficiency of querying the second feature string corresponding to the first feature character and avoid reading the dictionary file every time, the dictionary file can be pre-read into memory before executing step S210.
[0082] In one implementation, a hash variable can be used to associate each unique code in the dictionary file with its corresponding second characteristic string; that is, a hash...<uint,QString> The dict variable uses the unified encoding as the first parameter of the hash variable and the second characteristic string (e.g., pinyin) corresponding to the unified encoding as the second parameter of the hash variable.
[0083] According to the file location method 200 of the present invention, for Chinese filenames or filenames containing both Chinese and English characters, the method obtains the pinyin corresponding to each Chinese character in the filename, extracts the first character of the pinyin, and combines the first characters of the pinyin corresponding to each Chinese character into a filename string, or combines the first characters of the pinyin corresponding to each Chinese character with the English characters in the filename into a filename string. Thus, based on the search characters input by the user, the present invention can match the filename string corresponding to each file containing Chinese characters with the search characters to obtain a target filename string that matches the search characters, and quickly locate the corresponding target file based on the target filename string. Therefore, according to the technical solution of the present invention, it is possible to quickly match and locate files with Chinese filenames or filenames containing both Chinese and English characters.
[0084] Furthermore, the present invention can select sequential matching or reverse matching based on the user's actual operation when inputting search characters (whether a predetermined key is pressed), which is beneficial to improving the flexibility of filename matching and file location when there are many files.
[0085] Furthermore, when entering multiple characters, users can control the time interval between two characters to use single-character matching or multi-character matching, allowing for fuzzy or precise matching based on actual conditions and needs, thus further improving the flexibility of locating files.
[0086] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.
[0087] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the file location method of the present invention according to instructions in the program code stored in the memory.
[0088] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.
[0089] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0090] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0091] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more aspects of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.
[0092] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.
[0093] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0094] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments.
[0095] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.
[0096] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.
[0097] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.
Claims
1. A file location method, executed in a file manager of a computing device, wherein the file manager's display interface includes a file view, the file view being adapted to display one or more files in a file list corresponding to the current file directory, each file occupying one line and corresponding to a line number index value, the method comprising the steps of: The system receives an operation to input at least two search characters in the current file directory, where the current file directory includes one or more files, and the search characters are second feature characters, which are English characters. Retrieve the filename string corresponding to each file in the current file directory, where... For each file whose filename includes a first characteristic character, each first characteristic character in the filename is obtained sequentially, and the second characteristic string corresponding to each first characteristic character is obtained. The first character of the second characteristic string corresponding to each first characteristic character is extracted and combined to obtain the filename string corresponding to the file. The first characteristic character is a Chinese character, and the second characteristic string corresponding to the first characteristic character is Pinyin. Each filename string is matched against the search characters in a predetermined order. Specifically, the time interval between inputting the first and second search characters is determined, and it is determined whether the time interval exceeds a predetermined duration. If it exceeds the predetermined duration, each filename string is matched character-by-character with each search character in the predetermined order. If it does not exceed the predetermined duration, each filename string is matched against at least two search characters in the predetermined order. Matching each filename string against the search characters in the predetermined order includes: determining whether the operation of inputting at least two search characters in the current file directory includes pressing and holding a predetermined key. If it does not include pressing and holding a predetermined key, the filename strings corresponding to one or more files below the currently selected file are matched against the search characters in a top-to-bottom order. If it includes pressing and holding a predetermined key, the filename strings corresponding to one or more files above the currently selected file are matched against the search characters in a bottom-to-top order. The first filename string that matches the search characters is determined as the target filename string; Locate the corresponding target file based on the target filename string; Determine the line number index value corresponding to the target file, and based on the line number index value, determine whether the line where the target file is located exceeds the range of the file view. If so, control the scrolling of the file list corresponding to the current file directory so that the target file is displayed in the file view.
2. The method as described in claim 1, wherein, The steps to extract the first character of the second feature string corresponding to each first feature character and combine them to obtain the filename string corresponding to the file include: For each file whose filename includes a first characteristic character and a second characteristic character, extract the first character of the second characteristic string corresponding to each first characteristic character in the filename and combine it with one or more second characteristic characters in the filename to obtain the filename string corresponding to the file.
3. The method as described in claim 1, wherein, The steps to obtain the second feature string corresponding to each first feature character include: Obtain a dictionary file, wherein each entry in the dictionary file includes a unique code and a corresponding second feature string; Each first feature character is converted into the corresponding unified code, and the corresponding second feature string is obtained from the dictionary file based on the unified code.
4. The method of claim 3, wherein, Before accepting the operation of entering at least two search characters in the current file directory, the following steps are also included: The dictionary file is read into memory.
5. The method according to any one of claims 1-4, wherein, The step of matching each filename string with the search characters in a predetermined order includes: Extract the corresponding number of characters at the beginning of each filename string based on the number of search characters, and determine whether they are the same as the search characters. If they are the same, it is determined that the filename string matches the search characters.
6. A computing device, comprising: At least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the method as described in any one of claims 1-5.
7. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
File location method, device and mobile terminal
CN101446975A
Image processing apparatus and control method therefor
CN1812531A