Intelligent USB flash disk capacity dynamic allocation performance optimization method capable of self-adapting to storage requirements

By dividing the smart USB flash drive into a public area and an encrypted area, periodically collecting and preprocessing storage information, obtaining storage needs, and dynamically allocating capacity, the problem of inaccurate capacity allocation in existing technologies is solved, thereby improving the storage efficiency and user experience of the USB flash drive.

CN121979455APending Publication Date: 2026-05-05SHENZHEN QINGMU TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN QINGMU TECHNOLOGY CO LTD
Filing Date
2026-01-15
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing dynamic capacity allocation technology for USB flash drives cannot accurately obtain the user's storage capacity needs based on the historical storage situation of the smart USB flash drive, and cannot adaptively adjust the threshold for triggering capacity allocation, resulting in inaccurate capacity allocation, affecting user experience and the burden on the main control chip.

Method used

The smart USB drive is divided into a public area and an encrypted area. The stored file information is collected periodically, and the data is preprocessed to obtain the storage requirements. Based on these requirements, the capacity is dynamically allocated. The core area is identified by the median and weighted storage, and the capacity allocation threshold is adjusted.

Benefits of technology

It can accurately obtain user storage needs based on the historical storage status of smart USB flash drives, and adaptively adjust the capacity allocation threshold to avoid capacity waste and insufficient allocation, thereby improving user experience and reducing the burden on the main control chip.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121979455A_ABST
    Figure CN121979455A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent USB flash disk capacity dynamic allocation performance optimization method adaptive to storage requirements, and relates to the technical field of USB flash disk capacity dynamic allocation, and the method comprises the following steps: dividing an intelligent USB flash disk into a public area and an encryption area, and in the use process of the intelligent USB flash disk, periodically collecting storage file information of the public area and the encryption area, respectively obtaining public storage information data and encrypted storage information data; respectively carrying out data preprocessing to obtain standard public storage data and standard encrypted storage data; the storage demand of the public area and the storage demand of the encryption area are obtained respectively, and the public storage demand and the encryption storage demand are obtained respectively; the capacity is dynamically allocated; the method is used for solving the problems that when the capacity of the intelligent U disk is dynamically allocated by an existing U disk capacity dynamic allocation technology, the requirement of a user for the storage capacity cannot be accurately obtained according to the historical storage condition of the intelligent U disk, and the threshold value for triggering capacity allocation cannot be adaptively adjusted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of dynamic allocation technology for USB flash drive capacity, specifically to a performance optimization method for intelligent dynamic allocation of USB flash drive capacity that adapts to storage needs. Background Technology

[0002] Dynamic USB flash drive capacity allocation technology refers to a storage management technology that automatically or semi-automatically adjusts the capacity ratio of each partition based on a multi-partition architecture, such as a public area and an encrypted area, without affecting data integrity. Its core is to break the limitations of traditional static fixed partitions of USB flash drives and dynamically schedule storage resources.

[0003] Existing dynamic capacity allocation technologies for USB flash drives often set fixed capacity thresholds for partitions when dynamically allocating capacity. When the remaining capacity of a partition falls below the threshold, capacity allocation is triggered, allocating some capacity from partitions with more remaining capacity to that partition. These fixed capacity thresholds are often manually set based on experience and frequently deviate from actual storage needs. If the threshold is set too high, and the user has no sustained write demand on that partition in the short term, it leads to meaningless capacity allocation. After space is taken from other partitions, that partition remains underutilized for a long time, resulting in wasted capacity. Conversely, if the threshold is set too low, and the user has a large write demand on that partition, capacity allocation may occur before it is triggered, but the remaining capacity is insufficient for a single write operation. The predicament of write demand leads to file write failures or interruptions, violating the core objective of dynamic allocation to ensure storage availability. Furthermore, if users write to partitions frequently every day, a fixed high threshold will lead to frequent capacity allocation adjustments, increasing the burden on the main controller chip. Moreover, the capacity allocation triggered by existing technology is usually based on a preset fixed value, which can easily lead to over-allocation, causing redundant capacity in other partitions to be over-occupied, and under-allocation, which will result in the need still not being met after adjustment, affecting the user experience. Therefore, existing dynamic capacity allocation technology for USB flash drives cannot accurately obtain the user's storage capacity needs based on the historical storage situation of the smart USB flash drive and adaptively adjust the threshold for triggering capacity allocation. Summary of the Invention

[0004] This invention aims to at least partially solve one of the technical problems in the prior art. It involves dividing a smart USB flash drive into a public area and an encrypted area, and periodically collecting storage file information from both areas during use to obtain public storage information data and encrypted storage information data, respectively. This data is then preprocessed to obtain standard public storage data and standard encrypted storage data. Furthermore, the storage requirements of the public area and the encrypted area are obtained separately, yielding public storage requirements and encrypted storage requirements, respectively. Finally, the capacity of the public area and the encrypted area is dynamically allocated. This addresses the problem that existing dynamic capacity allocation technologies for smart USB flash drives cannot accurately determine the user's storage capacity requirements based on the historical storage conditions of the smart USB flash drive and adaptively adjust the threshold for triggering capacity allocation.

[0005] To achieve the above objectives, this application provides a performance optimization method for intelligent USB flash drive capacity dynamic allocation based on adaptive storage needs, comprising the following steps: The smart USB flash drive is divided into a public area and an encrypted area. During the use of the smart USB flash drive, the storage file information of the public area and the encrypted area is periodically collected to obtain public storage information data and encrypted storage information data respectively. Data preprocessing is performed on public storage information data and encrypted storage information data respectively to obtain standard public storage data and standard encrypted storage data; Based on standard public storage data and standard encrypted storage data, the storage requirements of the public area and the encrypted area are obtained respectively, thus yielding the public storage requirements and encrypted storage requirements. Based on public storage needs and encrypted storage needs, the capacity of the public area and the encrypted area is dynamically allocated.

[0006] Furthermore, the smart USB drive is divided into a public area and an encrypted area. During the use of the smart USB drive, the storage file information of the public area and the encrypted area is periodically collected to obtain public storage information data and encrypted storage information data respectively. This includes the following sub-steps: Designate any smart USB drive as the first USB drive, divide the storage space of the first USB drive into a public area and an encrypted area, and set the first time period to t1; The total size of files stored in the public area during the first time period is recorded as the public storage amount, and the total size of files stored in the encrypted area during the first time period is recorded as the encrypted storage amount.

[0007] Furthermore, dividing the smart USB drive into a public area and an encrypted area, and periodically collecting the stored file information from the public area and the encrypted area during the use of the smart USB drive to obtain public storage information data and encrypted storage information data respectively, also includes the following sub-steps: During the use of the smart USB flash drive, the public storage volume and encrypted storage volume are periodically and continuously collected in each first time period, with t1 as the cycle. The time period corresponding to each first time period is recorded, and the corresponding dates are recorded according to the date. They are recorded as public storage information data and encrypted storage information data in sequence.

[0008] Furthermore, the process of preprocessing the public storage information data and the encrypted storage information data to obtain standard public storage data and standard encrypted storage data also includes the following sub-steps: Extract the portions collected from the public storage information data and the encrypted storage information data for the most recent k1 dates respectively, and record them as the most recent public storage information and the most recent encrypted storage information in order, where k1 is the set number; Remove all public entries equal to 0 from the most recent public storage information to obtain zero-removed storage information. Arrange the public entries of the zero-removed storage information in ascending order and denote it as the first storage sequence. Obtain the value range of the first storage sequence and divide the value range evenly into k2 intervals, which are denoteed as storage intervals. Here, k2 is the number of intervals set.

[0009] Furthermore, the process of preprocessing the public storage information data and the encrypted storage information data to obtain standard public storage data and standard encrypted storage data also includes the following sub-steps: Based on the first stock sequence, obtain the number of common deposits in each stock interval, and record the stock interval with the largest number as the core stock interval; Obtain the median of the common deposits in the core stock range, denoted as the core median MA; and mark the common deposits in the zero-removed storage information that are greater than k3×MA as the stock to be screened, where k3 is the set proportional coefficient.

[0010] Furthermore, the process of preprocessing the public storage information data and the encrypted storage information data to obtain standard public storage data and standard encrypted storage data also includes the following sub-steps: Any stock to be filtered is denoted as the first stock to be filtered. The common stock entries in the zero-removal storage information are arranged in chronological order and denoted as the second stock sequence. In the second stock sequence, with the first stock to be filtered as the center, take k4 adjacent data before and after it, and count the number of stocks to be filtered in the k4 adjacent data AF, where k4 is the set number. If AF=0, then the first quantity to be filtered is recorded as abnormal data. Repeatedly obtain all abnormal data of the zero-removal storage information and remove them. After completion, the standard data of the public storage information data is obtained and recorded as standard public storage data. Repeatedly obtain the standard data of the encrypted storage information data and record it as standard encrypted storage data.

[0011] Furthermore, based on standard public storage data and standard encrypted storage data, the storage requirements for the public area and the encrypted area are obtained respectively. The process for obtaining the public storage requirements and encrypted storage requirements includes the following sub-steps: Based on the standard public storage data, calculate the sum of the public deposits for each date, and record it as the daily deposit amount; then remove the daily deposits for rest days, and arrange the remaining daily deposits in order from the oldest to the newest date, and record it as the daily deposit amount sequence. The daily deposits of the k5 nearest dates in the daily deposit sequence are recorded as the recent segment, and the remaining portion is recorded as the long-term segment, where k5 is the set number of days.

[0012] Furthermore, obtaining the storage requirements for the public area and the encrypted area based on the standard public storage data and standard encrypted storage data respectively, and obtaining the public storage requirements and encrypted storage requirements respectively, also includes the following sub-steps: Calculate the average value of the long-term segment, denoted as the long-term level BP; denote the deposit amount of any day in the recent segment as RMi, where i represents the position number in the recent segment; Get the sum of the position numbers of all daily deposits in the recent segment, denoted as HG; calculate (i+e0) / (HG+k5×e0), denoted as the stock weight Qi of RMi; calculate Qi×RMi, denoted as the weighted stock of RMi, where e0 is a set constant.

[0013] Furthermore, obtaining the storage requirements for the public area and the encrypted area based on the standard public storage data and standard encrypted storage data respectively, and obtaining the public storage requirements and encrypted storage requirements respectively, also includes the following sub-steps: Repeatedly calculate the weighted stock of all daily deposits in the recent period, and calculate the sum of all weighted stocks to calculate the recent level CP; calculate the average value of the recent period, denoted as the recent mean DP; Calculate min(CP / DP, DP / CP), denoted as stability weight PQ; calculate PQ×CP+(1-PQ)×BP, denoted as the storage requirement of the common area, and marked as common storage requirement GU; Based on standard encrypted storage data, repeated retrieval of encrypted storage requirements is marked as encrypted storage requirement EU.

[0014] Furthermore, based on public storage needs and encrypted storage needs, the dynamic allocation of capacity between the public and encrypted areas includes the following sub-steps: The public storage demand and encrypted storage demand are repeated daily. The currently obtained public storage demand and encrypted storage demand are recorded as GU and EU respectively in order; and the remaining storage capacity of the public area and the remaining storage capacity of the encrypted area are obtained and recorded as GY and EY respectively in order. If GY>GU, then GY-GU is recorded as the public allocable capacity GF; otherwise, the public allocable capacity is equal to 0. If EY>EU, then EY-EU is recorded as the encrypted allocable capacity EF; otherwise, the encrypted allocable capacity is equal to 0. If GU is not less than GY and EU is not less than EY, then the capacity of the public area and the encrypted area will not be dynamically allocated; if GU is less than GY and EU is less than EY, then it is determined that the capacity of the first USB drive is insufficient and an alert is issued. If GU is less than GY and EU is not less than EY, and EF is greater than GU, then a storage capacity of GU size is obtained from EF and allocated to the public area; if EF is not greater than GU, then EF is allocated to the public area. If EU is less than EY and GU is not less than GY, and GF is greater than EU, then a storage capacity of EU size is obtained from GF and allocated to the encrypted area; if GF is not greater than EU, then all of GF is allocated to the encrypted area. If the capacity of the public area and the encrypted area is dynamically allocated and does not meet the requirements of GU not less than GY and EU not less than EY, then the capacity of the first USB drive is determined to be insufficient and an alert is issued.

[0015] The beneficial effects of this invention are as follows: This invention divides a smart USB flash drive into a public area and an encrypted area, and periodically collects the storage file information of the public area and the encrypted area during the use of the smart USB flash drive, obtaining public storage information data and encrypted storage information data respectively; it performs data preprocessing on the public storage information data and encrypted storage information data respectively to obtain standard public storage data and standard encrypted storage data; it obtains the storage requirements of the public area and the encrypted area respectively based on the standard public storage data and standard encrypted storage data, obtaining public storage requirements and encrypted storage requirements respectively; based on the public storage requirements and encrypted storage requirements, it dynamically allocates the capacity of the public area and the encrypted area; when dynamically allocating the capacity of the smart USB flash drive, it can accurately obtain the user's storage capacity requirements based on the historical storage situation of the smart USB flash drive, and adaptively adjust the threshold for triggering capacity allocation; This invention first identifies the core interval using the interval with the most data, then uses the median (MA) as a reference for comparison, and combines this with a local neighborhood test that takes the nearest points before and after the stock to be screened as the center and counts the frequency of occurrence of the stock to be screened. This can distinguish between real mutations that are localized but repetitive and isolated anomalies, which is more robust than simple global thresholds or means. It uses the long-term level to represent the stable baseline and the recent level to represent the recent behavior, and then uses stability weights to determine the weight ratio between the two, avoiding overreaction to short-term noise, while also being able to adjust quickly when the real trend changes. PQ=min(CP / DP, DP / CP) ensures that when the recent level and the long-term level are close, PQ is close to 1, and the recent weighted result is trusted more. When the difference between the two is large, PQ becomes smaller, and more reliance is placed on the long-term level, thereby reducing the risk of error. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating the steps of the method of the present invention; Figure 2 This is a flowchart illustrating the standard public storage data acquisition process of this invention. Figure 3 This is a flowchart illustrating the calculation of public storage requirements in this invention. Figure 4 This is a schematic diagram of the electronic device of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Example 1, please refer to Figure 1 As shown, this application provides a performance optimization method for intelligent USB flash drive capacity dynamic allocation based on adaptive storage needs, including the following steps: Step S1 involves dividing the smart USB drive into a public area and an encrypted area, and periodically collecting storage file information from the public and encrypted areas during the use of the smart USB drive to obtain public storage information data and encrypted storage information data, respectively. Step S1 includes the following sub-steps: Step S101: Designate any smart USB drive as the first USB drive, divide the storage space of the first USB drive into a public area and an encrypted area, and set the first time period to t1; in this embodiment, t1 = 5 seconds, that is, 5 seconds is a period, which can be flexibly set, generally [3 seconds, 10 seconds]; Step S102: The total file size stored in the public area during the first time period is recorded as the public storage amount, and the total file size stored in the encrypted area during the first time period is recorded as the encrypted storage amount. The storage amount is a quantitative indicator that directly reflects changes in storage demand and can transform unstructured file operations into measurable periodic indicators.

[0019] Step S103: During the use of the smart USB flash drive, the public storage volume and encrypted storage volume are periodically and continuously collected in each first time period with t1 as the cycle, and the time period corresponding to each first time period is recorded. The corresponding dates are recorded according to the date, and recorded in sequence as public storage information data and encrypted storage information data. The storage volume of the public and encrypted areas are recorded separately for subsequent analysis and threshold setting. In practical implementation, the public area refers to an open storage area without access restrictions, equivalent to basic storage space. It is the core carrier for seamless data interaction between users and devices, used to store everyday files that do not require confidentiality, and supports plug-and-read and plug-and-write functionality. The encrypted area refers to a confidential storage area that achieves logical isolation through hardware or software encryption technology. Only authorized users can access it through an authentication mechanism. It is used to store files that require strict confidentiality, and access must be through a preset authentication process. Data exists in encrypted form during storage and transmission, and unauthorized devices or users cannot identify or read it.

[0020] Step S2 involves preprocessing the public storage information data and the encrypted storage information data separately to obtain standard public storage data and standard encrypted storage data. Step S2 includes the following sub-steps: Step S201: Extract the portions collected from the most recent k1 dates from the public storage information data and the encrypted storage information data respectively, and record them as the most recent public storage information and the most recent encrypted storage information in sequence, where k1 is the set number; in this embodiment, k1=30 days, that is, the most recent 30 days of data are obtained as a reference. k1 is generally 20 to 40 days and can be set flexibly; looking only at the most recent k1 days can make subsequent statistics more sensitive to recent behavior and avoid being affected by historical data that has no reference value from too long ago; For step S202, please refer to... Figure 2As shown, the public storage amounts equal to 0 in the most recent public storage information are removed to obtain zero-removed storage information. The public storage amounts of the zero-removed storage information are arranged in ascending order and denoted as the first storage sequence. The value range of the first storage sequence is obtained and the value range is evenly divided into k2 intervals, denoted as storage intervals. Here, k2 is the number of intervals set. The storage amount of some periods is 0, for example, on rest days or when the USB flash drive is offline. These periods reflect no storage behavior. Removing 0 can make subsequent statistics focus on samples with storage behavior and avoid being dragged down by 0. In this embodiment, k2=10, which can be set flexibly.

[0021] Step S203: Based on the first stock sequence, obtain the number of common deposits in each stock interval and record the stock interval with the largest number as the core stock interval; the interval with the largest number reflects the most common deposit scale in the period with deposits and is the area representing the normal deposit level; if multiple intervals are tied for the largest number, they can usually be merged into the core stock interval. Step S204: Obtain the median of the common storage amount in the core storage range, denoted as the core median MA; and mark the common storage amount greater than k3×MA in the zero-removal storage information as the storage amount to be screened, where k3 is the set proportional coefficient. In this embodiment, k3=5, which can be set according to the actual application scenario, generally [3, 10].

[0022] Step S205: Record any one of the stock items to be filtered as the first stock item to be filtered; arrange the common stock items in the zero-removal storage information in chronological order and record them as the second stock item sequence; in the second stock item sequence, take the first stock item to be filtered as the center, take k4 adjacent data before and after it, and count the number of stock items to be filtered AF in 2×k4 adjacent data, where k4 is the set number; in this embodiment, k4=2, which can be flexibly set, generally [2, 4], that is, count the number of stock items to be filtered AF in 4 adjacent data; if the first stock item to be filtered is located at the edge of the sequence, then obtain the nearest 2×k4 adjacent data and count the number of stock items to be filtered AF. Step S206: If AF=0, then the first quantity to be filtered is recorded as abnormal data. Repeatedly obtain all abnormal data of the zero-removal storage information and remove them. After completion, the standard data of the public storage information data is obtained and recorded as standard public storage data. Repeatedly obtain the standard data of the encrypted storage information data and record it as standard encrypted storage data. For example, if the partially zeroed storage information is [5MB, 8MB, 12MB, 300MB, 298MB, 9MB, 7MB, 1500MB, 6MB, 10MB], then the first storage sequence is [5MB, 6MB, 7MB, 8MB, 9MB, 10MB, 12MB, 298MB, 300MB, 1500MB]. Divide it into 10 equally spaced intervals, with a minimum value of 5MB and a maximum value of 1500MB. Then the intervals are [5MB, 154.5MB], [154.5304MB], ..., [1355.5MB, 1500MB]. The core storage interval is [5MB, 154.5MB]. The core median MA = 8MB. Public data entries larger than 40MB are marked as data to be filtered, namely 298MB, 300MB, and 1500MB; among them, AF=0 for 1500MB, AF=1 for 298MB, and AF=1 for 300MB, so 1500MB is abnormal data. In the specific implementation process, abnormal data refers to invalid data that is completely disconnected from the actual write behavior within the corresponding period. Its value does not reflect the actual storage situation and is purely erroneous noise data caused by the failure of the acquisition link. The value is characterized by no logical jump, isolation, and non-compliance with the physical upper limit. The generation of abnormal data is entirely due to the failure or interference of the data acquisition link. Abnormal values ​​will raise or lower the statistical results of subsequent storage volume, which can easily cause the calculation of subsequent storage demand to deviate from the user's actual storage demand.

[0023] Step S3: Obtain the storage requirements for the public area and the encrypted area based on the standard public storage data and standard encrypted storage data, respectively, thus obtaining the public storage requirements and encrypted storage requirements; Step S3 includes the following sub-steps: For step S301, please refer to... Figure 3 As shown, based on standard public storage data, the sum of public deposits for each date is calculated and recorded as the daily deposit amount; the daily deposit amounts for rest days are removed, and the remaining daily deposit amounts are arranged in order from oldest to newest date and recorded as the daily deposit amount sequence; rest days generally refer to weekends or public holidays, and the deposit amounts for rest days will be significantly different. Removing rest days can avoid the impact of non-working day data on subsequent processing; the data is aggregated into the total daily deposit amount, which facilitates subsequent processing by date; Step S302: Record the daily deposit amount of the most recent k5 dates in the daily deposit amount sequence as the recent segment, and record the remaining part as the long-term segment. Here, k5 is the number of days set. In this embodiment, k5=5, that is, the daily deposit amount of the most recent 5 non-rest days is the recent segment. k5 can be set flexibly, generally [3, 7].

[0024] Step S303: Calculate the average value of the long-term segment, denoted as the long-term level BP; denote any daily deposit amount in the recent segment as RMi, where i represents the position number in the recent segment; BP represents the long-term stable daily deposit level. Step S304: Obtain the sum of the position indices of all daily deposits in the recent period, denoted as HG; calculate (i+e0) / (HG+k5×e0), denoted as the stock weight Qi of RMi; calculate Qi×RMi, denoted as the weighted stock of RMi, where e0 is a set constant. In this embodiment, e0=5. To avoid excessive differences in the stock weights of daily deposits in the recent period, it can be flexibly set; by assigning higher weights to more recent days through stock weights, the recent indicators are more sensitive to the recent trend. Step S305: Repeatedly calculate the weighted inventory of all daily deposits in the recent period, and calculate the sum of all weighted inventories to calculate the recent level CP; calculate the average value of the recent period, denoted as the recent mean DP. Step S306: Calculate min(CP / DP, DP / CP), denoted as stability weight PQ; calculate PQ×CP+(1-PQ)×BP, denoted as the storage requirement of the common area, and marked as common storage requirement GU; For example, if the daily deposit sequence is [100MB, 120MB, 90MB, 80MB, 70MB, 100MB, 120MB, 90MB, 80MB, 70MB, 200MB, 180MB, 160MB, 140MB, 130MB], the recent segment = [200, 180, 160, 140, 130], and the long-term segment = [100MB, 120MB, 90MB, 80MB, 70MB, 100MB, 120MB, 90MB, 80MB, 70MB], then the long-term level BP = 92.0MB, and the stock weight Qi = (i + e0) / (HG + k5 × e0) = (i + 5) / 40; The weights corresponding to the recent segments are [0.15, 0.175, 0.200, 0.225, 0.25], respectively; then the recent level CP = 157.5MB; then the recent mean DP = 162.0MB; then PQ = 0.972; then GU = PQ × CP + (1 - PQ) × BP = 155.67MB; Step S307: Based on the standard encrypted storage data, repeatedly obtain the storage requirements of the encrypted area and mark them as encrypted storage requirements EU; public storage requirements GU or encrypted storage requirements EU refer to the amount that a user stores in the public area or encrypted area in one day; In the specific implementation process, PQ∈(0,1], when CP and DP are close, PQ is close to 1, the recent weighting and recent mean are consistent, the recent data are stable, and the result is more biased towards the recent level CP; when the difference between the two is large, PQ is not close to 1, the result will reduce the bias towards CP and instead be more biased towards the long-term level BP; to avoid the result being misled by the deposit volume of some abnormal days.

[0025] Step S4: Based on public storage needs and encrypted storage needs, dynamically allocate the capacity of the public area and the encrypted area; Step S4 includes the following sub-steps: Step S401: Repeat the public storage demand and encrypted storage demand daily, and record the currently obtained public storage demand and encrypted storage demand as GU and EU respectively in order; and obtain the remaining storage capacity of the public area and the remaining storage capacity of the encrypted area in order, and record them as GY and EY respectively. Step S402: If GY > GU, then GY-GU is recorded as the public allocable capacity GF; otherwise, the public allocable capacity is equal to 0. If EY > EU, then EY-EU is recorded as the encrypted allocable capacity EF; otherwise, the encrypted allocable capacity is equal to 0. The remaining capacity of the public area and the encrypted area after reserving one day's demand is taken as the allocable capacity. The specific amount of demand to be reserved for one day can also be flexibly set. Step S403: If GU is not less than GY and EU is not less than EY, then the capacity of the public area and the encrypted area will not be dynamically allocated; if GU is less than GY and EU is less than EY, then it is determined that the capacity of the first USB drive is insufficient and an alert is issued. Step S404: If GU is less than GY and EU is not less than EY, and EF is greater than GU, then obtain the storage capacity of GU from EF and allocate it to the public area; if EF is not greater than GU, then allocate EF to the public area. Step S405: If EU is less than EY and GU is not less than GY, and GF is greater than EU, then obtain storage capacity of EU size from GF and allocate it to the encrypted area; if GF is not greater than EU, then allocate all of GF to the encrypted area. Step S406: If, after dynamically allocating the capacity of the public area and the encrypted area, the conditions are not met (GU not less than GY and EU not less than EY), then it is determined that the capacity of the first USB drive is insufficient and an early warning is issued. In the actual implementation process, the capacity allocation of the public area and the encrypted area can also be adjusted according to the actual application scenario and the currently acquired public storage requirements and encrypted storage requirements.

[0026] Example 3, please refer to Figure 4 As shown, Figure 4A schematic diagram of an electronic device is provided, which may include a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The memory stores computer-readable instructions, and the processor can invoke these instructions. When the processor executes a computer-readable instruction, it performs steps such as those in the adaptive storage demand-based intelligent USB flash drive capacity dynamic allocation performance optimization method to achieve the following functions: dividing the intelligent USB flash drive into a public area and an encrypted area; periodically collecting storage file information from the public area and the encrypted area during the use of the intelligent USB flash drive to obtain public storage information data and encrypted storage information data respectively; performing data preprocessing on the public storage information data and encrypted storage information data to obtain standard public storage data and standard encrypted storage data; obtaining the storage demand of the public area and the encrypted area based on the standard public storage data and standard encrypted storage data respectively; and dynamically allocating the capacity of the public area and the encrypted area based on the public storage demand and encrypted storage demand.

[0027] Furthermore, when the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0028] Example 4: This application also provides a computer-readable storage medium. This application provides a storage medium storing a computer program thereon. When the computer program is executed by a processor, it performs steps such as those in the adaptive storage demand intelligent USB flash drive capacity dynamic allocation performance optimization method to achieve the following functions: dividing the intelligent USB flash drive into a public area and an encrypted area; periodically collecting storage file information from the public area and the encrypted area during the use of the intelligent USB flash drive to obtain public storage information data and encrypted storage information data respectively; performing data preprocessing based on the public storage information data and the encrypted storage information data to obtain standard public storage data and standard encrypted storage data; obtaining the storage demand of the public area and the storage demand of the encrypted area based on the standard public storage data and the standard encrypted storage data respectively to obtain public storage demand and encrypted storage demand respectively; and dynamically allocating the capacity of the public area and the encrypted area based on the public storage demand and the encrypted storage demand.

[0029] Based on the above description of the embodiments, the embodiments of the present invention can be provided as methods, systems, or computer program products. Based on this understanding, the above technical solutions, in essence or in terms of their contribution to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or certain parts of the embodiments.

[0030] In the embodiments provided in this application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces. The indirect coupling or communication connection between systems, modules, and units may be electrical, mechanical, or other forms.

[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for performance optimization of intelligent USB flash drive capacity dynamic allocation based on adaptive storage needs, characterized in that: Includes the following steps: The smart USB flash drive is divided into a public area and an encrypted area. During the use of the smart USB flash drive, the storage file information of the public area and the encrypted area is periodically collected to obtain public storage information data and encrypted storage information data respectively. Data preprocessing is performed on public storage information data and encrypted storage information data respectively to obtain standard public storage data and standard encrypted storage data; Based on standard public storage data and standard encrypted storage data, the storage requirements of the public area and the encrypted area are obtained respectively, thus yielding the public storage requirements and encrypted storage requirements. Based on public storage needs and encrypted storage needs, the capacity of the public area and the encrypted area is dynamically allocated.

2. The intelligent USB flash drive capacity dynamic allocation performance optimization method for adaptive storage demand as described in claim 1, characterized in that, The smart USB drive is divided into a public area and an encrypted area. During the use of the smart USB drive, the storage file information of the public area and the encrypted area is periodically collected to obtain public storage information data and encrypted storage information data respectively. The process includes the following sub-steps: Designate any smart USB drive as the first USB drive, divide the storage space of the first USB drive into a public area and an encrypted area, and set the first time period to t1; The total size of files stored in the public area during the first time period is recorded as the public storage amount, and the total size of files stored in the encrypted area during the first time period is recorded as the encrypted storage amount.

3. The intelligent USB flash drive capacity dynamic allocation performance optimization method for adaptive storage demand according to claim 2, characterized in that, Dividing the smart USB drive into a public area and an encrypted area, and periodically collecting storage file information from the public and encrypted areas during the use of the smart USB drive to obtain public storage information data and encrypted storage information data respectively, also includes the following sub-steps: During the use of the smart USB flash drive, the public storage volume and encrypted storage volume are periodically and continuously collected in each first time period, with t1 as the cycle. The time period corresponding to each first time period is recorded, and the corresponding dates are recorded according to the date. They are recorded as public storage information data and encrypted storage information data in sequence.

4. The intelligent USB flash drive capacity dynamic allocation performance optimization method for adaptive storage demand according to claim 3, characterized in that, The process of preprocessing public and encrypted storage data to obtain standard public and encrypted storage data includes the following sub-steps: Extract the portions collected from the public storage information data and the encrypted storage information data for the most recent k1 dates respectively, and record them as the most recent public storage information and the most recent encrypted storage information in order, where k1 is the set number; Remove all public entries equal to 0 from the most recent public storage information to obtain zero-removed storage information. Arrange the public entries of the zero-removed storage information in ascending order and denote it as the first storage sequence. Obtain the value range of the first storage sequence and divide the value range evenly into k2 intervals, which are denoteed as storage intervals. Here, k2 is the number of intervals set.

5. The intelligent USB flash drive capacity dynamic allocation performance optimization method for adaptive storage demand according to claim 4, characterized in that, The process of preprocessing public and encrypted storage data to obtain standard public and encrypted storage data includes the following sub-steps: Based on the first stock sequence, obtain the number of common deposits in each stock interval, and record the stock interval with the largest number as the core stock interval; Obtain the median of the common deposits in the core stock range, denoted as the core median MA; and mark the common deposits in the zero-removed storage information that are greater than k3×MA as the stock to be screened, where k3 is the set proportional coefficient.

6. The intelligent USB flash drive capacity dynamic allocation performance optimization method for adaptive storage demand as described in claim 5, characterized in that, The process of preprocessing public and encrypted storage data to obtain standard public and encrypted storage data includes the following sub-steps: Any stock to be filtered is denoted as the first stock to be filtered. The common stock entries in the zero-removal storage information are arranged in chronological order and denoted as the second stock sequence. In the second stock sequence, with the first stock to be filtered as the center, take k4 adjacent data before and after it, and count the number of stocks to be filtered in the k4 adjacent data AF, where k4 is the set number. If AF=0, then the first quantity to be filtered is recorded as abnormal data. Repeatedly obtain all abnormal data of the zero-removal storage information and remove them. After completion, the standard data of the public storage information data is obtained and recorded as standard public storage data. Repeatedly obtain the standard data of the encrypted storage information data and record it as standard encrypted storage data.

7. The intelligent USB flash drive capacity dynamic allocation performance optimization method for adaptive storage demand as described in claim 6, characterized in that, Based on standard public storage data and standard encrypted storage data, the storage requirements for the public area and the encrypted area are obtained respectively. The process of obtaining the public storage requirements and encrypted storage requirements includes the following sub-steps: Based on the standard public storage data, calculate the sum of the public deposits for each date, and record it as the daily deposit amount; then remove the daily deposits for rest days, and arrange the remaining daily deposits in order from the oldest to the newest date, and record it as the daily deposit amount sequence. The daily deposits of the k5 nearest dates in the daily deposit sequence are recorded as the recent segment, and the remaining portion is recorded as the long-term segment, where k5 is the set number of days.

8. The intelligent USB flash drive capacity dynamic allocation performance optimization method for adaptive storage demand according to claim 7, characterized in that, The process of obtaining the storage requirements for the public area and the encrypted area based on standard public storage data and standard encrypted storage data also includes the following sub-steps: Calculate the average value of the long-term segment, denoted as the long-term level BP; denote the deposit amount of any day in the recent segment as RMi, where i represents the position number in the recent segment; Get the sum of the position numbers of all daily deposits in the recent segment, denoted as HG; calculate (i+e0) / (HG+k5×e0), denoted as the stock weight Qi of RMi; calculate Qi×RMi, denoted as the weighted stock of RMi, where e0 is a set constant.

9. The intelligent USB flash drive capacity dynamic allocation performance optimization method for adaptive storage demand as described in claim 8, characterized in that, The process of obtaining the storage requirements for the public area and the encrypted area based on standard public storage data and standard encrypted storage data also includes the following sub-steps: Repeatedly calculate the weighted stock of all daily deposits in the recent period, and calculate the sum of all weighted stocks to calculate the recent level CP; calculate the average value of the recent period, denoted as the recent mean DP; Calculate min(CP / DP, DP / CP), denoted as stability weight PQ; calculate PQ×CP+(1-PQ)×BP, denoted as the storage requirement of the common area, and marked as common storage requirement GU; Based on standard encrypted storage data, repeated retrieval of encrypted storage requirements is marked as encrypted storage requirement EU.

10. The intelligent USB flash drive capacity dynamic allocation performance optimization method for adaptive storage demand according to claim 9, characterized in that, Based on public and encrypted storage needs, the dynamic allocation of capacity between the public and encrypted areas includes the following sub-steps: The public storage demand and encrypted storage demand are repeated daily. The currently obtained public storage demand and encrypted storage demand are recorded as GU and EU respectively in order; and the remaining storage capacity of the public area and the remaining storage capacity of the encrypted area are obtained and recorded as GY and EY respectively in order. If GY>GU, then GY-GU is recorded as the public allocable capacity GF; otherwise, the public allocable capacity is equal to 0. If EY>EU, then EY-EU is recorded as the encrypted allocable capacity EF; otherwise, the encrypted allocable capacity is equal to 0. If GU is not less than GY and EU is not less than EY, then the capacity of the public area and the encrypted area will not be dynamically allocated; if GU is less than GY and EU is less than EY, then it is determined that the capacity of the first USB drive is insufficient and an alert is issued. If GU is less than GY and EU is not less than EY, and EF is greater than GU, then a storage capacity of GU size is obtained from EF and allocated to the public area; if EF is not greater than GU, then EF is allocated to the public area. If EU is less than EY and GU is not less than GY, and GF is greater than EU, then a storage capacity of EU size is obtained from GF and allocated to the encrypted area; if GF is not greater than EU, then all of GF is allocated to the encrypted area. If the capacity of the public area and the encrypted area is dynamically allocated and does not meet the requirements of GU not less than GY and EU not less than EY, then the capacity of the first USB drive is determined to be insufficient and an alert is issued.