Storage control method, memory and electronic equipment

By determining and utilizing interrelated sectors in memory and preloading data into cache, the problem of slow hard disk access is solved, and faster data access and read and write performance is achieved.

CN118981280APending Publication Date: 2024-11-19LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411046390.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

Existing hard disks (mechanical hard disks and solid-state hard disks) use sector methods when managing storage space, resulting in a large number of sector addressing operations when accessing data, resulting in slow access speed, especially limited speed improvements during first access.

Method used

By determining at least two interrelated sectors in the target memory, preloading data into the cache, determining appropriate storage areas using target event and data attribute information, optimizing read and write operations, including continuous and discontinuous sectors, allocation and use.

Benefits of technology

Improves data access speed, especially for frequently accessed data and unreached sectors, improves read and write performance, and remains effective after restart.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981280A_ABST
    Figure CN118981280A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a storage control method, a memory and electronic equipment, and the method comprises the steps: responding to a target event, and determining a target storage area from a target memory; controlling the target storage area to execute read-write operation matched with the target event; wherein the target storage area comprises at least two sectors which are associated with each other.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a storage control method, a memory, and an electronic device. Background Art

[0002] Currently, both mechanical hard drives and solid-state drives use sectors to manage their storage space. When accessing a certain piece of content, a large number of sector addressing operations are required to read the complete content, resulting in slower data access.

[0003] In order to solve the above problems, the related technology mainly uses time and number of accesses as the basis to decide which content can be pre-placed in the cache for subsequent access. This method can indeed speed up the speed of frequent access to the same content, but it does not improve the speed of first-time access to a piece of content. Summary of the invention

[0004] Embodiments of the present application provide a storage control method, a memory, and an electronic device.

[0005] The technical solution of this application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a storage control method, including:

[0007] In response to the target event, determining a target storage area from the target storage;

[0008] Controlling the target storage area to perform read and write operations matching the target event;

[0009] The target storage area includes at least two sectors associated with each other.

[0010] In the above storage control method, in response to the target event, determining the target storage area from the target storage includes at least one of the following:

[0011] Obtaining a source and / or type of the target event, and determining a target storage area from the target storage according to a corresponding determination strategy based on the source and / or type;

[0012] In response to a target write event, determining a target storage area to be written from the target storage based on the content to be written;

[0013] In response to a target read event, a target storage area to be read is determined from the target memory based on the information to be read.

[0014] In the above storage control method, determining the target storage area from the target storage according to the source and / or type with a corresponding determination strategy includes at least one of the following:

[0015] In the case where the target event is generated by reading first target data from the target memory, determining at least two sectors associated with the first target data from the target memory using a first determination strategy;

[0016] In the case where the target event is generated by writing second target data into the target memory, determining at least two mutually associated sectors matching the first attribute information of the second target data from the target memory using a second determination strategy;

[0017] When the target event is generated by the first electronic device establishing a first connection with the second electronic device to which the target memory belongs, at least two sectors matching the access rights of the first electronic device are determined from the target memory using a third determination strategy.

[0018] In the above storage control method, determining a target storage area to be written from the target storage based on the content to be written includes:

[0019] Identify second attribute information of the content to be written;

[0020] In the case where the second attribute information indicates that the content to be written is from a first type of file, a first number of continuous sectors in the target storage are determined as the target storage area to be written; or,

[0021] In the case where the second attribute information indicates that the content to be written is from a second type of file, a second number of non-contiguous sectors in the target storage are determined as the target storage area to be written; or,

[0022] When the second attribute information indicates that the content to be written comes from a first type of file and the data volume is greater than a first threshold, a third number of continuous sectors and a fourth number of non-continuous sectors in the target memory are determined as the target storage area to be written.

[0023] In the above storage control method, determining a target storage area to be read from the target storage based on the information to be read includes at least one of the following:

[0024] Predicting a next associated sector to be read based on a currently read sector, and determining the next associated sector as a target storage area to be read;

[0025] Determining a target storage area to be read from the target storage based on association information between the file to be read and the sector where the file is located;

[0026] At least one sector associated with the currently read sector is determined from the target memory as a target storage area to be read based on the historical read record.

[0027] In the above storage control method, in response to the target event, determining the target storage area from the target storage includes at least one of the following:

[0028] In response to a situation where the speed at which the target memory performs data reading is less than a second threshold, predicting a next associated sector to be read based on a currently read sector and the first model;

[0029] In response to obtaining a trigger instruction for writing a target file, obtaining attribute information of the target file, and determining a plurality of continuous sectors and / or non-continuous sectors in the target memory as the target storage area based on the attribute information;

[0030] In response to the target memory entering a target usage scenario, determining a continuous sector or a non-continuous sector in the target memory corresponding to the current usage scenario as the target storage area;

[0031] In response to being accessed by a target user, a continuous sector or a non-continuous sector in the target memory that matches the user portrait information of the target user is determined as the target storage area.

[0032] In the above storage control method, controlling the target storage area to perform a read / write operation matching the target event includes at least one of the following:

[0033] Flashing the target file to be written to at least two determined continuous sectors or non-continuous sectors through the master control of the target storage;

[0034] The data to be read stored in the target storage area is loaded into the target cache area of ​​the target memory through the master control of the target memory.

[0035] In the above storage control method, at least one of the following is also included:

[0036] Identify attribute information of the target file to be written by using a preset second model and / or a file filter driver;

[0037] When update data of the target file is obtained, updating the target storage area based on the update data;

[0038] In response to the operation of obtaining the target configuration, a first model preset in the target memory is updated, where the first model is used to determine a target sector to be read.

[0039] In a second aspect, an embodiment of the present application provides a memory, comprising a master control and at least one storage area, wherein: the master control is used to determine a target storage area from the at least one storage area in response to a target event; and control the target storage area to perform read and write operations matching the target event; wherein the target storage area includes at least two sectors that are interrelated.

[0040] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0041] Target memory, used to implement read and write operations;

[0042] Processor for:

[0043] In response to the target event, determining a target storage area from the target storage;

[0044] Controlling the target storage area to perform read and write operations matching the target event;

[0045] The target storage area includes at least two sectors associated with each other.

[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, which enables a computer to execute the above-mentioned storage control method. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flow chart of a storage control method provided in an embodiment of the present application;

[0048] Figure 2 An exemplary sector combination diagram provided for an embodiment of the present application;

[0049] Figure 3 An exemplary sector storage method 1 provided in an embodiment of the present application;

[0050] Figure 4 An exemplary sector storage method 2 provided in an embodiment of the present application;

[0051] Figure 5 An exemplary schematic diagram of identifying an inert file or a non-inert file provided in an embodiment of the present application;

[0052] Figure 6 A schematic diagram of the composition structure of a memory provided in an embodiment of the present application;

[0053] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] Currently, both mechanical hard drives and solid-state drives use sectors to manage their storage space. When accessing a certain piece of content, a large number of sector addressing operations are required to read the complete content, resulting in slower data access.

[0056] When an application (Application, APP) accesses a disk, such as a hard disk drive (HDD), a solid state drive (SSD), a compact disc (CD), a digital versatile disc or a digital video disc (DVD), or a Blu-ray disc, there are certain rules. For example, when an APP loads a A.dll file, and file A depends on files B and C, it can be predicted that files B and C will be accessed when file A is accessed. Based on this, the present application proposes a storage control method, which can determine at least two interrelated sectors from an SSD based on a target event, and then load the data in the sector into the cache of the SSD in advance. When it is really necessary to access other sectors except the currently accessed sector, the access speed can be accelerated. Even if the sector has not been accessed after restarting, the data in the sector can be loaded into the cache of the SSD in advance based on the association between the sectors for future access, thereby improving the reading and writing speed.

[0057] The present application provides a storage control method, which is applied to electronic equipment. Figure 1 A flow chart of a storage control method provided in an embodiment of the present application is as follows: Figure 1 As shown, the storage control method may include the following steps S101 to S102:

[0058] Step S101: In response to a target event, determine a target storage area from a target memory; the target storage area includes at least two sectors associated with each other.

[0059] In an embodiment of the present application, the electronic device determines a target storage area from a target memory in response to a target event, and the target storage area includes at least two sectors associated with each other.

[0060] In some embodiments, the target event can be actively triggered by humans, that is, the user triggers it by inputting a trigger instruction, or it can be actively triggered by a machine, that is, the electronic device or target memory detects that the I / O (read / write) speed of the target memory is too low, detects that there is currently an I / O operation for the target memory, detects that the current usage scenario is different from the historical usage scenario, detects that the user currently using the electronic device is different from the user who frequently uses the electronic device, detects that the electronic device is accessed by other devices, detects that the current usage environment is different from the historical usage environment, etc., the electronic device or target memory can trigger the target event; the specific target event and the triggering timing of the target event can be determined according to actual conditions, and the embodiments of the present application are not specifically limited here.

[0061] In some embodiments, the target storage area may be a sector to be written and / or a sector to be read; the specific target storage area may be determined based on actual conditions, and the embodiments of the present application do not make any specific limitations thereon.

[0062] In some embodiments, the at least two sectors in the target storage area may be at least two continuous or discrete sectors that are positionally associated, or may be at least two continuous or discrete sectors that are logically associated.

[0063] Step S102: Control the target storage area to execute read and write operations matching the target event.

[0064] In an embodiment of the present application, after determining a target storage area from a target memory, the electronic device controls the target storage area to perform read and write operations matching a target event.

[0065] In some embodiments, the sector to be written can be controlled to perform a write operation matching the target event, or the sector to be read can be controlled to perform a read operation matching the target event, or both the sector to be read and the sector to be written can be controlled to perform read and write operations matching the target event.

[0066] In an optional embodiment of the present application, in response to a target event, determining a target storage area from a target memory includes at least one of the following: obtaining a source and / or type of the target event, and determining a target storage area from the target memory based on the source and / or type with a corresponding determination strategy; in response to a target write event, determining a target storage area to be written from the target memory based on content to be written; in response to a target read event, determining a target storage area to be read from the target memory based on information to be read.

[0067] In some embodiments, after obtaining the source and / or type of the target event, it is possible to determine whether the current application scenario is to read data or to write data based on the source and / or type of the target event, thereby determining the sector to be read for performing a read operation or the sector to be written for performing a write operation from the target memory based on the application scenario of reading data.

[0068] In some embodiments, if the target event is a target write event, a target storage area to be written is determined from the target memory according to the content to be written of the target write event.

[0069] In some embodiments, the target storage area to be written can be determined from the target storage according to the data type of the content to be written. For example, if the content to be written is determined to be an inert file according to the data type, it is necessary to determine the target storage area divided as an inert file from the target storage; if the content to be written is determined to be a non-inert file according to the data type, it is necessary to determine the target storage area divided as a non-inert file from the target storage; the corresponding target storage area can also be determined from the target storage according to the data amount of the content to be written, or according to the usage method of the content to be written (temporary file or permanent file), etc.

[0070] In some embodiments, if the target event is a target read event, a target storage area to be read is determined from a target memory according to the information to be read of the target read event.

[0071] In some embodiments, the information to be read may be the content of the data to be read, or the type of data to be read, or the location of the data to be read, or a historical record selected from the historical reading records; the specific information to be read may be determined based on actual conditions, and the embodiments of the present application do not make any specific limitations here.

[0072] In some embodiments, the target storage area to be read may be only the sector where the information to be read is located, or it may be the sector where the data associated with the information to be read is located, or it may be the sector associated with the sector where the information to be read is located; the specific target storage area to be read can be determined according to actual conditions, and the embodiments of the present application do not make specific limitations here.

[0073] In an optional embodiment of the present application, a target storage area is determined from a target storage area based on a source and / or type with a corresponding determination strategy, including at least one of the following: when a target event is generated by reading first target data from a target storage area, at least two sectors associated with the first target data are determined from the target storage area with a first determination strategy; when a target event is generated by writing second target data to a target storage area, at least two mutually associated sectors matching first attribute information of the second target data are determined from the target storage area with a second determination strategy; when a target event is generated by a first electronic device establishing a first connection with a second electronic device to which the target storage area belongs, at least two sectors matching access rights of the first electronic device are determined from the target storage area with a third determination strategy.

[0074] In some embodiments, the first determination strategy may be to first determine the sector where the first target data is located, and then determine what data the user typically accesses when accessing the first target data based on historical access data, and then determine the related sectors based on the data associated with the first target data; or after determining the sector where the first target data is located, determine the associated sectors of the currently accessed sector that will definitely be accessed based on a prediction model or historical data; and finally determine the sector where the first target data is located and the related sectors as at least two sectors associated with the first target data.

[0075] As an example, if it is determined that the first target data is located in sector A, and the user usually needs to access another target data when accessing the first target data, and the target data is located in sector B, then sector A and sector B can be determined as at least two sectors associated with the first target data. In this way, only one search is required, that is, when the user needs to continue to access another target data in sector B, there is no need for a second search, thereby ensuring the data reading speed.

[0076] As another example, if it is determined that the first target data is located in sector A, and based on the user's access habits, it is known that the user usually needs to access sector B when accessing sector A, then sector A and sector B can be determined as at least two sectors associated with the first target data. In this way, only one search is required, that is, when the user needs to continue to access another target data in sector B, there is no need for a second search, thereby ensuring the data reading speed.

[0077] In some embodiments, the second determination strategy may be to determine at least two sectors in the target memory for storing the second target data based on attribute information of the second target data. The attribute information may be the data type of the second target data, or the data size, or the storage path, or the modification time, or the file name, or the file suffix and other information. Based on the attribute information, it may be determined whether the second target data is an inert file or a non-inert file. Thus, based on whether the second target data is an inert file or a non-inert file, it may be determined that at least two sectors in the target memory are used to store the second target data.

[0078] In one example, after determining that the second target data is an inert file based on the data type of the second target data, continuous sectors can be allocated to the second target data for storing the second target data; after determining that the second target data is a non-inert file based on the data type of the second target data, non-continuous sectors can be allocated to the second target data for storing the second target data.

[0079] In some embodiments, if a first electronic device establishes a first connection with a second electronic device of a target memory, at least two sectors that match the access rights of the first electronic device can be opened to the first electronic device. At this time, the at least two sectors may include sectors to be written and / or sectors to be read.

[0080] As an example, if a mobile phone (first electronic device) and a computer (second electronic device) establish a connection through wireless or wired communication, the mobile phone can access the solid-state drive (SSD) in the computer. For the computer, it can determine to open all or part of the sectors (at least two sectors) in the SSD to the mobile phone based on the access rights of the mobile phone.

[0081] In an optional embodiment of the present application, determining a target storage area to be written from a target storage device based on the content to be written includes: identifying second attribute information of the content to be written; when the second attribute information represents that the content to be written comes from a first type of file, determining a first number of continuous sectors in the target storage device as the target storage area to be written; or, when the second attribute information represents that the content to be written comes from a second type of file, determining a second number of non-continuous sectors in the target storage device as the target storage area to be written; or, when the second attribute information represents that the content to be written comes from a first type of file and the amount of data is greater than a first threshold, determining a third number of continuous sectors and a fourth number of non-continuous sectors in the target storage device as the target storage area to be written.

[0082] In some embodiments, the second attribute information can be understood as the data type of the content to be written, or the data size, or the storage path, or the modification time, or the file name, or the file suffix and other information; the specific second attribute information can be determined according to actual conditions, and the embodiments of the present application do not make specific limitations here.

[0083] In some embodiments, the first type of file is an inert file and the second type of file is a non-inert file.

[0084] In some embodiments, inert files refer to applications, multimedia data files, or files in the system that are not easily modified, and non-inert files refer to files that are frequently rewritten in applications or systems.

[0085] In some embodiments, it can be determined whether the content to be written belongs to an inert file based on the second attribute information of the content to be written. If so, a first number of continuous sectors in the target memory are used as the target storage area to be written, so that the content to be written is stored in the first number of continuous sectors.

[0086] As an example, if the suffix of the content to be written is png or jpg, it means that the content to be written is a picture file, that is, the content to be written is an inert file. At this time, the first number of continuous sectors to be allocated for the content to be written in the free sectors of the target memory can be determined according to the data amount of the content to be written, so that the allocated first number of continuous sectors can accommodate the content to be written, and the first data amount is determined based on the data amount of the content to be written.

[0087] In some embodiments, it can be determined whether the content to be written belongs to a non-inert file based on the second attribute information of the content to be written. If so, a second number of non-contiguous sectors in the target memory are used as the target storage area to be written, thereby storing the content to be written in the second number of non-contiguous sectors.

[0088] As an example, if the suffix of the content to be written is log or db, it means that the content to be written is a database file or log file that is frequently rewritten, that is, the content to be written is a non-inert file. At this time, the second number of non-contiguous sectors allocated for the content to be written in the free sectors of the target memory can be determined according to the data amount of the content to be written, so that the allocated second number of non-contiguous sectors can accommodate the content to be written, and the second number is determined based on the data amount of the content to be written.

[0089] In some embodiments, if it is determined based on the second attribute information that the content to be written belongs to an inert file, and the data amount of the content to be written is greater than the first threshold, a third number of continuous sectors and a fourth number of non-continuous sectors in the target memory are used as the target storage area to be written, thereby storing the content to be written in the allocated third number of continuous sectors and fourth number of non-continuous sectors.

[0090] As an example, if factors such as upgrades require rewriting the content of an inert file stored in a first number of continuous sectors, the diff description file (content to be written) can be written into a newly applied sector, and the newly applied sector can include a third number of continuous sectors and a fourth number of non-continuous sectors. Thus, when accessing an inert file, the inert file stored in the first number of continuous sectors can be accessed first, and then the diff description file in the newly applied sector can be accessed, and the inert file can be updated based on the diff description file, and finally the updated inert file can be returned to the visitor; optionally, if the amount of data in the diff description file is greater than a first threshold, the inert file in the first number of continuous sectors is released, and a new continuous sector is reapplied for storing the updated inert file.

[0091] In an optional embodiment of the present application, determining a target storage area to be read from a target storage device based on information to be read includes at least one of the following: predicting a next associated sector to be read based on a currently read sector, and determining the next associated sector as the target storage area to be read; determining a target storage area to be read from a target storage device based on associated information between a file to be read and the sector in which it is located; determining at least one sector associated with a currently read sector from a target storage device as the target storage area to be read based on historical read records.

[0092] In some embodiments, after the sector currently being read is determined based on the information to be read, the next associated sector to be read may be predicted based on the sector currently being read according to an artificial intelligence (AI) model.

[0093] As an example, an AI model can be trained based on historical access habits to the target memory. Thus, after the currently read sector A is input into the trained AI model, the model can output which sectors the user often accesses when accessing sector A, such as sector B and sector C. At this time, sector B and sector C can be determined as the target storage areas to be read.

[0094] In some embodiments, training an AI model based on historical access data of a target memory includes the following steps:

[0095] Step 1: Obtain historical access data corresponding to the target storage.

[0096] Step 2: Input the historical access data into the initial AI model. Use the initial AI model to preprocess the data first, that is, matrix the historical access data, and then arrange and combine all sectors in the target memory to calculate the frequency of occurrence of each sector combination.

[0097] Step 3: Determine at least one sector combination in all sector combinations whose occurrence frequency is greater than a certain threshold as a first group of sector combinations.

[0098] Step 4: Calculate the confidence corresponding to each sector combination in the first group of sector combinations, and determine at least one sector combination in the first group of sector combinations whose confidence is greater than a certain threshold as the second group of sector combinations.

[0099] Step 5: Calculate the correlation accuracy of each sector combination in the second group of sector combinations, and determine at least one sector combination in the second group of sector combinations whose correlation accuracy is greater than a certain threshold as the third group of sector combinations.

[0100] Step 6: Train the initial AI model based on the third group of sector combinations and the sector access conditions in the historical access data to obtain a trained AI model.

[0101] In some embodiments, after the sector currently being read is determined based on the information to be read, the next associated sector to be read may also be determined from the target memory based on pre-established associated information.

[0102] In one example, the to-be-read files with different attribute information can be associated with one or more sectors in the target storage in advance according to historical access habits to obtain the association relationship between the to-be-read files and the sectors in which they are located. At this time, the association relationship can be searched based on the to-be-read files to determine the target storage area where the to-be-read files are located.

[0103] In some embodiments, after determining the currently read sector based on the information to be read, at least one sector associated with the currently read sector, that is, the target storage area to be read, may be determined from the target storage based on historical read records.

[0104] In one example, after determining the currently read sector A, based on historical read records, find out which sectors the user usually accesses when accessing sector A, and select one or more sectors with higher access frequency as the target storage area to be read.

[0105] In some embodiments, the association relationship can be first searched according to the file to be read to determine the target storage area where the file to be read is located, and then the next associated sector to be read can be predicted based on the currently read sector according to the AI ​​model, or at least one sector associated with the currently read sector can be determined from the target memory based on the historical read records. The specific application process can be determined according to actual conditions, and the embodiments of the present application are not specifically limited here.

[0106] It should be understood that the present application predicts sectors that may be accessed in the future by learning the historical access habits of sectors, and can improve the access speed when the relevant sectors are actually accessed later.

[0107] In an optional embodiment of the present application, in response to a target event, a target storage area is determined from a target memory, including at least one of the following: in response to the target memory executing data reading at a speed less than a second threshold, predicting the next associated sector to be read based on the currently read sector and the first model; in response to obtaining a trigger instruction to write a target file, obtaining attribute information of the target file, and determining several continuous sectors and / or non-continuous sectors in the target memory as the target storage area based on the attribute information; in response to the target memory entering a target usage scenario, determining the continuous sectors or non-continuous sectors in the target memory corresponding to the current usage scenario as the target storage area; in response to being accessed by a target user, determining the continuous sectors or non-continuous sectors in the target memory that match the user portrait information of the target user as the target storage area.

[0108] In some embodiments, if the speed of the target memory when performing data reading is less than a second threshold, in order to ensure that the user experience is not affected, it is necessary to predict in advance the next associated sector of the currently read sector, so that when the user really needs to access the next associated sector after completing the access to the currently read sector, the data reading speed can be increased, thereby ensuring the user experience.

[0109] It should be understood that when predicting the next associated sector of the currently read sector, the next associated sector to be read can be predicted based on the currently read sector according to the AI ​​model, or at least one sector associated with the currently read sector can be determined from the target memory based on historical read records.

[0110] In some embodiments, if the target file currently needs to be written into the target memory, the corresponding target storage area can be determined from the target memory based on the attribute information of the target file.

[0111] In one example, if it is determined based on the attribute information of the target file that the target file is an inert file, a number of continuous sectors may be allocated to the target file according to the data size of the target file; correspondingly, if it is determined based on the attribute information of the target file that the target file is a non-inert file, a number of non-continuous sectors may be allocated to the target file according to the data size of the target file; correspondingly, if it is determined based on the attribute information of the target file that the target file is an inert file and has a large amount of data, a number of continuous sectors and non-continuous sectors may be allocated to the target file according to the data size of the target file.

[0112] In some embodiments, if the target memory enters a target usage scenario, a continuous sector or a non-continuous sector in the target memory corresponding to the current usage scenario is determined as a target storage area, wherein the target storage area may be a sector to be read for performing a read operation and / or a sector to be written for performing a write operation.

[0113] As an example, if the target usage scenario is a video editing scenario, a large number of continuous sectors may usually be required to perform write operations in the video editing scenario. In this case, the continuous sectors in the target memory used for the video editing scenario can be determined as the target storage area; if the target usage scenario is a database management scenario, the database management scenario usually pays more attention to random reading of non-continuous sectors. In this case, the non-continuous sectors in the target memory used for the database management scenario can be determined as the target storage area; the correspondence between the specific target usage scenario and the sectors in the target memory can be determined according to actual conditions, and the embodiments of the present application are not specifically limited here.

[0114] In some embodiments, if the target user accesses the target memory, a continuous sector or a non-continuous sector in the target memory that matches the user portrait information of the target user can be determined as the target storage area; wherein the target user can access the target memory as a mobile phone, a computer, or a user with a specific identity.

[0115] For example, if the target user is a mobile phone and the target memory is located on a computer, the computer can determine the continuous sectors or non-continuous sectors in the target memory as the target storage area according to the access rights of the mobile phone and then open it to the mobile phone.

[0116] As another example, the target memory may pre-set different memory access permissions for different user identities, that is, if a user's identity indicates that the user is an administrator, then all sectors in the target memory may be opened to the user for the user to perform read and write operations; if a user's identity indicates that the user is an ordinary user, then continuous sectors or non-continuous sectors in the target memory may be opened to the user for the user to perform read and write operations.

[0117] As another example, the target storage device may analyze the user's storage requirements or access habits according to the user's user profile information, thereby being able to open matching continuous sectors or non-continuous sectors for different users based on different user profile information.

[0118] In an optional embodiment of the present application, controlling the target storage area to perform read and write operations matching the target event includes at least one of the following: flushing the target file to be written to at least two determined consecutive sectors or non-consecutive sectors through the master control of the target storage; loading the data to be read stored in the target storage area into the target cache area of ​​the target storage through the master control of the target storage.

[0119] In some embodiments, first, the master control of the target storage device determines the target file to be written and at least two consecutive sectors or non-consecutive sectors to perform the write operation based on the received write instruction. Then, the master control can flush the target file to be written to at least two consecutive sectors or non-consecutive sectors. Finally, the master control can return a write completion signal to indicate that the writing of the target file to be written is completed.

[0120] In some embodiments, first, the master control of the target memory determines the data to be read and the target storage area where the data to be read is stored based on the received read instruction. Then, the master control can read the data to be read from the target storage area and load the data to be read into the target cache area. Finally, the master control returns the data to be read from the target cache area, indicating that the data reading operation is completed.

[0121] In an optional embodiment of the present application, attribute information of a target file to be written is identified through a preset second model and / or a file filter driver; when updated data of the target file is obtained, the target storage area is updated based on the updated data; in response to obtaining a target configuration operation, a preset first model of the target storage is updated, and the first model is used to determine a target sector to be read.

[0122] In some embodiments, when identifying the attribute information of the target file to be written, the target file to be written can be input into the second model, and the second model is used to determine whether the target file to be written is an inert file or a non-inert file, or the attribute information of the target file to be written can be identified through a file filter driver to determine whether the target file to be written is an inert file or a non-inert file; the specific method of identifying the attribute information can be determined according to actual conditions, and the embodiments of the present application are not specifically limited here.

[0123] In some embodiments, the training process of the second model includes the following steps:

[0124] Step 1: Obtain all file information of the system, distinguish file types by file suffixes, and manually mark quasi-inert files.

[0125] Step 2: Read the attribute information of the quasi-inert file, such as storage path, data size, file name, suffix, modification time, etc., input the attribute information into the initial second model, and use the initial second model to process and predict the attribute information to obtain the inert file prediction result of the quasi-inert file.

[0126] Step 3: Compare the inert file prediction results of the quasi-inert file with the annotation information of the quasi-inert file, calculate the loss function, use the gradient descent method to optimize the weight values ​​of each attribute, perform training in a loop to obtain a smaller loss function, and obtain the trained second model.

[0127] In some embodiments, when the updated data of the target file is obtained, since the target file is stored in the target storage area, it is necessary to update the target storage area based on the updated data.

[0128] As an example, if the target file stored in the target storage area needs to be updated due to factors such as upgrading, the update data can be written into a newly applied sector. Thus, when accessing the target file, the target file stored in the target storage area can be accessed first, and then the update data in the newly applied sector can be accessed, and the target file can be updated based on the update data, and finally the updated target file can be returned to the visitor; optionally, if the amount of update data is large, the target file in the target storage area can be released, and a new continuous sector can be reapplied for storing the updated target file.

[0129] In some embodiments, a target configuration operation is performed to update a first model preset in the target memory, where the first model is used to determine a target sector to be read.

[0130] In one example, the target configuration operation may be a configuration operation for updating the association relationship between related sectors in the target memory. Thus, when the association relationship between related sectors in the target memory is updated, the corresponding first model is also updated accordingly, which enables a better prediction effect when the first model is subsequently used to determine the target sector to be read.

[0131] It should be understood that since inert files are usually not modified, if inert files are stored randomly as ordinary files, multiple addressing is required when reading these files, resulting in a decrease in reading performance. Based on this, when the present application determines that the target file to be written is an inert file, it allocates continuous sectors to the inert file for storing the file. Based on this, the access efficiency of subsequent access to the inert file can be improved.

[0132] An embodiment of the present application provides a storage control method, which includes: in response to a target event, determining a target storage area from a target memory; controlling the target storage area to perform read and write operations matching the target event; wherein the target storage area includes at least two sectors that are associated with each other; using the above implementation scheme, the present application determines at least two sectors that are associated with each other from an SSD based on the target event, and then can pre-load the data in the sector into the cache of the SSD, and when it is really necessary to access other sectors except the currently accessed sector, the access speed can be accelerated, and even if the sector has not been accessed after restart, the data in the sector can be pre-loaded into the cache of the SSD based on the association relationship between the sectors for future access, thereby improving the read and write speed.

[0133] Based on the above embodiment, the present application explains the training process of the above first model through an exemplary embodiment, and the specific steps are as follows:

[0134] Step 1: Obtain the historical access status of each sector in the SSD (target storage) through the disk filter driver, record the access data of all sectors as a sample data at regular intervals (for example, 5 seconds), and obtain the historical access data.

[0135] Step 2: When the read and write speed of the SSD is less than the second threshold, or the amount of historical access data exceeds a certain threshold, the historical access data is input into the AI ​​model (first model).

[0136] Step 2.1: Preprocess the historical access data. Refer to Table 1 to matrix the historical access data:

[0137] Table 1 An exemplary access data table

[0138] Sector A Sector B Sector C Sector H Sector I Sector J Sector K Sector L 16:00:00 1 1 1 0 0 1 1 0 16:00:05 1 1 0 1 0 1 0 0 16:00:10 0 0 1 0 0 1 1 1 16:00:15 0 0 0 1 0 1 0 0

[0139] It should be understood that a value of "1" in Table 1 indicates that the sector is accessed at the current moment, and a value of "0" indicates that the sector is not accessed at the current moment.

[0140] Step 2.2: Arrange and combine the sectors and calculate the frequency of each sector combination.

[0141] Optional, see Figure 2 , which is the total sector combination obtained by permuting and combining sectors A, B, C, D and E.

[0142] Step 2.3: Determine the sector combinations with a frequency greater than 50% as frequent items. At the same time, in order to reduce the computational complexity, use the following strategy to prune the data: If a sector combination is a frequent item, all its subitems are frequent items. If a sector combination is an infrequent item, all its supersets are infrequent items.

[0143] Step 2.4: Calculate the confidence of each frequent item in all frequent items (the first group of sector combinations), find the frequent items with confidence greater than 80%, and obtain the second group of sector combinations.

[0144] Step 2.5: Calculate the correlation accuracy of each sector combination in the second group of sector combinations, and determine the sector combinations with correlation accuracy greater than 90% as the third group of sector combinations.

[0145] It should be understood that accurate data cannot be obtained only by frequency of occurrence and credibility. For example, if in 1000 access records, sector A is accessed 500 times, sector B is accessed 900 times, and sector AB is accessed 400 times, the confidence P(A|B) of sector AB is calculated as shown in the following formula (1):

[0146]

[0147] However, based on the confidence alone, it is believed that 80% of the time when sector A is accessed, sector B is accessed. However, it should be noted that 500 times when sector A is not accessed, sector B is also accessed 500 times, that is, P! (A|B) is 100%, and the opposite conclusion is drawn: if sector A is not accessed, sector B will be accessed 100%. This is obviously wrong. Therefore, it is necessary to increase the probability of association accuracy, which represents the increase in the probability of accessing sector A to access sector B, L(A→B), as shown in the following formula (2):

[0148]

[0149] The correlation accuracy of each sector combination in the second group of sector combinations is calculated based on formula (2), and the sector combinations with correlation accuracy lower than 90% are discarded.

[0150] Step 3: Use the real access data of the sectors to train the above AI model, that is, use the algorithm in step 2 as the middle layer of the AI ​​model for training, combine the real access data of the sectors to manually mark the association between sectors, and then use the gradient descent method to modify the occurrence frequency threshold, confidence threshold, association accuracy threshold, sampling time interval, sampling time and other parameter values ​​in the AI ​​model, and finally obtain the AI ​​model with the highest prediction accuracy.

[0151] Step 4: Deploy the AI ​​model to the user client to process the sector access data of the user's SSD and record any strongly correlated sector combinations.

[0152] Step 5: When the user's SSD read / write speed is lower than a certain threshold, the strongly associated sector combination is sent to SSDFW (firmware) so that the SSD can transfer each sector combination in the strongly associated sector combination to a continuous storage area at an appropriate time.

[0153] It should be understood that reference Figure 3 , sector combination A includes sectors A1, A2, A3 and A4, sector combination B includes sectors B1, B2, B3, B4 and B5, sector combination C includes sectors C1, C2, C3 and C4, Figure 3 In the SSD, the storage locations of the associated sectors in each sector combination are discrete. Therefore, when reading the sector combination, the addressing process is slow because the storage locations are discrete. Based on this, the SSD can transfer each sector combination in the strongly associated sector combination to a continuous storage area at the appropriate time. Figure 4 The sector storage locations in sector combination A, sector combination B and sector combination C are continuous, so as to further improve the access speed to the sectors.

[0154] Based on the above embodiment, the present application explains the training process of the above second model through an exemplary embodiment, and the specific steps are as follows:

[0155] Step 1. Get all the file information of the system and mark whether the file is an inert file manually. You can distinguish whether it is an inert file by the file suffix. For program code files, such as files with suffixes such as exe and dll, and image files, such as files with suffixes such as png and jpg, the file can be judged as a quasi-inert file. For log files or database files, such as files with suffixes such as log and db, which are usually files with high frequency rewriting, the file can be judged as a non-inert file.

[0156] Optional, reference Figure 5 , the files with the suffixes of DLL, EXE in Application 1, Application 2, Application 3 and Application 4, as well as the files identified as pictures, videos or audios based on the suffixes are all determined as inert files, and the files with the suffixes of log, db, etc. are determined as non-inert files.

[0157] Step 2. For quasi-inert files, the attribute information of the file can be read, such as storage path, size, file name, suffix, modification time, etc., and this information can be input into the initial second model. The multi-layer neural network in the initial second model is used to process and predict the above attribute information to obtain the prediction result of the quasi-inert file, and the prediction result is compared with the annotation information of the quasi-inert file. The loss function is calculated, and then the gradient descent method is used to optimize the weight value of each attribute. The training is repeated to obtain a smaller loss function to obtain a trained second model.

[0158] Step 3: Deploy the trained second model to the user client, obtain the attribute information of the file written when the program is installed or accessed when the program is running through the file filtering driver, and use the trained second model to predict and distinguish whether the file is an inert file. Pass the information of the discovered inert file to the SSD.

[0159] Step 4: For inert files, the SSD can apply for a continuous flash memory area to store the inert files. This can reduce a large number of addressing operations caused by random access when reading the inert file next time, greatly increasing the file reading speed.

[0160] Optionally, if the inert file in this continuous flash memory area needs to be rewritten due to factors such as upgrades, at this time, the inert file in the flash memory can be not directly rewritten, but a new storage space can be applied for to store the diff description file (updated content). Therefore, when accessing the inert file, the SSD can first read the inert file written for the first time in a continuous flash memory area, and then read the diff description file in the newly applied storage space, modify the inert file based on the diff description file, and finally return the modified inert file to the operating system. When the diff description file exceeds a certain amount of data, it is necessary to release the inert file in the previous continuous flash memory area, and then reapply for a new continuous flash memory area to store the updated inert file.

[0161] Based on the above embodiment, in another embodiment of the present application, a memory 1 is provided. Figure 6 A schematic diagram of the composition structure of a memory provided in this application, such as Figure 6 As shown, the memory 600 includes a main control 601 and at least one storage area 602:

[0162] The master control 601 is used to determine a target storage area from the at least one storage area 602 in response to a target event; and control the target storage area to perform read and write operations matching the target event; wherein the target storage area includes at least two sectors associated with each other.

[0163] An embodiment of the present application provides a memory, which includes: a master control and at least one storage area: the master control is used to determine a target storage area from at least one storage area in response to a target event; control the target storage area to perform read and write operations matching the target event; wherein the target storage area includes at least two sectors that are associated with each other; using the above implementation scheme, the present application determines at least two sectors that are associated with each other from an SSD based on the target event, and then can pre-load the data in the sector into the cache of the SSD, and when it is really necessary to access other sectors except the currently accessed sector, the access speed can be accelerated, and even if the sector has not been accessed after restart, the data in the sector can be loaded into the cache of the SSD in advance based on the association relationship between the sectors for future access, thereby improving the read and write speed.

[0164] Figure 7 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of the present application. In practical applications, based on the same disclosed concept of the above embodiments, Figure 7 As shown, the electronic device 700 of this embodiment includes: a target memory 701 and a processor 702 .

[0165] In some embodiments, the processor 702 may be a central processing unit (CPU) of an electronic device, or a master controller of a certain memory (eg, SSD), or a controller in a network attached storage (NAS) system, etc.

[0166] In the process of a specific embodiment, the processor 702 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It is understandable that for different electronic devices 700, the electronic device used to implement the processor function may also be other, which is not specifically limited in this embodiment.

[0167] In the embodiment of the present application, the processor 702 implements the following storage control method:

[0168] In response to the target event, determining a target storage area from the target storage;

[0169] Controlling the target storage area to perform read and write operations matching the target event;

[0170] The target storage area includes at least two sectors associated with each other.

[0171] In some embodiments, the processor 702 is further used to obtain the source and / or type of the target event, determine the target storage area from the target memory based on the source and / or type with a corresponding determination strategy; in response to a target write event, determine the target storage area to be written from the target memory based on the content to be written; in response to a target read event, determine the target storage area to be read from the target memory based on the information to be read.

[0172] In some embodiments, the processor 702 is further used to determine, in a case where the target event is generated by reading the first target data from the target memory, at least two sectors associated with the first target data using a first determination strategy; in a case where the target event is generated by writing the second target data to the target memory, at least two sectors associated with each other that match the first attribute information of the second target data using a second determination strategy; and in a case where the target event is generated by the first electronic device establishing a first connection with the second electronic device to which the target memory belongs, at least two sectors matching the access rights of the first electronic device using a third determination strategy from the target memory.

[0173] In some embodiments, the processor 702 is further used to identify second attribute information of the content to be written; when the second attribute information indicates that the content to be written comes from a first type of file, a first number of continuous sectors in the target memory are determined as the target storage area to be written; or, when the second attribute information indicates that the content to be written comes from a second type of file, a second number of non-continuous sectors in the target memory are determined as the target storage area to be written; or, when the second attribute information indicates that the content to be written comes from a first type of file and the amount of data is greater than a first threshold, a third number of continuous sectors and a fourth number of non-continuous sectors in the target memory are determined as the target storage area to be written.

[0174] In some embodiments, the processor 702 is further used to predict the next associated sector to be read based on the sector currently being read, and determine the next associated sector as the target storage area to be read; determine the target storage area to be read from the target storage based on the association information between the file to be read and the sector where it is located; and determine at least one sector associated with the currently read sector from the target storage as the target storage area to be read based on historical reading records.

[0175] In some embodiments, the processor 702 is further used to predict the next associated sector to be read based on the currently read sector and the first model in response to a situation where the target memory executes data reading at a speed less than a second threshold; obtain attribute information of the target file in response to obtaining a trigger instruction to write a target file, and determine several continuous sectors and / or non-continuous sectors in the target memory as the target storage area based on the attribute information; in response to the target memory entering a target usage scenario, determine the continuous sectors or non-continuous sectors in the target memory corresponding to the current usage scenario as the target storage area; in response to being accessed by a target user, determine the continuous sectors or non-continuous sectors in the target memory that match the user portrait information of the target user as the target storage area.

[0176] In some embodiments, the processor 702 is also used to flush the target file to be written to at least two determined consecutive sectors or non-consecutive sectors through the master control of the target memory; and load the data to be read stored in the target storage area into the target cache area of ​​the target memory through the master control of the target memory.

[0177] In some embodiments, the processor 702 is further used to identify attribute information of a target file to be written through a preset second model and / or a file filter driver; when update data of the target file is obtained, update the target storage area based on the update data; in response to obtaining a target configuration operation, update a preset first model of the target storage, wherein the first model is used to determine a target sector to be read.

[0178] An embodiment of the present application provides a storage medium having a computer program stored thereon. The computer-readable storage medium stores one or more programs. The one or more programs can be executed by one or more processors and are applied to a storage control device. The computer program implements the storage control method as described above.

[0179] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0180] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a storage control device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the storage control method of each embodiment of the present disclosure.

[0181] The above are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application.

Claims

1. A storage control method, comprising: In response to the target event, determining a target storage area from the target storage; Controlling the target storage area to perform read and write operations matching the target event; The target storage area includes at least two sectors associated with each other.

2. The method according to claim 1, wherein: In response to the target event, determining a target storage area from the target storage includes at least one of the following: Obtaining a source and / or type of the target event, and determining a target storage area from the target storage according to a corresponding determination strategy based on the source and / or type; In response to a target write event, determining a target storage area to be written from the target storage based on the content to be written; In response to a target read event, a target storage area to be read is determined from the target memory based on the information to be read.

3. The method according to claim 2, wherein: Determining a target storage area from the target storage according to a corresponding determination strategy based on the source and / or type includes at least one of the following: In the case where the target event is generated by reading first target data from the target memory, determining at least two sectors associated with the first target data from the target memory using a first determination strategy; In the case where the target event is generated by writing second target data into the target memory, determining at least two mutually associated sectors matching the first attribute information of the second target data from the target memory using a second determination strategy; When the target event is generated by the first electronic device establishing a first connection with the second electronic device to which the target memory belongs, at least two sectors matching the access rights of the first electronic device are determined from the target memory using a third determination strategy.

4. The method according to claim 2, wherein: Determining a target storage area to be written from the target storage based on the content to be written, comprising: Identify second attribute information of the content to be written; In the case where the second attribute information indicates that the content to be written is from a first type of file, a first number of continuous sectors in the target storage are determined as the target storage area to be written; or, In the case where the second attribute information indicates that the content to be written is from a second type of file, a second number of non-contiguous sectors in the target storage are determined as the target storage area to be written; or, When the second attribute information indicates that the content to be written comes from a first type of file and the data volume is greater than a first threshold, a third number of continuous sectors and a fourth number of non-continuous sectors in the target memory are determined as the target storage area to be written.

5. The method according to claim 2, wherein: Determining a target storage area to be read from the target storage based on the information to be read includes at least one of the following: Predicting a next associated sector to be read based on a currently read sector, and determining the next associated sector as a target storage area to be read; Determining a target storage area to be read from the target storage based on association information between the file to be read and the sector where the file is located; At least one sector associated with the currently read sector is determined from the target memory as a target storage area to be read based on the historical read record.

6. The method according to any one of claims 1 to 5, wherein: In response to the target event, determining a target storage area from the target storage includes at least one of the following: In response to a situation where the speed at which the target memory performs data reading is less than a second threshold, predicting a next associated sector to be read based on a currently read sector and the first model; In response to obtaining a trigger instruction for writing a target file, obtaining attribute information of the target file, and determining a plurality of continuous sectors and / or non-continuous sectors in the target memory as the target storage area based on the attribute information; In response to the target memory entering a target usage scenario, determining a continuous sector or a non-continuous sector in the target memory corresponding to the current usage scenario as the target storage area; In response to being accessed by a target user, a continuous sector or a non-continuous sector in the target memory that matches the user portrait information of the target user is determined as the target storage area.

7. The method according to claim 1, wherein: Controlling the target storage area to perform a read and write operation matching the target event includes at least one of the following: Flashing the target file to be written to at least two determined continuous sectors or non-continuous sectors through the master control of the target storage; The data to be read stored in the target storage area is loaded into the target cache area of ​​the target memory through the master control of the target memory.

8. The method according to claim 7, further comprising at least one of the following: Identify attribute information of the target file to be written by using a preset second model and / or a file filter driver; When update data of the target file is obtained, updating the target storage area based on the update data; In response to the operation of obtaining the target configuration, a first model preset in the target memory is updated, where the first model is used to determine a target sector to be read.

9. A memory, comprising a main control and at least one storage area: The master control is used to determine a target storage area from the at least one storage area in response to a target event; and control the target storage area to perform a read and write operation matching the target event; wherein, The target storage area includes at least two sectors associated with each other.

10. An electronic device, comprising: Target memory, used to implement read and write operations; Processor for: In response to the target event, determining a target storage area from the target storage; Controlling the target storage area to perform read and write operations matching the target event; The target storage area includes at least two sectors associated with each other.