APP memory data classification storage method, classification storage system and server
By monitoring and adjusting the directory structure of shared memory data, the problem of failure to optimize the shared memory data storage structure in the prior art is solved, data access efficiency and sharing performance are improved, and more efficient data retrieval and resource utilization are achieved.
Patent Information
- Application Number
- CN202411213035.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The data directory structure stored in shared memory in the prior art has not been optimized in combination with user usage habits, resulting in delays in the use of shared data between processes and affecting the access efficiency of data.
By monitoring the frequency of shared memory usage and directory structure, adjust the subdirectory structure of shared data based on the analysis results, and optimize the storage location to reduce retrieval time and resource consumption.
It significantly improves the access efficiency and sharing performance of data, so that frequently shared data is placed in a more reasonable and easy-to-retrieve storage location, reduces retrieval time and resource consumption, and improves the efficiency of sharing data between processes.
Smart Images

Figure CN118733303B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of classified storage technology, and in particular, relates to an APP memory data classified storage method, a classified storage system and a server. Background Art
[0002] In many current applications (Apps), memory data is often organized and stored in folders (directories); the main advantage of this method is that it can arrange data in a hierarchical structure, making it easier to search, access, and manage;
[0003] However, when an application persists memory data to a file system, the selected file storage depth (i.e., the number of levels in the directory structure) may have a certain impact on the data access speed; specifically, as the file storage depth increases, the data access speed may experience a certain degree of decline. This is mainly because a deeper directory structure means that more levels must be navigated before accessing the target file, which undoubtedly increases the length of the access path.
[0004] For this reason, developers usually place resources such as App configuration files in shallower directories to reduce the length of the access path, thereby increasing access speed. This also helps improve code readability and maintainability, because shallower directory structures can be more easily found and managed.
[0005] However, during the operation of the application, some data may need to be shared with other processes. This data is usually determined based on the user's usage habits and scenarios. For example, some social applications may require authentication information from other applications.
[0006] For this type of data shared with other processes, the current common practice is to create shared memory and fill the data to be shared into the shared memory. However, for the data added to the shared memory, it is impossible to accurately know whether it needs to be shared. The storage directory for this type of data may have a deep directory structure. Currently, the directory structure for this type of data has not been optimized based on the user's usage habits; it has not taken its sharing situation into consideration, which is not conducive to searching, affects the addition of shared memory data, and thus causes delays in the use of shared data between processes.
[0007] Therefore, a technical solution for classified storage of APP memory data is needed to solve the above problems. Summary of the invention
[0008] In order to address the deficiencies of the prior art, the present application provides an APP memory data classification storage method, a classification storage system and a server, which combine the user's usage habits to simplify the directory structure of shared data, improve the retrieval speed, and facilitate search.
[0009] The technical effects to be achieved by this application are achieved through the following solutions:
[0010] According to a first aspect of the present application, a method for classifying and storing APP memory data is provided, comprising the following steps:
[0011] Step 1: The sender sends a sharing request to the process;
[0012] Step 2: The process parses the sharing request and obtains the attributes of the required shared data;
[0013] Step 3: Create a shared memory according to the attributes of the shared data, and store the corresponding shared data in the shared memory;
[0014] Step 4: Mapping the shared memory to the address space of the process and the sender respectively;
[0015] Step 5: During the existence of the shared memory, the shared memory is monitored to obtain periodic monitoring data;
[0016] Step 6: Analyze the periodic monitoring data, and adjust the corresponding subdirectory of the shared data according to the analysis result.
[0017] Preferably, the attribute of the shared data is description information of the shared data, the description information at least includes a data name, a data format and a storage address, and the shared data is acquired according to the description information.
[0018] Preferably, in step 3, for each shared data, a shared memory is created according to the capacity of the shared data.
[0019] Preferably, in step 4, the process and the sender can access and operate the shared data according to the shared memory address stored in the address space.
[0020] Preferably, in step 5, the periodic monitoring data includes the number of times the monitored data is shared within the sharing analysis period, and the monitored data includes the shared data, the subdirectory of the shared data, the original process of the shared data, and the associated process;
[0021] In step 6, the periodic monitoring data is analyzed by comparing the number with a preset evaluation directory adjustment threshold, and when the number is greater than the evaluation directory adjustment threshold, the sub-directory is adjusted.
[0022] Preferably, the number of times the monitored data is shared within the sharing analysis period is obtained as follows:
[0023] Traverse the periodic monitoring data of all shared memories in the current shared analysis cycle, obtain all shared data and mark them;
[0024] Obtain and mark all periodic monitoring data containing the same shared data, and obtain and mark all associated processes contained in the periodic monitoring data;
[0025] The number of periodic monitoring data corresponding to each associated process is counted to obtain the number of times the data is shared.
[0026] Preferably, analyzing the periodic monitoring data specifically includes the following steps:
[0027] Compare the amount of the periodic monitoring data with the shared frequency screening threshold, and proceed to the next step for the shared data corresponding to the periodic monitoring data greater than the shared frequency screening threshold;
[0028] Get the directory hierarchy depth of the shared data filtered in the previous step, and use the following formula to calculate the directory adjustment assessment value of the shared data:
[0029] ;
[0030] Among them, E1 is the number of periodic monitoring data, G1 is the directory level depth, H1 is the data capacity of shared data, α1 is the standard sharing frequency adjustment factor, α2 is the directory level depth adjustment factor, β1 is the first weight ratio factor, and β2 is the second weight ratio factor;
[0031] The directory adjustment evaluation value is compared with the evaluation directory adjustment threshold, and the shared data greater than the evaluation directory adjustment threshold is used as directory data to be adjusted, and the subdirectories of the directory data to be adjusted are adjusted.
[0032] Preferably, in step 6, the specific method for adjusting the corresponding subdirectory of the shared data is:
[0033] Get the preset directory adjustment drive letter and the original process name of the directory data to be adjusted;
[0034] The directory adjustment drive letter and the original process name of the directory data to be adjusted are concatenated to obtain the adjusted subdirectory and create it;
[0035] The data to be adjusted in the directory is migrated from the original process to the corresponding adjusted subdirectory for storage.
[0036] According to a second aspect of the present application, a classification storage system using the above-mentioned APP memory data classification storage method is provided, comprising:
[0037] Shared monitoring module, used to monitor shared memory and generate periodic monitoring data;
[0038] A shared behavior analysis module is used to analyze the periodic monitoring data to obtain the directory data to be adjusted;
[0039] The directory adjustment module is used to adjust the subdirectories of the data to be adjusted in the directory.
[0040] According to a third aspect of the present application, there is provided a server, comprising: a memory and at least one processor;
[0041] The memory stores a computer program, and the at least one processor executes the computer program stored in the memory to implement the above-mentioned APP memory data classification storage method.
[0042] According to one embodiment of the present application, the beneficial effect of adopting the APP memory data classification storage method is: monitoring the shared data stored in the shared memory, and adjusting the sub-directory of the shared data according to the monitoring results, which significantly improves the data access efficiency and sharing performance, and places frequently shared data in a more reasonable and easy-to-retrieve storage location, reducing retrieval time and resource consumption, and improving the efficiency of using shared data between processes. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present application or the existing technical solutions, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0044] Figure 1 This is a flow chart of a method for classifying and storing APP memory data in one embodiment of the present application;
[0045] Figure 2 This is a structural block diagram of an APP memory data classification storage system in one embodiment of the present application;
[0046] Figure 3 This is a structural block diagram of a server in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0048] like Figure 1 As shown, the APP memory data classification storage method in one embodiment of the present application includes the following steps:
[0049] Step 1: The sender sends a sharing request to the process;
[0050] In this step, the sender refers to several running processes; the process is an application (APP), that is, several running APPs will send data sharing requests to a certain APP, for example, a shopping APP will send a data request for the current location to a map APP, etc.
[0051] Step 2: The process parses the sharing request and obtains the attributes of the required shared data;
[0052] In this step, when a process receives a sharing request from the sender, it first reviews its permissions, and resolves the sharing request after the permissions are reviewed.
[0053] Acquiring the data in the sharing request includes: requested shared data attributes, which include but are not limited to description information, data format, memory address, etc. of the shared data. In this embodiment, the shared data attributes refer to the description information of the shared data, which includes the name and data format of the shared data. The corresponding shared data can be directly found through the description information of the shared data;
[0054] Find the main directory storing the process in the user authorized device. The main directory of the process contains several subdirectories. Each subdirectory of the process stores a type of file of the process, that is, each file in the process has an exclusive subdirectory. The various types of files of the process are divided according to the file attributes.
[0055] The subdirectory of each file is exactly its name. For example, the subdirectory of the 1.jpg file is D: / home / username / documents / pictures / 1.jpg, where " / " is the separator of the directory level. The directory level depth of the 1.jpg file is 6.
[0056] All files of a process are organized in a hierarchical directory system, in which each file is assigned to a dedicated subdirectory;
[0057] The user authorized device can be any one of the user's mobile phone, laptop computer and desktop computer.
[0058] Step 3: Create a shared memory according to the attributes of the shared data, and store the corresponding shared data in the shared memory;
[0059] In this step, a shared memory is opened by the process that receives the sharing request, and the located corresponding shared data is stored in the shared memory;
[0060] In order to simplify the complexity of data synchronization and avoid potential conflicts between different data when a process allocates shared memory, a shared memory is allocated for each shared data according to its data capacity.
[0061] Step 4: Mapping the shared memory to the address space of the process and the sender respectively;
[0062] In this step, after the storage is successful, the shared memory is mapped to the address space of the process and the sender respectively, so that the process and the sender can jointly access and operate the shared data.
[0063] Step 5: During the existence of the shared memory, the shared memory is monitored to obtain periodic monitoring data;
[0064] In this step, when a process creates a shared memory after receiving a sharing request, until the shared memory is destroyed, the shared memory is monitored to obtain the periodic monitoring data of the shared memory, which includes the shared data and its subdirectories within the sharing analysis period, the original process of the shared data and several associated processes;
[0065] The original process refers to the process that receives the sharing request, the subdirectory of the shared data refers to the subdirectory in the shared data main directory that stores the shared data, and the associated processes refer to the processes that send the sharing requests.
[0066] Step 6: Analyze the periodic monitoring data, and adjust the corresponding subdirectory of the shared data according to the analysis result.
[0067] In this step, the analysis of the periodic monitoring data specifically includes the following steps:
[0068] First, obtain the number of times the monitored data is shared during the sharing analysis cycle:
[0069] S61: traverse the periodic monitoring data of all shared memories stored in the current shared analysis period, obtain all shared data contained therein, and mark them as A1, A2, ..., Aa, where a≥1, wherein the same shared data contained in multiple periodic monitoring data is marked only once;
[0070] S62: Select all periodic monitoring data including the shared data A1 from all periodic monitoring data of the current shared analysis period, and mark them as B1, B2, ..., Bb, 1≤b≤a;
[0071] S63: Obtain all associated processes included in the periodic monitoring data B1, B2, ..., Bb of the shared data A1, and mark them as C1, C2, ..., Cc, respectively, where c≥1, wherein for the same associated process included in multiple periodic monitoring data, the associated process is marked only once;
[0072] S64: Obtain the total number of periodic monitoring data including the associated processes C1, C2, ..., Cc from the periodic monitoring data B1, B2, ..., Bb in sequence, and mark them as D1, D2, ..., Dc;
[0073] S65: Compare D1, D2, ..., Dc with the sharing frequency screening threshold P1 in turn, obtain the total number of periodic monitoring data greater than or equal to P1, and mark it as the standard sharing frequency E1 of the shared data A1 of the current sharing analysis period;
[0074] Then the catalog adjustment evaluation value is calculated, specifically:
[0075] S66: Obtain the number F1 of separators " / " in the subdirectory of the shared data A1, and calculate the directory level depth G1 of the shared data A1 using the formula G1=F1+1;
[0076] S67: Utilize the formula:
[0077] ;
[0078] Calculate and obtain the directory adjustment evaluation value I1 of the shared data A1, where G1 is the directory level depth, H1 is the data capacity of the shared data, α1 is the standard sharing frequency adjustment factor, α2 is the directory level depth adjustment factor, β1 is the first weight ratio factor, and β2 is the second weight ratio factor;
[0079] S68: Compare the directory adjustment evaluation value I1 with the preset evaluation directory adjustment threshold value P2. If I1≥P2, it is determined that the subdirectory of the shared data A1 needs to be adjusted, and the shared data A1 is recalibrated as the directory to be adjusted data of the current sharing analysis cycle. Otherwise, no processing is performed.
[0080] S69: According to S61 to S67, the directory adjustment evaluation values I1, I2, ..., Ia of the shared data A1, A2, ..., Aa are calculated in sequence, and the directory adjustment evaluation values I1, I2, ..., Ia of the shared data A1, A2, ..., Aa are compared with the evaluation directory adjustment threshold P2 in sequence, and the shared data corresponding to all directory adjustment evaluation values greater than or equal to P2 are recalibrated as the directory data to be adjusted in the current sharing analysis cycle.
[0081] After completing the above steps and selecting the directory data to be adjusted, the specific method for adjusting the subdirectory of the corresponding directory data to be adjusted is as follows:
[0082] S71: Mark all the directory data to be adjusted in the current shared analysis period received as J1, J2, ..., Jj, where j≥1;
[0083] S72: Obtain a directory adjustment drive letter preset by the user, marked as K1; the directory adjustment drive letter refers to a disk partition in the user-authorized device, and is represented by a letter followed by a colon and a slash. For example, the directory adjustment drive letter may be "D: / ", where D is the letter identifier of the disk partition;
[0084] S73: splicing according to the preset splicing rules to obtain the adjustment sub-directory of the directory to be adjusted data J1, the splicing rules are as follows:
[0085] S731: Obtain the original process name K2 of the directory data to be adjusted;
[0086] S732: sequentially concatenate the directory adjustment drive letter K1 and the original process name K2 of the directory data to be adjusted J1 with “ / ” to obtain an adjustment subdirectory of the directory data to be adjusted J1;
[0087] S74: adjusting subdirectories of the directories J1, J2, ..., Jj of the data to be adjusted are obtained by sequentially concatenating the directories S71 to S73, wherein the adjusting subdirectory of J2 is concatenated based on K1 and the original process name of the data to be adjusted J2, and the adjusting subdirectories of the data to be adjusted in other directories are similarly concatenated;
[0088] S75: the directory adjustment module creates a sub-directory according to the adjustment sub-directory of the directory data to be adjusted J1 obtained by splicing, and after the creation is completed, migrates the directory data to be adjusted J1 from its original process into the sub-directory for storage;
[0089] S76: According to S75, the directory data to be adjusted J1, J2, ..., Jj are respectively migrated from their original processes into corresponding sub-directories for storage.
[0090] When a process receives a sharing request again, based on the shared data attributes of the request obtained after parsing the sharing request, the shared data is first searched and located in the preset directory adjustment drive letter. If the shared data cannot be found, the shared data is searched and located in the home directory of the corresponding process.
[0091] In another embodiment of the present application, Figure 2 As shown, a classification storage system using the above-mentioned APP memory data classification storage method is disclosed, including:
[0092] A shared monitoring module is used to monitor the shared memory opened by the process in the user-authorized device, obtain the periodic monitoring data of the shared memory, and transmit the periodic monitoring data of the shared memory to the shared behavior analysis module;
[0093] The shared behavior analysis module periodically analyzes the periodic monitoring data of all shared memories stored in the shared behavior analysis module, analyzes the periodic monitoring data of all shared memories stored in the current shared analysis period, obtains the directory data to be adjusted, and transmits all the directory data to be adjusted in the current shared analysis period and its subdirectories together with the original process to the directory adjustment module;
[0094] The directory adjustment module is used to adjust the subdirectories of a number of data in the process, and the directory adjustment module stores the directory adjustment drive letter preset by the user.
[0095] like Figure 3 As shown, the server in an embodiment of the present application includes: a memory 301 and at least one processor 302;
[0096] The memory 301 stores computer programs, and the at least one processor 302 executes the computer programs stored in the memory 301 to implement the above-mentioned APP memory data classification storage method.
[0097] This application sets a shared monitoring module to monitor the process from creation to destruction of shared memory and obtain corresponding periodic monitoring data after the shared memory is destroyed;
[0098] The shared behavior analysis module periodically analyzes the periodic monitoring data of several shared memories, and periodically selects several directories of data to be adjusted according to the quantity and capacity of each shared data contained in the periodic monitoring data, the number of associated processes, and the number of separators in the subdirectories;
[0099] Then the directory adjustment module adjusts the sub-directories of the selected directories to be adjusted and stores them in the preset directory adjustment drive letters. This method not only optimizes the data storage structure, but also provides a more efficient path for subsequent data retrieval and sharing.
[0100] When the next sharing request comes, the shared data will be retrieved and located from the directory adjustment drive letter first. In this way, on the one hand, the shared data in which subdirectories should be optimized is dynamically selected periodically in combination with the processes frequently run by the user, thereby significantly improving the data access efficiency and sharing performance;
[0101] On the other hand, frequently shared data is placed in a more reasonable and easily retrieved storage location, which helps to reduce the burden on the server, reduces retrieval time and resource consumption, and improves the efficiency of shared data between processes.
[0102] It should be noted that the above detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present application belongs.
[0103] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should also be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0104] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.
[0105] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0106] For ease of description, spatially relative terms, such as "above", "above", "on the upper surface of", "above", etc., may be used herein to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" may include both "above" and "below". The device may also be positioned in other different ways, such as rotated 90 degrees or in other orientations, and the spatially relative descriptions used herein are interpreted accordingly.
[0107] In the above detailed description, reference is made to the accompanying drawings, which form a part of this document. In the accompanying drawings, similar symbols typically identify similar components unless the context indicates otherwise. The illustrated embodiments described in the detailed description, drawings, and claims are not meant to be limiting. Other embodiments may be used, and other changes may be made, without departing from the spirit or scope of the subject matter presented herein.
[0108] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for classifying and storing APP memory data, characterized in that: The steps include: Step 1: The sender sends a sharing request to the process; Step 2: The process parses the sharing request to obtain the required attributes of the shared data, where the attributes of the shared data are description information of the shared data, and the description information at least includes a data name, a data format, and a storage address, and the shared data is obtained according to the description information; Step 3: Create a shared memory according to the attributes of the shared data, and store the corresponding shared data in the shared memory; for each shared data, create a shared memory according to the capacity of the shared data; Step 4: Mapping the shared memory to the address space of the process and the sender respectively, so that the process and the sender can access and operate the shared data according to the shared memory address stored in the address space; Step 5: During the existence of the shared memory, the shared memory is monitored to obtain periodic monitoring data, wherein the periodic monitoring data includes the number of times the monitored data is shared within the sharing analysis period, and the monitored data includes the shared data, the subdirectory of the shared data, the original process of the shared data, and the associated process; Step 6: Analyze the periodic monitoring data, and adjust the corresponding subdirectory of the shared data according to the analysis result; Analyze the periodic monitoring data by comparing the number with a preset evaluation directory adjustment threshold, and when the number is greater than the evaluation directory adjustment threshold, adjust the subdirectory; The specific number of times the monitored data is shared during the sharing analysis cycle is: Traverse the periodic monitoring data of all shared memories in the current shared analysis cycle, obtain all shared data and mark them; Obtain and mark all periodic monitoring data containing the same shared data, and obtain and mark all associated processes contained in the periodic monitoring data; Counting the number of periodic monitoring data corresponding to each associated process respectively to obtain the number of times the data is shared; Analyzing the periodic monitoring data specifically includes the following steps: Compare the amount of the periodic monitoring data with the shared frequency screening threshold, and proceed to the next step for the shared data corresponding to the periodic monitoring data greater than the shared frequency screening threshold; Get the directory hierarchy depth of the shared data filtered in the previous step, and use the following formula to calculate the directory adjustment assessment value of the shared data: ; Among them, E1 is the number of periodic monitoring data, G1 is the directory level depth, H1 is the data capacity of shared data, α1 is the standard sharing frequency adjustment factor, α2 is the directory level depth adjustment factor, β1 is the first weight ratio factor, and β2 is the second weight ratio factor; Compare the directory adjustment evaluation value with the evaluation directory adjustment threshold, take the shared data greater than the evaluation directory adjustment threshold as directory data to be adjusted, and adjust the subdirectories of the directory data to be adjusted; The specific method to adjust the corresponding shared data subdirectory is: Get the preset directory adjustment drive letter and the original process name of the directory data to be adjusted; The directory adjustment drive letter and the original process name of the directory data to be adjusted are concatenated to obtain the adjusted subdirectory and create it; The data to be adjusted in the directory is migrated from the original process to the corresponding adjusted subdirectory for storage.
2. A classification storage system using the APP memory data classification storage method according to claim 1, characterized in that: include: Shared monitoring module, used to monitor shared memory and generate periodic monitoring data; A shared behavior analysis module is used to analyze the periodic monitoring data to obtain the directory data to be adjusted; The directory adjustment module is used to adjust the subdirectories of the data to be adjusted in the directory.
3. A server, characterized in that: include: memory and at least one processor; The memory stores a computer program, and the at least one processor executes the computer program stored in the memory to implement the APP memory data classification storage method described in claim 1.
