Device access methods, apparatus, computing devices and readable storage media

By establishing a mapping between devices, folders, and display/hidden rule files in the computing device cache, the access delay problem caused by the lack of display/hidden rule files in folders is solved, improving access speed and user experience.

CN114880286BActive Publication Date: 2025-10-31UNIONTECH SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210451448.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-26
Publication Date
2025-10-31
Estimated Expiration
2042-04-26

AI Technical Summary

Technical Problem

When accessing devices mounted via MTP or USB 2.0, the lack of a display/hidden rules file in the folder causes excessive time to determine the display or hidden status of files, affecting the user experience.

Method used

Establish a mapping between devices, folders, and display/hidden rule files in the cache of computing devices. Quickly determine the display or hidden status of files through the display/hidden rule files in the cache, avoiding repeated parsing of display/hidden rule files in folders.

Benefits of technology

It speeds up the display or hiding of file lists in folders, improves device access efficiency, and protects the integrity of device data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114880286B_ABST
    Figure CN114880286B_ABST
Patent Text Reader

Abstract

This invention discloses a device access method, apparatus, computing device, and readable storage medium. The method includes: in response to opening a folder on the device, querying the cache of the computing device to see if a display / hidden file corresponding to the folder exists; if it exists, returning the hidden file information stored in the display / hidden file so that the corresponding file is hidden when displaying the file list in the folder. This device access method improves the efficiency of accessing device folders.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, computing device, and readable storage medium for accessing a device. Background Technology

[0002] Currently, different operating systems have different definitions for file system hiding mechanisms. In Windows and macOS, the "hidden" attribute defines whether a file is hidden. Unix operating systems typically use filenames starting with "." or ".." to indicate that a file is hidden. As operating systems have evolved, many Unix distributions require hiding files, but filenames cannot begin with "." or ".." Therefore, mainstream Unix desktop distributions, such as GNOME, store a list of files that need to be hidden using a file named ".hidden" that sets the visibility rules.

[0003] In file systems that use a hidden / revealable rule file mechanism, displaying a list of files in a folder first requires parsing the rule file to obtain information about hidden files within that folder and determine whether a file should be hidden. However, the rule file may not exist in the folder, making accessing data on slow devices (such as those based on the MTP protocol or connected via USB 2.0) extremely time-consuming. This is usually due to the protocol's inherent mechanism. When accessing a folder and synchronously reading the rule file, if the rule file is not present, the system will wait for all files to be traversed or for a timeout to trigger before returning an exception. This entire process is time-consuming, resulting in noticeable lag and a poor user experience.

[0004] Therefore, a device access method is needed to solve the problems existing in the current technical solutions. Summary of the Invention

[0005] Therefore, the present invention provides a method, apparatus, computing device, and readable storage medium for accessing a device, in order to solve or at least alleviate the problems mentioned above.

[0006] According to a first aspect of the present invention, a method for accessing a device is provided, executed in a computing device, the method comprising: in response to an operation of opening a folder in the device, querying whether a display / hidden rule file corresponding to the folder exists in the cache of the computing device; if it exists, returning hidden file information stored in the display / hidden rule file so as to hide the corresponding file when displaying a list of files in the folder.

[0007] Optionally, the device access method according to the present invention further includes: if it does not exist, establishing a correspondence between the device, the folder, and the display / hidden rule file in the cache; determining whether a corresponding display / hidden rule file exists in the folder; if a corresponding display / hidden rule file exists in the folder, storing the display / hidden rule file in the cache; otherwise, creating an empty display / hidden rule file in the cache corresponding to the combination of the device and the folder. Optionally, the device access method according to the present invention further includes: in response to the operation of mounting the device to the computing device, obtaining the device identifier of the device; querying whether a folder and display / hidden rule file corresponding to the device identifier exist in the cache of the computing device; if they exist, deleting the device identifier and its corresponding folder and display / hidden rule file stored in the cache.

[0008] Optionally, in the device access method according to the present invention, after responding to the operation of opening a folder in the device, the method further includes: obtaining the general resource identifier of the folder; wherein, the display / hidden rule file corresponding to the folder in the device is the display / hidden rule file corresponding to the combination of the device identifier of the device and the general resource identifier of the folder.

[0009] Optionally, the device access method according to the present invention further includes: in response to a change in the display or hiding state of a file in a folder of the device, synchronizing the display / hiding rule file corresponding to the combination of the device and the folder in the cache.

[0010] Optionally, in the device access method according to the present invention, the step of synchronizing the display / hidden rule file corresponding to the combination of device and folder in the cache includes: determining whether there is a corresponding display / hidden rule file in the folder; if there is a corresponding display / hidden rule file in the folder, then synchronizing and storing the correspondence between the combination of device and folder and the display / hidden rule file in the folder into the cache; otherwise, creating a display / hidden rule file that stores the hidden state of the file list in the folder, and storing the correspondence between the device, folder and the created display / hidden rule file into the cache of the computing device.

[0011] Optionally, the method for accessing the device according to the present invention further includes: performing device initialization processing.

[0012] Optionally, in the device access method according to the present invention, the device includes a device mounted based on the MTP protocol or USB 2.0.

[0013] According to a second aspect of the present invention, a method for accessing a device is provided, executed in a computing device, the method comprising: in response to an operation of opening a folder in the device, creating an empty display / hidden rules file in the folder; if creating the empty display / hidden rules file in the folder fails, reading the existing display / hidden rules file in the folder and returning the hidden file information stored in the existing display / hidden rules file so as to hide the corresponding files when displaying a list of files in the folder.

[0014] Optionally, the access method of the device according to the present invention further includes: if the creation of an empty show / hide rule file in the folder is successful, then prompting that there are no hidden files in the folder.

[0015] Optionally, in the device access method according to the present invention, the device includes a device mounted based on the MTP protocol or USB 2.0.

[0016] According to a third aspect of the present invention, a device access apparatus is provided, the apparatus comprising: a query module adapted to query whether a display / hidden rule file corresponding to the folder exists in the cache of the computing device in response to an operation of opening a folder in the device; and an information return module adapted to return hidden file information stored in the display / hidden rule file when the display / hidden rule file corresponding to the folder exists in the cache, so as to hide the corresponding file when displaying a file list in the folder.

[0017] Optionally, the access device of the device according to the present invention further includes: a relationship establishment module, adapted to establish a correspondence between the device, the folder and the display / hidden rule file in the cache when there is no display / hidden rule file corresponding to the folder in the cache, determine whether there is a corresponding display / hidden rule file in the folder, and if there is a corresponding display / hidden rule file in the folder, store the display / hidden rule file in the cache; otherwise, create an empty display / hidden rule file in the cache corresponding to the combination of the device and the folder.

[0018] According to a fourth aspect of the present invention, a device access apparatus is provided, the apparatus comprising: a creation module adapted to create an empty display / hidden rule file in the folder in response to an operation of opening a folder in the device; and an information return module adapted to read an existing display / hidden rule file in the folder and return hidden file information stored in the existing display / hidden rule file when the creation of the empty display / hidden rule file in the folder fails, so as to hide the corresponding files when displaying a file list in the folder.

[0019] Optionally, the access device of the device according to the present invention further includes: a prompting module, adapted to prompt that no hidden files exist in the folder when an empty show / hide rule file is successfully created in the folder.

[0020] According to a fifth 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 methods described above.

[0021] According to a sixth 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.

[0022] According to the technical solution of the present invention, after the device is mounted to the computing device, in response to the operation of opening a folder on the device, the cache of the computing device is queried to see if there is a display / hidden rule file corresponding to the folder. If it exists, the hidden file information stored in the display / hidden rule file is directly returned, and the files in the folder are displayed or hidden according to the hidden file information when the file list in the folder is displayed. If it does not exist, a correspondence between the device, folder, and display / hidden rule file is established in the cache. In this way, since the correspondence between the device, folder, and display / hidden rule file has been established in the cache, when the user enters the folder again, the display / hidden rule file corresponding to the folder can be obtained more quickly, which speeds up the speed of displaying or hiding the corresponding files when the file list in the folder is displayed, and improves the access efficiency of the device folder. Moreover, the display / hidden rule file is established in the cache, and no additional display / hidden rule files are created on the mounted device, thus protecting the integrity of the device data.

[0023] 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

[0024] 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.

[0025] Figure 1A schematic diagram of a computing device 100 according to an embodiment of the present invention is shown;

[0026] Figure 2 A flowchart of a device access method 200 according to an embodiment of the present invention is shown;

[0027] Figure 3 A flowchart of a device access method 300 according to another embodiment of the present invention is shown;

[0028] Figure 4 A flowchart of a device access method 400 according to yet another embodiment of the present invention is shown;

[0029] Figure 5 A flowchart of a device access method 500 according to another embodiment of the present invention is shown;

[0030] Figure 6 A schematic diagram of an access device 600 for a device according to an embodiment of the present invention is shown;

[0031] Figure 7 A schematic diagram of an access device 700 for a device according to another embodiment of the present invention is shown;

[0032] as well as

[0033] Figure 8 A schematic diagram showing the test results of a method for accessing a device according to an embodiment of the present invention is illustrated. Detailed Implementation

[0034] 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.

[0035] The device access method of the present invention is executed in a computing device. The computing device can be any device with storage and computing capabilities, such as a server, workstation, or a personal computer such as a desktop computer or laptop computer, or a terminal device such as a mobile phone, tablet computer, smart wearable device, or Internet of Things device, but is not limited thereto.

[0036] Figure 1A block diagram of the physical components (i.e., hardware) of a computing device 100 is shown. In a basic configuration, the computing device 100 includes at least one processing unit 102 and system memory 104. According to one aspect, depending on the configuration and type of the computing device, the processing unit 102 may be implemented as a processor. The system memory 104 includes, but is not limited to, volatile memory (e.g., random access memory), non-volatile memory (e.g., read-only memory), flash memory, or any combination of such memory. According to one aspect, an operating system 105 is included in the system memory 104.

[0037] According to one aspect, operating system 105 is, for example, suitable for controlling the operation of computing device 100. Furthermore, examples are practiced in conjunction with graphics libraries, other operating systems, or any other applications, and are not limited to any particular application or system. Figure 1 The basic configuration is illustrated by the components within the dashed lines 108. According to one aspect, the computing device 100 has additional features or functions. For example, according to one aspect, the computing device 100 includes additional data storage devices (removable and / or non-removable), such as disks, optical discs, or magnetic tapes. This additional storage... Figure 1 The middle part is shown by removable storage device 109 and non-removable storage device 110.

[0038] As stated above, according to one aspect, a program module is stored in system memory 104. According to one aspect, the program module may include one or more applications. The present invention does not limit the type of application; for example, applications may include: email and contact applications, word processing applications, spreadsheet applications, database applications, slideshow applications, drawing or computer-aided applications, web browser applications, etc. The program module includes instructions 120 for executing device access methods 200-500.

[0039] According to one aspect, examples can be practiced on circuits including discrete electronic components, packaged or integrated electronic chips containing logic gates, circuits utilizing microprocessors, or on a single chip containing electronic components or a microprocessor. For example, it can be practiced via wherein... Figure 1Each or many of the components shown can be implemented as an example by integrating a System-on-a-Chip (SOC) on a single integrated circuit. According to one aspect, such an SOC device may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all integrated (or “burned in”) as a single integrated circuit onto a chip substrate. When operating via the SOC, the functions described herein can be operated via dedicated logic integrated on a single integrated circuit (chip) with other components of the computing device 100. Embodiments of the invention can also be implemented using other techniques capable of performing logical operations (e.g., AND, OR, and NOT), including but not limited to mechanical, optical, fluid, and quantum technologies. Additionally, embodiments of the invention can be implemented within a general-purpose computer or in any other circuit or system.

[0040] According to one aspect, computing device 100 may also have one or more input devices 112, such as a keyboard, mouse, pen, voice input device, touch input device, etc. It may also include output devices 114, such as a monitor, speaker, printer, etc. The foregoing devices are examples and other devices may also be used. Computing device 100 may include one or more communication connections 116 that allow communication with other computing devices 118. Examples of suitable communication connections 116 include, but are not limited to: RF transmitters, receivers and / or transceiver circuitry; Universal Serial Bus (USB); parallel and / or serial ports. Computing device 100 may accept the mounting of slow devices 122, which are devices mounted on the computing device with relatively low transmission speeds, such as devices mounted based on the MTP or USB 2.0 protocols.

[0041] As used herein, the term computer-readable medium includes computer storage medium. Computer storage medium can include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information (e.g., computer-readable instructions, data structures, or program modules). System memory 104, removable storage device 109, and non-removable storage device 110 are examples of computer storage media (i.e., memory storage). Computer storage media can include random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic tape, disk storage or other magnetic storage devices, or any other article of manufacture that can be used to store information and is accessible by computer device 100. According to one aspect, any such computer storage medium can be part of computing device 100. Computer storage media does not include carrier waves or other transmitted data signals.

[0042] According to one aspect, a communication medium is implemented by computer-readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., a carrier wave or other transmission mechanism), and includes any information transmission medium. According to one aspect, the term "modulated data signal" describes a signal having one or more sets of characteristics or altered in a manner that encodes information in the signal. By way of example and not limitation, a communication medium includes wired media such as wired networks or direct wired connections, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.

[0043] In one embodiment of the present invention, computing device 100 includes one or more processors and one or more readable storage media storing program instructions. When the program instructions are configured to be executed by one or more processors, the computing device performs the device access methods 200-500 of the embodiments of the present invention.

[0044] The slow device involved in this invention is a device with relatively low transmission speed mounted on a computing device, such as a device mounted based on the MTP or USB 2.0 protocol. After a slow device is mounted on a computing device, accessing a folder on the slow device first requires reading the folder's display / hidden rule file, parsing the information in it to determine whether files in the folder should be displayed or hidden. If the display / hidden rule file does not exist in the folder, a long wait is required to determine the file display or hiding rules. The specific waiting time varies from a few seconds to tens of minutes or more, depending on the number of files in the folder. This excessively long access time for mounted slow devices leads to a poor user experience. Therefore, this invention provides device access methods 200-500 to solve the problems existing in current slow device mounting methods.

[0045] Figure 2 A flowchart of a device access method 200 according to an embodiment of the present invention is shown. Method 200 is adapted to be executed in a computing device (e.g., the aforementioned computing device 100). The device is a slow device, such as a device mounted based on the MTP protocol or the USB 2.0 protocol.

[0046] like Figure 2 As shown, method 200 begins with step S210.

[0047] In step S210, the device is attached to a computing device (e.g., the aforementioned computing device 100), and the device identifier is obtained. The device identifier is a unique identifier for the device; each device is bound to a unique device identifier, and the specific device corresponding to that device identifier can be identified without a doubt.

[0048] Subsequently, in step S220, the cache of the computing device is queried to determine whether a folder corresponding to the device identifier and a hide / reveal rule file exist. The hide / reveal rule file is a file named ".hidden" in some Unix desktop systems (such as GNOME), and it is usually stored in a folder on the device. This file stores a list of files in that folder that need to be hidden.

[0049] If the device identifier exists in the cache of the computing device, then step S230 is executed to clear the original cache information on the local disk of the computing device, that is, to delete the device identifier and its corresponding folder and display / hidden rule file stored in the cache. After step S230, step S240 is executed.

[0050] If the device identifier is not present in the cache of the computing device, proceed directly to step S240.

[0051] In step S240, the device is initialized to complete the device preparation work and put the device into working state for subsequent user operation. The device's file system is initialized. During the initialization process, the device's file system processes files according to the display and hiding rules of each folder, and handles the display or hiding of files accordingly.

[0052] Figure 3 A flowchart of a device access method 300 according to another embodiment of the present invention is shown. Method 300 is a follow-up step to method 200, and device access method 300 is executed after step S240 in device access method 200. Figure 3 As shown, the device access method 300 begins at step S310.

[0053] In step S310, when a user opens any folder on the device, the general resource identifier of that folder is obtained, and the local cache is queried by calling the local interface of the computing device.

[0054] Specifically, query whether there is a display / hidden rule file corresponding to the folder in the computing device's cache, that is, query whether there is a display / hidden rule file corresponding to the combination of the device identifier of the device and the general resource identifier of the folder in the computing device's cache.

[0055] The Universal Resource Identifier (URI) can be used to identify various resources such as images, videos, and folders. A URI can definitively identify the specific folder corresponding to that URI on a device.

[0056] If the cache of the computing device does not contain a display / hidden rule file corresponding to the combination of the device identifier of the device and the general resource identifier of the folder, then proceed to step S320 to establish the correspondence between the device, the folder and the display / hidden rule file in the cache of the computing device.

[0057] Specifically, it determines whether a corresponding explicit / implicit rule file exists in the device's folder. If a explicit / implicit rule file exists in the folder, the mapping between the device, the folder, and the explicit / implicit rule file is stored in the computing device's cache. If no corresponding explicit / implicit rule file exists in the folder, an empty explicit / implicit rule file corresponding to the combination of the device and the folder is created in the computing device's cache, namely, the device identifier of the device, the generic resource identifier of the folder, and the mapping between the device and an empty explicit / implicit rule file.

[0058] By using the above method, a local display / hidden rule library is established in the cache of the computing device to store the correspondence between devices, folders and display / hidden rule files. By querying the display / hidden rule files of devices in the local display / hidden rule library, it is not limited by the protocol restrictions of slow devices, and the speed of obtaining the locally stored display / hidden rule files is fast. In this way, when a user opens any folder on the device, if a mapping between the device, the folder, and the corresponding display / hidden rule file has already been established in the local display / hidden rule library, then when the folder displays the file list, it directly hides or shows the corresponding files according to the display / hidden rule file in the local display / hidden rule library, greatly improving the speed at which the user accesses files in the device's folders. If a mapping between the device, the folder, and the display / hidden rule file has not been established in the local display / hidden rule library, then a mapping between the device, the folder, and an empty display / hidden rule file will be established in the local display / hidden rule library. In this way, when the user accesses the folder again, the corresponding display / hidden rule file will exist in the local display / hidden rule library, and when the folder displays the file list, it directly hides or shows the corresponding files according to the display / hidden rule file in the local display / hidden rule library, greatly improving the speed at which the user accesses files in the folder.

[0059] If the cache of the computing device contains a display / hidden rule file corresponding to the combination of the device's device identifier and the folder's generic resource identifier, it means that the local display / hidden rule library in the computing device's cache already contains the display / hidden rule file corresponding to the combination of the device's device identifier and the folder's generic resource identifier. Then, proceed to step S330, return the hidden file information stored in the display / hidden rule file corresponding to the folder, so that the corresponding files can be hidden when displaying the file list in the folder. Because the local display / hidden rule library contains the display / hidden rule file corresponding to this folder for this device, the folder can directly hide or show the corresponding files according to the display / hidden rule file in the local display / hidden rule library when displaying the file list, improving the speed and efficiency of accessing files in the folder.

[0060] According to an embodiment of the present invention, when a user enters a folder on a slow device, the system first checks whether the display / hidden rules file corresponding to the currently opened folder exists in the local cache. If it exists, it is retrieved directly. Since it accesses the cache of the local disk of the computing device, retrieving the display / hidden rules file in the local cache will hardly cause any lag, thus improving the access speed.

[0061] In addition, in some embodiments, when a user changes the status of a file in a folder on the device, the local display / hidden rule base needs to be updated synchronously.

[0062] Specifically, when a user enters any folder on the device and changes the display or hiding status of one or more files in that folder, that is, when the user changes the status of a hidden file in the folder to display or changes the status of a previously displayed file to hide, the local interface of the computing device is called to synchronize the local display / hidden rule base stored in the cache of the computing device.

[0063] If a display / hide rule file already exists in the device's folder, it will automatically update to reflect the latest list of files that need to be hidden when the display or hiding status of files in that folder changes. First, it determines whether a corresponding display / hide rule file exists in the folder. If so, the mapping between the device, the folder, and the display / hide rule file is synchronously updated and stored in the cache. Otherwise, based on the display or hiding status of the file list in the folder, a display / hide rule file storing the hidden status of the file list is created, and the mapping between the device, the folder, and the created display / hide rule file is stored in the computing device's cache. During storage, if the computing device's cache already contains a mapping between the device and the folder and a display / hide rule file, the existing mapping is overwritten.

[0064] Figure 4 A flowchart of a device access method 400 according to yet another embodiment of the present invention is shown. Method 400 is a follow-up step to method 200, and device access method 400 is executed after step S240 in device access method 200. Figure 4 As shown, the device access method 400 begins at step S410.

[0065] In step S410, when a user opens any folder in the device, the generic resource identifier of the folder is obtained. By calling the local interface of the computing device, the display / hidden rule file corresponding to the combination of the device identifier of the device and the generic resource identifier of the folder is obtained from the cache of the computing device.

[0066] The Universal Resource Identifier (URI) can be used to identify various resources such as images, videos, and folders. A URI can definitively identify the specific folder corresponding to that URI on a device.

[0067] If the acquisition is successful, step S420 is executed to return the hidden file information stored in the acquired display / hide rule file, so that the corresponding files can be hidden or displayed when the file list in the folder is displayed.

[0068] If the retrieval fails, proceed to step S430 to establish the correspondence between the device, the folder, and the explicit / implicit rules file in the cache of the computing device.

[0069] Specifically, it determines whether a corresponding explicit / implicit rule file exists in the folder of the device. If a corresponding explicit / implicit rule file exists in the folder, the mapping between the device, the folder, and the explicit / implicit rule file is stored in the cache of the computing device. If a corresponding explicit / implicit rule file does not exist in the folder, an empty explicit / implicit rule file corresponding to the combination of the device and the folder is created in the cache of the computing device; that is, the mapping between the device identifier, the generic resource identifier of the folder, and an empty explicit / implicit rule file.

[0070] By using the above method, a local display / hidden rule library is established in the cache of the computing device to store the correspondence between devices, folders and display / hidden rule files. By querying the display / hidden rule files of devices in the local display / hidden rule library, it is not limited by the protocol restrictions of slow devices, and the speed of obtaining the locally stored display / hidden rule files is fast. In this way, when a user opens any folder on the device, if a mapping between the device, the folder, and the corresponding display / hidden rule file has already been established in the local display / hidden rule library, then when the folder displays the file list, it directly hides or shows the corresponding files according to the display / hidden rule file in the local display / hidden rule library, greatly improving the speed at which the user accesses files in the device's folders. If a mapping between the device, the folder, and the display / hidden rule file has not been established in the local display / hidden rule library, then a mapping between the device, the folder, and an empty display / hidden rule file will be established in the local display / hidden rule library. In this way, when the user accesses the folder again, the corresponding display / hidden rule file will exist in the local display / hidden rule library, and when the folder displays the file list, it directly hides or shows the corresponding files according to the display / hidden rule file in the local display / hidden rule library, greatly improving the speed at which the user accesses files in the folder.

[0071] In addition, in some embodiments, when a user changes the status of a file in a folder on the device, the local display / hidden rule base needs to be updated synchronously.

[0072] Specifically, when a user enters any folder on the device and changes the display or hiding status of one or more files in that folder, that is, when the user changes the status of a hidden file in the folder to display or changes the status of a previously displayed file to hide, the local interface of the computing device is called to synchronize the local display / hidden rule base stored in the cache of the computing device.

[0073] If a display / hide rule file already exists in the device's folder, it will automatically update to reflect the latest list of files that need to be hidden when the display or hiding status of files in that folder changes. First, it determines whether a corresponding display / hide rule file exists in the folder. If so, the mapping between the device, the folder, and the display / hide rule file is synchronously updated and stored in the cache. Otherwise, based on the display or hiding status of the file list in the folder, a display / hide rule file storing the hidden status of the file list is created, and the mapping between the device, the folder, and the created display / hide rule file is stored in the computing device's cache. During storage, if the computing device's cache already contains a mapping between the device and the folder and a display / hide rule file, the existing mapping is overwritten.

[0074] The device access method of the present invention creates a local explicit / implicit rule library in the cache of the computing device. After a slow device is mounted to the computing device, when a user accesses any folder on the slow device, the corresponding explicit / implicit rule file is retrieved from the cache, resulting in fast retrieval and improved user access efficiency. Furthermore, the explicit / implicit rule files created in this solution are all in the cache, without modifying any files on the slow device or adding any files to it, thus ensuring the integrity of user data. This solution is suitable for scenarios sensitive to the storage space and data integrity of mounted slow devices.

[0075] According to another embodiment of the present invention, another method for accessing a device is provided. When a user accesses a folder on a slow device, the slow device is slow because the system is slow to determine the display or hiding status of files due to the absence of a display / hidden rule file in the folder, resulting in slow file access speed. Therefore, the present invention provides a new method for accessing a device by actively creating a display / hidden rule file, which can avoid the time-consuming waiting time when the user accesses the folder again. By using creation instead of existence, that is, creating the display / hidden rule file when entering the folder instead of querying the original display / hidden rule file, the process of the computing device resolving the mounted device is further shortened, the access waiting time is reduced, the access success rate is improved, and the user experience is enhanced. The method is described in detail below.

[0076] Figure 5 A flowchart of a device access method 500 according to another embodiment of the present invention is shown. The device access method 500 is adapted to be executed in a computing device (e.g., the aforementioned computing device 100). Figure 5 As shown, method 500 begins with step S510.

[0077] In step S510, the device is mounted to the computing device, wherein the device is a slow device, such as a device mounted based on the MTP protocol or the USB 2.0 protocol.

[0078] Subsequently, in step S520, in response to the operation of opening a folder in the device, an empty display / hidden rules file is created in that folder.

[0079] Since the display / hidden rule file is unique within a folder, if creating an empty display / hidden rule file in the folder fails, it means that a display / hidden rule file already exists in the folder. Proceed to step S530, read the original display / hidden rule file in the folder, and return the hidden file information stored in the original display / hidden rule file so that the corresponding files can be hidden when the file list in the folder is displayed.

[0080] If creating an empty show / hide rule file in the folder is successful, it means that the folder did not originally contain such a file, and the process proceeds to step S540, indicating that no hidden files exist in the folder. At this point, because the show / hide rule file was created when the user first entered the folder, it ensures that a show / hide rule file already exists in the folder. When the user enters the folder again, creating the show / hide rule file will fail, allowing the existing file to be read directly without waiting for the entire file to be traversed or for a timeout to trigger an exception, thus improving access efficiency.

[0081] According to the device access method 500 of the present invention, after successfully creating an empty display / hidden rule file in a folder, the created display / hidden rule file will be permanently saved in the folder, and the beneficial effect of permanent effectiveness can be achieved by creating it once.

[0082] In addition, the present invention also proposes a device access device. Figure 6 A schematic diagram of an access device 600 according to an embodiment of the present invention is shown. Figure 6 As shown, the device 600 includes a query module 610 and an information return module 620. Optionally, the device 600 also includes a relationship establishment module 630, a cache information clearing module 640, and a synchronization module 650.

[0083] The device access device 600 includes a query module 610, which is adapted to query the cache of the computing device for the existence of a display / hidden rule file corresponding to the folder in response to an operation of opening a folder in the device. It is also adapted to obtain the general resource identifier of the folder.

[0084] The information return module 620 is adapted to return the hidden file information stored in the display and hiding rule file corresponding to the folder when there is a display and hiding rule file in the cache, so that the corresponding file can be hidden when the file list in the folder is displayed.

[0085] The relationship establishment module 630 is suitable for establishing a correspondence between devices, folders and display / hidden rule files in the cache when there is no display / hidden rule file corresponding to the folder in the cache. It determines whether there is a corresponding display / hidden rule file in the folder. If there is a corresponding display / hidden rule file in the folder, the display / hidden rule file is stored in the cache. Otherwise, an empty display / hidden rule file corresponding to the combination of device and folder is created in the cache.

[0086] The cache information clearing module 640 is adapted to, in response to the operation of mounting the device to the computing device, obtain the device identifier of the device, query whether there is a folder and display / hidden rule file corresponding to the device identifier in the cache of the computing device, and if there is, delete the device identifier and its corresponding folder and display / hidden rule file stored in the cache.

[0087] The synchronization module 650 is adapted to synchronize the display / hidden rule file corresponding to the combination of the device and the folder in the cache in response to changes in the display or hidden state of files in a folder of the device. It is also adapted to determine whether a corresponding display / hidden rule file exists in the folder. If a corresponding display / hidden rule file exists in the folder, the correspondence between the combination of the device and the folder and the display / hidden rule file in the folder is synchronized and stored in the cache; otherwise, a display / hidden rule file storing the hidden state of the file list in the folder is created, and the correspondence between the device, the folder, and the created display / hidden rule file is stored in the cache of the computing device.

[0088] It should be noted that the working principles and processes of the query module 610, information return module 620, relationship establishment module 630, cache information clearing module 640, and synchronization module 650 are similar to those of the aforementioned device access methods 200-400. For details, please refer to the descriptions in the aforementioned device access methods 200-400, which will not be repeated here.

[0089] The present invention also proposes another device access device. Figure 7 A schematic diagram of an access device 700 of a device according to another embodiment of the present invention is shown. Figure 7 As shown, the device 700 includes a creation module 710 and an information return module 720. Optionally, the device 700 also includes a prompting module 730.

[0090] The device access device 700 includes a creation module 710, which is adapted to create an empty display / hidden rules file in a folder in response to an operation of opening a folder in the device.

[0091] The information return module 720 is suitable for reading the original display / hidden rule file in the folder and returning the hidden file information stored in the original display / hidden rule file when creating an empty display / hidden rule file in the folder fails, so that the corresponding files can be hidden when the file list in the folder is displayed.

[0092] The prompt module 730 is suitable for prompting that there are no hidden files in the folder when an empty show / hide rule file is successfully created in the folder.

[0093] It should be noted that the working principles and processes of the creation module 710, the information return module 720, and the prompt module 730 are similar to those of the aforementioned device access method 500. For details, please refer to the description in the aforementioned device access method 500, which will not be repeated here.

[0094] Furthermore, this invention also tested its device access method for slow devices by mounting a mobile phone that transmits data based on the MTP protocol on a computing device. Specifically, the time required for all files in five folders on the slow device to be displayed was tested. The five folders selected for the test are shown in Table 1 below. The five folders correspond to different paths, and each folder contains a different number of files. Figure 8 A schematic diagram illustrating the test results of a device access method according to an embodiment of the present invention is shown. Figure 8 As shown, the time taken before optimization was the time required to display all files in a folder on a slow device after opening it using the access method of the present invention. The time taken after optimization was the time required to display all files in a folder on a slow device after the first opening using the access method of the present invention. The time taken to open the folder again after optimization was the time required to display all files in a folder on a slow device after opening it again using the access method of the present invention. It is evident that the excessively long time taken to access device folders is significantly improved after using the access method of the present invention. The time taken after optimization is much lower than the time taken before optimization, and the time taken to open the folder a second time after optimization is also significantly lower than the time taken after optimization. Moreover, the more files in the folder, the more significant the improvement effect of the access method of the present invention. Therefore, the access method of the present invention has the beneficial effect of improving the access speed of slow devices and enhancing the user experience.

[0095] Table 1:

[0096]

[0097]

[0098] According to the technical solution of the present invention, after the device is mounted to the computing device, in response to the operation of opening a folder on the device, the system queries the computing device cache to see if a display / hidden rule file corresponding to the folder exists. If it exists, the system directly returns the hidden file information stored in the display / hidden rule file, and displays or hides the files in the folder accordingly when displaying the file list. If it does not exist, the system establishes a correspondence between the device, folder, and display / hidden rule file in the cache. In this way, since the correspondence between the device, folder, and display / hidden rule file is already established in the cache, the system can more quickly retrieve the corresponding display / hidden rule file when the user re-enters the folder. Moreover, since the display / hidden rule file is established in the cache, no additional display / hidden rule files are created on the mounted device, thus protecting the integrity of the device data.

[0099] According to another technical solution provided by the present invention, after the device is mounted on the computing device, in response to the operation of opening a folder in the device, an empty display / hidden rule file is directly created in the folder. If the creation fails, the original display / hidden rule file is directly read, and the hidden file information stored in the display / hidden rule file is returned. According to the hidden file information, when displaying the file list in the folder, the files in the folder are displayed or hidden accordingly.

[0100] Furthermore, if creating an empty show / hide rule file in the folder is successful, it indicates that there are no hidden files in the folder. The created show / hide rule file is permanently valid. When the user re-enters the folder or remounts the device to a computing device, since the show / hide rule file already exists in the folder, the computing device can directly read it, improving the speed of displaying or hiding files in the folder.

[0101] 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.

[0102] When the program code is executed on a programmable computer, the mobile terminal 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 device access method of the present invention according to instructions in the program code stored in the memory.

[0103] 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.

[0104] 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.

[0105] 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.

[0106] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.

[0107] 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 further divided into multiple sub-modules.

[0108] 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.

[0109] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0110] 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.

[0111] 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.

[0112] Although the invention has been described with respect 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 edibility 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 rather than restrictive, and the scope of the invention is defined by the appended claims.

Claims

1. A method for accessing a device, executed in a computing device, wherein the operating system of the computing device is a Unix-based desktop system, the method comprising: In response to opening a folder on the device, the system queries the cache of the computing device to see if a display / hidden rule file corresponding to the folder exists. The device includes devices mounted based on the MTP protocol or USB 2.

0. If they exist, the hidden file information stored in the display / hide rules file is returned so that the corresponding files are hidden when the file list in the folder is displayed; If it does not exist, then establish the correspondence between the device, the folder and the display / concealment rule file in the cache; Determine if a corresponding show / hide rule file exists in the folder; If a corresponding display / concealment rule file exists in the folder, then the display / concealment rule file is stored in the cache; Otherwise, create an empty show / hide rule file in the cache corresponding to the combination of the device and the folder.

2. The method according to claim 1, further comprising: In response to the operation of attaching the device to the computing device, the device identifier of the device is obtained; Check if the cache of the computing device contains the folder and display / hidden rule file corresponding to the device identifier; If it exists, delete the device identifier and its corresponding folder and display / hidden rule file stored in the cache.

3. The method according to claim 2, wherein, Following the operation of opening a folder on the device, the method further includes: Obtain the generic resource identifier of the folder; The display / concealment rule file corresponding to the folder is the display / concealment rule file corresponding to the combination of the device identifier of the device and the general resource identifier of the folder.

4. The method according to any one of claims 1 to 3, further comprising: In response to a change in the display or hiding status of files in the device's folder, the display / hiding rule file corresponding to the combination of the device and the folder in the cache is synchronized.

5. The method according to claim 4, wherein, The step of synchronizing the display / hidden rule file corresponding to the combination of the device and the folder in the cache includes: Determine if the corresponding show / hide rule file exists in this folder; If a corresponding display / hidden rule file exists in the folder, the correspondence between the combination of the device and the folder and the display / hidden rule file in the folder is synchronously stored in the cache; Otherwise, create a display / hidden rules file that stores the hidden status of the file list in the folder, and store the correspondence between the device, the folder, and the created display / hidden rules file in the cache of the computing device.

6. An access device for a device, the device comprising: The query module is adapted to respond to the operation of opening a folder in the device by querying whether there is a display / hidden rule file corresponding to the folder in the cache of the computing device, wherein the device includes a device mounted based on the MTP protocol or USB 2.0, and the operating system of the computing device is a Unix desktop system; The information return module is adapted to return the hidden file information stored in the display and hiding rule file when there is a display and hiding rule file corresponding to the folder in the cache, so that the corresponding file can be hidden when the file list in the folder is displayed; The relationship establishment module is adapted to establish a correspondence between the device, the folder and the display / hidden rule file in the cache when there is no display / hidden rule file corresponding to the folder in the cache, determine whether there is a corresponding display / hidden rule file in the folder, and if there is a corresponding display / hidden rule file in the folder, store the display / hidden rule file in the cache; otherwise, create an empty display / hidden rule file in the cache corresponding to the combination of the device and the folder.

7. 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 claimed in any one of claims 1 to 5.

8. 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 to 5.

Citation Information

Patent Citations

  • Hidden method, mobile terminal and computer readable storage medium

    CN109740374A

  • Method and system for solving repeated scanning of external storage device and storage medium

    CN109951731A