Storage path management method, device, medium and computing device

The environment is isolated through the reflection mechanism and the storage paths are uniformly and uniformly regulating using annotation information and path management classes, solving the problems of limited visibility of storage directories and low search efficiency in terminal applications, and achieving efficient storage file search and management.

CN113342736BActive Publication Date: 2025-03-28NETEASE MEDIA TECH BEIJING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110620994.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-03
Publication Date
2025-03-28
Estimated Expiration
2041-06-03

AI Technical Summary

Technical Problem

In terminal applications, due to APP permission restrictions and scattered storage directories, the visibility of storage directories is limited, the search efficiency is low, and it is difficult to unify.

Method used

By using the reflection mechanism to isolate the production environment and debugging environment, and using annotation information and path management classes to uniformly orthogonalize the storage paths of the first application, generate a path management interface, and display the path management interface in the debugging environment to centrally manage the storage paths.

Benefits of technology

The relevant storage files of the first application can be accessed without root permissions, which improves the efficiency of searching storage files and simplifies the unified and standardized management of the storage paths of application-related files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113342736B_ABST
    Figure CN113342736B_ABST
Patent Text Reader

Abstract

The present disclosure provides a storage path management method, device, medium and computing device, the method comprising: using a reflection mechanism to isolate a production environment from a debugging environment; using annotation information and a path management class to unify and regularize the storage path of a first application, the path management class is used to save all storage path information of the first application; and obtaining a set of storage paths of the first application by parsing through the reflection mechanism in the debugging environment. According to the technical solution of the present disclosure, at least the query efficiency of storage files can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] In the terminal application (Application, referred to as APP), there are many scenarios that rely on local persistent storage, so it is necessary to generate a storage directory to organize all the storage files and make the storage files easier to access. In the related art, the file directory is opened through the system file manager. However, the system file manager cannot jump to the specified directory through the Uniform Resource Identifier (URI) in most read-only memories (Read-Only Memory, ROM), and root (ROOT) permissions are required to access the file directory. In short, due to APP permission restrictions, scattered storage directories and other problems, the visibility of the storage directory is limited, the search efficiency is low, and it is difficult to unify. Summary of the invention

[0004] The present disclosure provides a storage path management method, apparatus, medium and computing device, which can at least improve the search efficiency of storage files.

[0005] A first aspect of an embodiment of the present disclosure provides a storage path management method, including: using a reflection mechanism to isolate a production environment and a debugging environment; using annotation information and a path management class to unify and regularize the storage path of a first application, wherein the path management class is used to save all storage path information of the first application; and obtaining a set of storage paths of the first application through parsing through the reflection mechanism in the debugging environment.

[0006] In one embodiment of the present disclosure, the method further includes: generating a path management interface according to the set; and displaying the path management interface in the debugging environment.

[0007] In one embodiment of the present disclosure, generating a path management interface based on the set includes: parsing the path type information and annotation information of each storage path in the set through the reflection mechanism; and generating the path management interface based on the path type information and annotation information of each storage path in the set.

[0008] In one embodiment of the present disclosure, the path management interface is generated based on the path type information and the annotation information of each storage path in the set, including: classifying all the path type information of the set to obtain M different path types, where M is a positive integer; based on the annotation information corresponding to each path type, determining the entry information included in each path type; and mapping the entry information included in each path type to its corresponding path type.

[0009] In one embodiment of the present disclosure, while parsing the path type information and annotation information of each path type in the collection through the reflection mechanism, the method also includes: parsing the file type included in each storage path in the collection through the reflection mechanism, wherein the file type is used to identify the file type of the file stored under the same storage path, and the same storage path includes at least one file type.

[0010] In one embodiment of the present disclosure, the path management interface includes a path type and one or more entries included in the path type, and the method also includes: upon receiving a preset trigger operation for any entry on the path management interface, obtaining the file storage path directory of the entry based on the entry information corresponding to any entry and the path type information to which the any entry belongs.

[0011] In one embodiment of the present disclosure, the method of obtaining the file storage path directory of the entry according to the entry information corresponding to any one of the entries and the path type information to which the any one of the entries belongs includes: searching for a method function of the file storage path of any one of the directories in the collection through a reflection mechanism according to the entry information corresponding to any one of the entries and the path type information to which the any one of the entries belongs; and executing the method function through the reflection mechanism to obtain the file storage path directory of the entry.

[0012] In one embodiment of the present disclosure, the method further includes: after acquiring the file storage path directory, jumping to a location corresponding to the file storage path directory by calling a system file browser or a third-party file browser.

[0013] In one embodiment of the present disclosure, the path type includes at least one of the following: a first path type for storing screen saver files; a second path type for storing Android application packages; a third path type for storing data files; a fourth path type for storing font files; a fifth path type for storing image files; and a sixth path type that does not belong to the aforementioned types, the aforementioned types including the first path type, the second path type, the third path type, the fourth path type and the fifth path type.

[0014] In one embodiment of the present disclosure, the method also includes: when an operation on the first application is detected, storing the file generated by the operation; the storing the file generated by the operation also includes: naming the file according to a preset naming rule; wherein the preset naming rule includes: naming the file according to the naming rule corresponding to the file type, wherein different file types use different naming methods and suffix names.

[0015] A second aspect of an embodiment of the present disclosure provides a storage path management device, including: an isolation unit, used to isolate a production environment and a debugging environment using a reflection mechanism; a regularization unit, used to uniformly regularize the storage path of a first application using annotation information and a path management class, wherein the path management class is used to save all storage path information of the first application; and a management unit, used to parse the reflection mechanism in the debugging environment to obtain a set of storage paths of the first application.

[0016] In one embodiment of the present disclosure, the device further includes: a generating unit, configured to generate a path management interface according to the set; and a display unit, configured to display the path management interface in the debugging environment.

[0017] In one embodiment of the present disclosure, the generation unit includes: an acquisition subunit, used to parse the path type information and annotation information of each storage path in the collection through the reflection mechanism; and a generation subunit, used to generate the path management interface based on the path type information and the annotation information of each storage path in the collection.

[0018] In one embodiment of the present disclosure, the generating subunit is used to: classify all the path type information of the set to obtain M different path types, where M is a positive integer; determine the entry information included in each path type based on the annotation information corresponding to each path type; and map the entry information included in each path type to its corresponding path type.

[0019] In one embodiment of the present disclosure, the acquisition sub-unit is also used to: while parsing the path type information and annotation information of each path type in the collection through the reflection mechanism, parse the file type included in each storage path in the collection through the reflection mechanism, wherein the file type is used to identify the file type of the file stored under the same storage path, and the same storage path includes at least one file type.

[0020] In one embodiment of the present disclosure, the path management interface includes a path type and one or more entries included in the path type, and the device also includes: a response unit, which is used to obtain the file storage path directory of the entry based on the entry information corresponding to any entry and the path type information to which the any entry belongs when a preset trigger operation is received for any entry on the path management interface.

[0021] In one embodiment of the present disclosure, the response unit is used to: search for a method function of a file storage path of any directory in the collection through a reflection mechanism according to entry information corresponding to any entry and path type information to which any entry belongs; and execute the method function through the reflection mechanism to obtain the file storage path directory of the entry.

[0022] In one embodiment of the present disclosure, the response unit is further used to: after acquiring the file storage path directory, jump to the location corresponding to the file storage path directory by calling a system file browser or a third-party file browser.

[0023] In one embodiment of the present disclosure, the path type includes at least one of the following: a first path type for storing screen saver files; a second path type for storing Android application packages; a third path type for storing data files; a fourth path type for storing font files; a fifth path type for storing image files; and a sixth path type that does not belong to the aforementioned types, the aforementioned types including the first path type, the second path type, the third path type, the fourth path type and the fifth path type.

[0024] In one embodiment of the present disclosure, the device also includes: a storage unit, which is used to store files generated by an operation on the first application when the operation is detected; the storage unit is also used to: name the files according to a preset naming rule; wherein the preset naming rule includes: naming the files according to the naming rule corresponding to the file type, wherein different file types use different naming methods and suffix names.

[0025] A third aspect of the embodiments of the present disclosure provides a medium storing a computer program, which implements the method of the aforementioned embodiments when executed by a processor.

[0026] The fourth aspect of the embodiments of the present disclosure provides a computing device, comprising: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the aforementioned embodiments.

[0027] According to the disclosed embodiment, the production environment and the debugging environment are isolated by using the reflection mechanism; the storage path of the first application is unified and regularized by using the annotation information and the path management class, and the path management class is used to save all the storage path information of the first application; the set of storage paths of the first application is obtained by parsing through the reflection mechanism in the debugging environment. In this way, by using the reflection mechanism to isolate the production environment and the debugging environment, and using the annotation information and the path management class to unify and regularize the storage path of the first application, the relevant storage files of the first application can be accessed without the root (ROOT) permission, which can improve the search efficiency of the storage files. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:

[0029] Figure 1 A storage path management method process according to an embodiment of the present disclosure Figure 1 ;

[0030] Figure 2 A storage path management method process according to an embodiment of the present disclosure Figure 2 ;

[0031] Figure 3 is a schematic diagram of a path management interface according to an embodiment of the present disclosure;

[0032] Figure 4 A flowchart of generating a path management interface according to a set according to an embodiment of the present disclosure;

[0033] Figure 5 A flowchart of generating a path management interface according to path type information and annotation information according to an embodiment of the present disclosure;

[0034] Figure 6 is a schematic diagram of a path management interface of a file directory of an exemplary APP according to an embodiment of the present disclosure;

[0035] Figure 7 A storage path management method process according to an embodiment of the present disclosure Figure 3 ;

[0036] Figure 8 A storage path management method process according to an embodiment of the present disclosure Figure 4 ;

[0037] Fig. 9 A schematic diagram of the implementation principle of storage path management according to an embodiment of the present disclosure;

[0038] Fig.10 This is a schematic diagram of a debugging configuration interface of an exemplary APP according to an embodiment of the present disclosure;

[0039] Fig.11 is a schematic diagram of a non-volatile storage medium according to an embodiment of the present disclosure;

[0040] Fig.12 The structure diagram of the storage path management device according to one embodiment of the present disclosure is as follows: Figure 1 ;

[0041] Fig.13 The structure diagram of the storage path management device according to one embodiment of the present disclosure is as follows: Figure 2 ;

[0042] Fig.14 is a schematic diagram of a computing device structure according to an embodiment of the present disclosure;

[0043] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0044] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0045] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0046] According to an embodiment of the present disclosure, a storage path management method, apparatus, medium and computing device are proposed.

[0047] In this document, any number of elements in the drawings is used for illustration rather than limitation, and any naming is used only for distinction and does not have any limiting meaning.

[0048] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure. SUMMARY OF THE INVENTION

[0050] The applicant has found that in the terminal APP, there are many scenarios that rely on local persistent storage, so it is necessary to generate a storage directory to organize all storage files and make the storage files easier to access. However, due to problems such as APP permission restrictions and scattered storage directories, the visibility of the storage directory is limited, the search efficiency is low, and it is difficult to unify. When facing the need to view the database directory or log directory in the development environment, it is very difficult to search through the code, consult the information, or use self-testing methods to find the standard file directory, which is time-consuming and labor-intensive, and the search efficiency is low.

[0051] In view of this, the present disclosure provides a storage path management method, apparatus, medium and computing device, the storage path management method comprising: isolating a production environment and a debugging environment using a reflection mechanism; unifying and regularizing the storage path of a first application using annotation information and a path management class, the path management class being used to save all storage path information of the first application; and obtaining a set of storage paths of the first application by parsing through the reflection mechanism in the debugging environment.

[0052] In this way, by using the reflection mechanism to isolate the production environment from the debugging environment, the calling method between the service method and the service component can be flexibly configured, reducing the correlation coupling of the system interface; at the same time, it is no longer necessary to introduce a large number of interface definition specifications and environments, which improves the development efficiency of the system, reduces the difficulty of system maintenance and migration deployment, and is conducive to the modularization of the program. By using annotation information and path management classes to unify and regularize the storage path of the first application, the collection of storage paths of the first application is obtained by parsing the reflection mechanism in the debugging environment, which can facilitate the centralized management of all storage paths of the first application, and does not require ROOT permissions when accessing the data directory, which can improve the efficiency of finding related files of the first application; in addition, compared with the way the file manager manages storage files, the disclosed method can more simply and directly unify and standardize the storage paths of the related files of the first application, and has good applicability and scalability.

[0053] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.

[0054] Exemplary Methods

[0055] The present disclosure provides a storage path management method, such as Figure 1 As shown, including:

[0056] S101: Use reflection mechanism to isolate the production environment from the debugging environment;

[0057] S102: unifying and regularizing the storage path of the first application by using annotation information and a path management class, wherein the path management class is used to store all storage path information of the first application;

[0058] S103: Obtaining a set of storage paths of the first application by parsing through the reflection mechanism in the debugging environment.

[0059] This embodiment can be applied to electronic devices, including but not limited to fixed devices and / or mobile devices. For example, fixed devices include but are not limited to fixed terminals, such as smart TVs, smart projectors, etc. For example, mobile devices include but are not limited to terminal devices, such as smart phones, tablet computers, etc.

[0060] In S101, the reflection mechanism refers to the JAVA reflection mechanism. In the running state, for any class, the properties and methods of this class can be known; for any object, any method and property of it can be called. This function of dynamically obtaining information and dynamically calling the method of an object is called the JAVA reflection mechanism. The principles of reflection include: 1. Determine the class to which any object belongs at runtime; 2. Construct an object of any class at runtime; 3. Determine the member variables and methods of any class at runtime; 4. Call the method of any object at runtime.

[0061] In S101, the production environment refers to the environment where external services are officially provided, usually the real environment, that is, the environment that is finally delivered to users. The debugging environment can also be understood as a test environment, which is a transitional environment from the development environment to the production environment. Generally speaking, the debugging environment will be as similar as possible to the production environment.

[0062] In S101, the first application is an application installed on the terminal. The present disclosure does not limit the type of the first application. The first application can be an application built into the terminal or an application downloaded and installed by the terminal from a third party.

[0063] In S102 , annotations are a type of metadata that provides data related to a program, but the annotations do not belong to the program itself.

[0064] In S103, all storage paths of the first application include, but are not limited to: the storage path of the relevant record files of the user's use of the first application, and the storage path of the system files of the first application. Exemplarily, the storage path of the relevant record files of the user's use of the first application includes, but is not limited to: the storage path of the record files of the user's last use of the first application, and the storage path of the record files of the user's first use of the first application. Exemplarily, the storage path of the system files of the first application includes, but is not limited to: the storage path of the original system files of the first application, and the storage path of the updated system files of the first application. In actual processing, the storage path of the first application may include more situations, which are not exhaustive in this embodiment.

[0065] Among them, using the reflection mechanism to isolate the production environment and the debugging environment can include: the path set of the storage files of the first application is located in the production environment of the project, and in the debugging environment isolated from the production environment, the reflection mechanism is needed to obtain the path set of the first application in the production environment.

[0066] Among them, using annotation information and path management class to unify and regularize the storage path of the first application can include: obtaining a path set of storage files of the first application through a reflection mechanism; parsing the path type information and annotation information of each path in the path set through a reflection mechanism; generating a path management interface based on the path type information and the annotation information of each path in the path set; and unifying and regularizing the storage path of the first application through the path management interface.

[0067] Among them, obtaining the set of storage paths of the first application by parsing through the reflection mechanism in the debugging environment may include: finding the relevant method function in the path set by means of the reflection mechanism, and executing the method function by reflection to obtain the storage path of the storage file under each path type; and then obtaining the set of all storage paths of the first application by statistics.

[0068] According to the method described in this embodiment, the production environment and the debugging environment are isolated by using the reflection mechanism, and the calling method between the service method and the service component can be flexibly configured, which reduces the correlation coupling of the system interface; at the same time, it is no longer necessary to introduce a large number of interface definition specifications and environments, which improves the development efficiency of the system, reduces the difficulty of system maintenance and migration deployment, and is conducive to the modularization of the program. By using annotation information and path management classes to unify and regularize the storage path of the first application, the collection of storage paths of the first application is obtained by parsing through the reflection mechanism in the debugging environment, which can facilitate the centralized management of all storage paths of the first application, and does not require ROOT permissions when accessing the data directory, thereby helping to improve the efficiency of finding related files of the first application; in addition, compared with the way the file manager manages storage files, the method described in this disclosure can more simply and directly centrally manage the storage paths of the related files of the first application.

[0069] based on Figure 1 The storage path management method shown, in some embodiments, Figure 2 As shown, the method may also include:

[0070] S104: Generate a path management interface according to the set;

[0071] S105: Displaying the path management interface in the debugging environment.

[0072] The path management interface includes a path type and one or more items included in the path type.

[0073] The path type may include at least one of the following:

[0074] The first path type for storing screen saver files (After Dark Screensaver, AD);

[0075] A second path type for storing an Android application package (APK);

[0076] The third path type for storing data files (data);

[0077] The fourth path type for storing font files (font);

[0078] The fifth path type for storing image files (IMG);

[0079] A sixth path type that does not belong to the aforementioned types, the aforementioned types including the first path type, the second path type, the third path type, the fourth path type and the fifth path type.

[0080] Here, the sixth path type may be understood as other path types except for the aforementioned types.

[0081] Figure 3 A schematic diagram of the path management interface is shown, such as Figure 3 As shown, the path management interface includes a first path type, a second path type, a third path type, a fourth path type, a fifth path type and a sixth path type, wherein the first path type includes entry 1 and entry 2, the second path type includes entry 3 and entry 4, the third path type includes entry 5, the fourth path type includes entry 6, the fifth path type includes entry 7 and entry 8, and the sixth path type includes entry 9, entry 10 and entry 11.

[0082] It is understandable that the above Figure 3 The number of path types in the path management interface shown is schematic and can be set or adjusted according to actual needs. The number of entries included in each path type in the path management interface is also schematic and can also be set or adjusted according to actual needs.

[0083] based on Figure 2 The storage path management method shown, in some embodiments, Figure 4 As shown, generating a path management interface according to the set may include:

[0084] S104a: parsing the path type information and annotation information of each storage path in the set through the reflection mechanism;

[0085] S104b: Generate the path management interface based on the path type information and the annotation information of each storage path in the set.

[0086] Table 1 shows some annotations corresponding to the path types and their usage scenarios.

[0087]

[0088]

[0089] Table 1

[0090] For example, after the user opens the first application for the first time, the terminal saves the timestamp of the user opening the first application for the first time. The next time the user opens the first application, it is necessary to identify whether the user is a new user based on the timestamp. In this situation, it is necessary to check the user usage record cache address.

[0091] For example, if the first application needs to upgrade its version, it needs to download the installation package and save the installation package in a specified directory. In this situation, it is necessary to check the cache address of the upgrade package.

[0092] Through the above implementation, the path type information and annotation information of each storage path in the set can be parsed without ROOT permission, and then a path management interface can be generated, thereby facilitating unified management of all storage files of the first application through the path management interface.

[0093] based on Figure 4 The storage path management method shown, in some embodiments, Figure 5 As shown, generating the path management interface based on the path type information and the annotation information of each storage path in the set may include:

[0094] S104b1: Classify all the path type information of the set to obtain M different path types, where M is a positive integer;

[0095] S104b2: Determine the entry information included in each path type based on the annotation information corresponding to each path type;

[0096] S104b3: Map the entry information included in each path type to its corresponding path type.

[0097] In this embodiment, there is no mandatory limit on the number of M. The value of M can be selected according to actual conditions, such as the degree of refinement of the path type.

[0098] Through the above implementation, a path management interface can be generated according to the set, so that all storage files of the first application can be managed uniformly through the path management interface.

[0099] Figure 6 A schematic diagram showing a path management interface of a file directory of an exemplary APP is shown as follows: Figure 6As shown, the file directory path management interface of the exemplary APP includes path types such as IMG, AD, APK, FONT, DATA and OTHER, among which the entries under the AD path type include the download location of the second screen advertisement at startup, the barrage advertisement resource directory and the video advertisement cache address (this entry is dedicated to the startup page video advertisement because it involves clearing logic); the entries under the APK path type include the channel exchange package cache address and the upgrade package cache address; the entries under the DATA path type include the Database directory and the SharedPreference directory; the entries under the FONT path type include the font download path; the entries under the IMG path type include the image download path, the Glide image cache directory and the DiskLruCache cache image directory; the entries under the OTHER path type include the Banner Css path, the zip temporary file path of Banner Css, the voice comment temporary storage recording file, the file download address (upgrade, offline cache) and the DiskLruCache cache object directory.

[0100] It should be understood that the types and quantities of path types corresponding to different first applications may be different, and the names and quantities of entries under the path types corresponding to different first applications may be different.

[0101] It should be understood that Figure 6 The path management interface shown is an optional specific implementation method, and those skilled in the art can Figure 6 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0102] based on Figure 4 In some embodiments of the storage path management method, while parsing the path type information and annotation information of each path type in the set through a reflection mechanism, the method further includes:

[0103] The file type included in each storage path in the set is parsed through the reflection mechanism, wherein the file type is used to identify the file type of the file stored in the same storage path, and the same storage path includes at least one file type.

[0104] To facilitate the display of the test tool, when adding a file path, you need to add a corresponding directory acquisition method in FilePathUtil and add a method annotation to the method. For example, the code snippet is as follows:

[0105]

[0106] In the above code, the first APK is used for grouping, the second APK is used for identification, which is specifically viewed and used by developers or testers, and the third info is the entry or file under the first APK.

[0107] The parameters in FilePathType are described as follows:

[0108] "pathType" is a separator item in the list, only supports a single type, and the default value is other;

[0109] "info" is the name of the link that jumps to the path displayed in the list;

[0110] "fileType" is only used for identification, to identify the corresponding file type in the directory, and supports identification of multiple file types in the same directory. The default value is other. For example, the code snippet is as follows:

[0111]

[0112] It should be understood that the above two code snippets are merely illustrative and are not exhaustive.

[0113] The above implementation method makes it easy for developers or testers to find and trace problems based on file types and annotation information.

[0114] based on Figure 2 The storage path management method shown, in some embodiments, Figure 7 As shown, the path management interface includes a path type and one or more items included in the path type, and the method further includes:

[0115] S106: When a preset trigger operation for any entry on the path management interface is received, the file storage path directory of the entry is obtained according to the entry information corresponding to the entry and the path type information to which the entry belongs.

[0116] It should be noted that this embodiment does not limit the operation type of the preset operation. Exemplarily, the operation type includes but is not limited to manual triggering operation or voice triggering operation.

[0117] Through the above implementation, the file storage path directory is obtained only when a preset trigger operation is received, and whether to obtain the file storage path directory can be determined according to the actual needs of the user, thereby improving the user experience.

[0118] In some embodiments of the present disclosure, obtaining a file storage path directory of any entry according to entry information corresponding to any entry and path type information to which any entry belongs includes:

[0119] A method function (method) for searching the file storage path of any directory in the collection through a reflection mechanism according to the entry information corresponding to any entry and the path type information to which any entry belongs;

[0120] The method function is executed through the reflection mechanism to obtain the file storage path directory of the entry.

[0121] Through the above implementation method, the file storage path directory can be accessed without ROOT permission, which helps to improve the efficiency of finding related files of the first application.

[0122] Furthermore, in some embodiments, the method may further include:

[0123] After obtaining the file storage path directory, jump to the location corresponding to the file storage path directory by calling a system file browser or a third-party file browser.

[0124] Here, third-party file browsers are relative to system file browsers.

[0125] Through the above implementation, after obtaining the file storage path directory, by calling the system file browser or a third-party file browser, jumping to the location corresponding to the file storage path directory is improved, thereby improving the speed of querying the target storage file and helping users quickly lock and view related storage files.

[0126] based on Figure 1 The storage path management method shown, in some embodiments, Figure 8 As shown, the method may also include:

[0127] S107: When an operation on the first application is detected, a file generated by the operation is stored.

[0128] It should be noted that this embodiment does not limit the operation type of the operation. Exemplarily, the operation type includes but is not limited to manual operation or voice operation.

[0129] In this way, data support is provided for subsequent queries of related storage files of the first application.

[0130] The step of storing the files generated by the operation includes:

[0131] Naming the file according to a preset naming rule;

[0132] The preset naming rules include:

[0133] The file is named according to the naming rules corresponding to the file type, wherein different file types use different naming methods and suffix names.

[0134] That is to say, files of the same file type are named using the same naming method, and files of the same file type are named using the same suffix name.

[0135] Table 2 shows some of the naming rules.

[0136]

[0137] Table 2

[0138] It should be understood that the rules, suffixes, usage methods, application scenarios, and online usage scenarios shown in Table 2 are merely illustrative and are not exhaustive.

[0139] It should be noted that when naming, you also need to pay attention to the following Android general file name restrictions.

[0140] 1. The file name cannot contain special characters |\ / :*? "<>';

[0141] 2. The maximum length of a file name is 255 (including the suffix);

[0142] 3. The file name and extension cannot be empty at the same time.

[0143] Through the above implementation, a naming method for storage files is provided, in which files generated by operations on the first application are named and stored according to preset naming rules, which can facilitate unified and standardized management of storage files and improve the speed of subsequent parsing to obtain the entire storage path set, thereby helping to quickly find the target storage file.

[0144] Fig. 9 The schematic diagram of the implementation principle of storage path management is shown as follows: Fig. 9As shown, NRFilePath is a collection of all FilePathTypes, which is located in the production environment of the project. In the debugging environment, which is isolated from the production environment, reflection is required to obtain the FilePathType collection in the NRFilePath of the production environment, and parse the pathType and info information through reflection, sort the pathType, and save the info information in different pathTypes. Then display the info and PathType collections on the interface. When the info information is clicked, the jump method is processed in the click event. The combination of PathType and info information is used as a unique identifier. The relevant Method is found in NRFilePath through reflection. The method is executed through reflection to obtain the file path. After obtaining the file path, jump to the corresponding directory by calling the system file browser or a third-party file browser.

[0145] It can be seen that this method uses the reflection mechanism to isolate the production environment from the debugging environment, uses annotations and path management classes to unify and regularize the paths in the mobile APP, and parses all sets through reflection, processes the data and displays it on the debugging interface. By clicking the corresponding info item on the debugging interface, the file directory can be parsed again through reflection call, and at the same time, it can jump to the corresponding position in the file browser, so that the target file can be found quickly. The operation is simple and easy to implement, so that different testers or maintenance personnel can quickly find the target file, thereby providing data support for subsequent testing or maintenance of the first application.

[0146] It should be understood that Fig. 9 The implementation principle of the storage path management shown is an optional specific implementation method, and those skilled in the art can Fig. 9 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0147] Below, a schematic description is given by taking the first application as an exemplary APP as an example.

[0148] The method described in the present disclosure is compiled to generate a file management tool, which includes functions such as viewing files and deleting files. The file management tool is built into the client of the exemplary APP. The user selects "jump to file directory" in the debug configuration interface of the exemplary APP to enter the file directory list. The schematic diagram of the debug configuration interface of the exemplary APP is shown in FIG. Fig.10 As shown, the interface diagram of the entered file directory list is as follows Figure 6 As shown. In this way, you do not need ROOT privileges to access the data directory from the file management tool, and you can jump to the specified directory.

[0149] Exemplary Media

[0150] After introducing the method of the exemplary embodiment of the present disclosure, next, refer to Fig.11 A medium according to an exemplary embodiment of the present disclosure is described.

[0151] In some possible embodiments, various aspects of the present disclosure may also be implemented as a computer-readable medium having a program stored thereon, which, when executed by a processor, is used to implement the steps of the storage path management method according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.

[0152] Specifically, when the above-mentioned processor executes the above-mentioned program, it is used to implement the following steps: using the reflection mechanism to isolate the production environment and the debugging environment; using annotation information and path management class to unify and regularize the storage path of the first application, and the path management class is used to save all storage path information of the first application; in the debugging environment, the collection of storage paths of the first application is obtained by parsing through the reflection mechanism.

[0153] It should be noted that the above-mentioned medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0154] like Fig.11 As shown, a non-volatile storage medium 1100 according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include a program and can be run on a device. However, the present disclosure is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device.

[0155] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to: electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0156] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN).

[0157] Exemplary Devices

[0158] After introducing the method according to the exemplary embodiment of the present disclosure, next, the device according to the exemplary embodiment of the present disclosure will be described.

[0159] The present disclosure provides a storage path management device such as Fig.12 As shown, the storage path management device includes: an isolation unit 1201, used to isolate the production environment and the debugging environment by using a reflection mechanism; a regularization unit 1202, used to uniformly regularize the storage path of the first application by using annotation information and a path management class, and the path management class is used to save all storage path information of the first application; a management unit 1203, used to parse the collection of storage paths of the first application through the reflection mechanism in the debugging environment.

[0160] In one embodiment of the present disclosure, Fig.13 As shown, the device may also include:

[0161] The generating unit 1204 is used to generate a path management interface according to the set; the display unit 1205 is used to display the path management interface in the debugging environment.

[0162] In one embodiment of the present disclosure, the generation unit 1204 includes: an acquisition subunit, used to parse the path type information and annotation information of each storage path in the collection through the reflection mechanism; and a generation subunit, used to generate the path management interface based on the path type information and the annotation information of each storage path in the collection.

[0163] In one embodiment of the present disclosure, the generating subunit is used to: classify all the path type information of the set to obtain M different path types, where M is a positive integer; determine the entry information included in each path type based on the annotation information corresponding to each path type; and map the entry information included in each path type to its corresponding path type.

[0164] In one embodiment of the present disclosure, the acquisition sub-unit is also used to: while parsing the path type information and annotation information of each path type in the collection through the reflection mechanism, parse the file type included in each storage path in the collection through the reflection mechanism, wherein the file type is used to identify the file type of the file stored under the same storage path, and the same storage path includes at least one file type.

[0165] In one embodiment of the present disclosure, the path management interface includes a path type and one or more items included in the path type, such as Fig.13 As shown, the device may also include: a response unit 1206, which is used to obtain the file storage path directory of the entry based on the entry information corresponding to any entry and the path type information to which any entry belongs when a preset trigger operation is received for any entry on the path management interface.

[0166] In one embodiment of the present disclosure, the response unit 1206 is used to: search for a method function of a file storage path of any directory in the collection through a reflection mechanism according to entry information corresponding to any entry and path type information to which any entry belongs; and execute the method function through the reflection mechanism to obtain the file storage path directory of the entry.

[0167] In one embodiment of the present disclosure, the response unit 1206 is further used to: after acquiring the file storage path directory, jump to the location corresponding to the file storage path directory by calling a system file browser or a third-party file browser.

[0168] In one embodiment of the present disclosure, the path type includes at least one of the following: a first path type for storing screen saver files; a second path type for storing Android application packages; a third path type for storing data files; a fourth path type for storing font files; a fifth path type for storing image files; and a sixth path type that does not belong to the aforementioned types, the aforementioned types including the first path type, the second path type, the third path type, the fourth path type and the fifth path type.

[0169] In one embodiment of the present disclosure, Fig.13 As shown, the device also includes: a storage unit 1207, which is used to store the file generated by the operation when an operation on the first application is detected; the storage unit 1207 is also used to: name the file according to a preset naming rule; wherein the preset naming rule includes: naming the file according to the naming rule corresponding to the file type, wherein different file types use different naming methods and suffix names.

[0170] The functions of each module in the storage path management device of the present invention can be found in the corresponding description of the above method, which will not be repeated here.

[0171] The storage path management device disclosed in the present invention can centrally manage all storage paths of the first application, and does not require ROOT permissions when accessing the data directory, thereby helping to improve the efficiency of finding related files of the first application.

[0172] Exemplary Computing Devices

[0173] After introducing the method, medium and apparatus of the exemplary embodiments of the present disclosure, next, reference is made to Fig.14 A computing device according to an exemplary embodiment of the present disclosure is described.

[0174] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0175] In some possible implementations, a computing device according to an implementation of the present disclosure may include at least one processing unit and at least one storage unit. The storage unit stores program code, and when the program code is executed by the processing unit, the processing unit executes the steps of the storage path management method according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.

[0176] Refer to the following Fig.14 1400 according to this embodiment of the present disclosure is described. Fig.14 The computing device 1400 shown is merely an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present disclosure.

[0177] like Fig.14 As shown, the computing device 1400 is in the form of a general computing device. The components of the computing device 1400 may include but are not limited to: at least one processing unit 1401, at least one storage unit 1402, and a bus 1403 connecting different system components (including the processing unit 1401 and the storage unit 1402).

[0178] The bus 1403 includes a data bus, a control bus, and an address bus.

[0179] The storage unit 1402 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 14021 and / or a cache memory 14022 , and may further include a readable medium in the form of a non-volatile memory, such as a read-only memory (ROM) 14023 .

[0180] The storage unit 1402 may also include a program / utility 14025 having a set (at least one) of program modules 14024, such program modules 14024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0181] The computing device 1400 may also communicate with one or more external devices 1404 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 1405. Furthermore, the computing device 1400 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1406. Fig.14 As shown, network adapter 1406 communicates with other modules of computing device 1400 via bus 1403. It should be understood that although Fig.14 Not shown, other hardware and / or software modules may be used in conjunction with computing device 1400, including but not limited to microcode, device drivers, redundant processing units, redundant arrays of independent disks (RAID) systems, tape drives, and data backup storage systems.

[0182] It should be noted that although several units / modules or sub-units / sub-modules of the storage path management device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided to be embodied by multiple units / modules.

[0183] In addition, although the operations of the disclosed method are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0184] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.

Claims

1. A storage path management method, comprising: Use reflection mechanism to isolate the production environment from the debugging environment; The storage path of the first application is uniformly organized by using annotation information and a path management class, wherein the path management class is used to store all storage path information of the first application; Obtaining a set of storage paths of the first application by parsing through the reflection mechanism in the debugging environment; Wherein, the use of the reflection mechanism to isolate the production environment from the debugging environment includes: Setting the set of storage paths of the first application in the production environment, so that a debugging environment isolated from the production environment obtains the set of storage paths of the first application in the production environment through the reflection mechanism; The step of using the annotation information and the path management class to uniformly regulate the storage path of the first application includes: Acquire a set of storage paths of the first application through the reflection mechanism, and parse the path type information and annotation information of each storage path in the set through the reflection mechanism; Generate a path management interface based on the path type information and the annotation information of each storage path in the set; the path management interface includes a path type and one or more entries of the path type; The storage path of the first application is unified and regularized through the path management interface.

2. The method according to claim 1, wherein: The method further comprises: The path management interface is displayed in the debugging environment.

3. The method according to claim 1, wherein: The generating the path management interface based on the path type information and the annotation information of each storage path in the set includes: Classify all the path type information of the set to obtain M different path types, where M is a positive integer; Based on the annotation information corresponding to each of the path types, determining the entry information included in each of the path types; The entry information included in each path type is mapped to the corresponding path type.

4. The method according to claim 1, wherein: While parsing the path type information and annotation information of each storage path in the set through the reflection mechanism, the method further includes: The file type included in each storage path in the set is parsed through the reflection mechanism, wherein the file type is used to identify the file type of the file stored in the same storage path, and the same storage path includes at least one file type.

5. The method according to claim 2, wherein: The method further comprises: When a preset trigger operation for any entry on the path management interface is received, the file storage path directory of the entry is obtained according to the entry information corresponding to the entry and the path type information to which the entry belongs.

6. The method according to claim 5, wherein: The acquiring, according to the entry information corresponding to any one of the entries and the path type information to which any one of the entries belongs, a file storage path directory of the entry, comprises: According to the entry information corresponding to the any entry and the path type information to which the any entry belongs, a method function for searching the file storage path of the any entry in the collection through a reflection mechanism; The method function is executed through the reflection mechanism to obtain the file storage path directory of the entry.

7. The method according to claim 6, wherein: The method further comprises: After obtaining the file storage path directory, jump to the location corresponding to the file storage path directory by calling a system file browser or a third-party file browser.

8. The method according to claim 1, wherein: The path type includes at least one of the following: The first path type where the screen saver files are stored; A second path type for storing Android application packages; A third path type for storing data files; The fourth path type for storing font files; The fifth path type for storing image files; A sixth path type that does not belong to the aforementioned types, wherein the aforementioned types include the first path type, the second path type, the third path type, the fourth path type, and the fifth path type.

9. The method according to claim 1, wherein: The method further comprises: When an operation on the first application is detected, a file generated by the operation is stored; wherein the storing the file generated by the operation further includes: Naming the file according to a preset naming rule; The preset naming rules include: The file is named according to the naming rules corresponding to the file type, wherein different file types use different naming methods and suffix names.

10. A storage path management device, comprising: Isolation unit, used to isolate the production environment from the debugging environment using the reflection mechanism; a regularization unit, configured to uniformly regularize the storage path of the first application using annotation information and a path management class, wherein the path management class is configured to store all storage path information of the first application; A management unit, configured to obtain a set of storage paths of the first application by parsing through the reflection mechanism in the debugging environment; Wherein, the isolation unit is also used for: Setting the set of storage paths of the first application in the production environment, so that a debugging environment isolated from the production environment obtains the set of storage paths of the first application in the production environment through the reflection mechanism; The device also includes a generating unit, and the generating unit includes: an acquisition subunit, configured to acquire a set of storage paths of the first application through the reflection mechanism, and parse out path type information and annotation information of each storage path in the set through the reflection mechanism; A generating subunit, configured to generate a path management interface based on the path type information and the annotation information of each storage path in the set; the path management interface includes a path type and one or more entries of the path type; The regularization unit is further used to uniformly regularize the storage path of the first application through the path management interface.

11. The device according to claim 10, wherein: The device also includes: A display unit is used to display the path management interface in the debugging environment.

12. The device according to claim 10, wherein: The generating subunit is used for: Classify all the path type information of the set to obtain M different path types, where M is a positive integer; Based on the annotation information corresponding to each of the path types, determining the entry information included in each of the path types; The entry information included in each path type is mapped to the corresponding path type.

13. The device according to claim 10, wherein: The acquisition subunit is further used for: While the path type information and annotation information of each storage path in the set are parsed through the reflection mechanism, the file type included in each storage path in the set is parsed through the reflection mechanism, wherein the file type is used to identify the file type of the file stored under the same storage path, and the same storage path includes at least one file type.

14. The device according to claim 11, wherein: The path management interface includes a path type and one or more items included in the path type, and the device further includes: The response unit is used to obtain the file storage path directory of any entry according to the entry information corresponding to any entry and the path type information to which any entry belongs, when receiving a preset trigger operation for any entry on the path management interface.

15. The device according to claim 14, wherein: The response unit is used to: According to the entry information corresponding to the any entry and the path type information to which the any entry belongs, a method function for searching the file storage path of the any entry in the collection through a reflection mechanism; The method function is executed through the reflection mechanism to obtain the file storage path directory of the entry.

16. The device according to claim 15, wherein: The response unit is further used for: After obtaining the file storage path directory, jump to the location corresponding to the file storage path directory by calling a system file browser or a third-party file browser.

17. The device according to claim 10, wherein: The path type includes at least one of the following: The first path type where the screen saver files are stored; A second path type for storing Android application packages; A third path type for storing data files; The fourth path type for storing font files; The fifth path type for storing image files; A sixth path type that does not belong to the aforementioned types, wherein the aforementioned types include the first path type, the second path type, the third path type, the fourth path type, and the fifth path type.

18. The device according to claim 10, wherein: The device also includes: a storage unit, configured to store a file generated by an operation on the first application when the operation is detected; The storage unit is further used for: Naming the file according to a preset naming rule; The preset naming rules include: The file is named according to the naming rules corresponding to the file type, wherein different file types use different naming methods and suffix names.

19. A medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

20. A computing device comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and device for loading disk file based on PHP environment

    CN104331299A

  • Interface testing method and device

    CN110888794A