Data access method and apparatus
Patent Information
- Application Number
- PCT/CN2026/078233
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-03-10
- Filing Date
- 2026-02-10
- Publication Date
- 2026-09-17
Smart Images

Figure CN2026078233_17092026_PF_FP_ABST
Abstract
Description
A data access method and apparatus
[0001] Cross-reference of related applications
[0002] This application claims priority to Chinese Patent Application No. 202510276915.3, filed on March 10, 2025, entitled "A Data Access Method and Apparatus", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of storage technology, and in particular to a data access method and apparatus. Background Technology
[0004] In recent years, the demand for personal / family digital storage has been growing. With the advancement of global digitalization and the rapid growth of global digital assets, the demand for storage space for personal / family digital documents has also grown rapidly with the technological development of photos / videos.
[0005] With the rise of AIGC large-scale models, the amount of data in home storage will grow rapidly. Therefore, storage capacity is the core competitiveness of home storage devices. That is, how to store more data in limited storage space is the most concerning issue in the industry.
[0006] One current storage method is to use a cloud-edge collaboration approach, expanding local capacity with cloud space. However, the data transmission performance from the cloud to the edge is low and the latency is high. Summary of the Invention
[0007] This application provides a data access method and apparatus to reduce data transmission latency and increase storage space.
[0008] In a first aspect, embodiments of this application provide a data access method. This method can be applied to a home storage device. The home storage device includes a first storage area and a second storage area. The first storage area stores raw data belonging to "hot data," and the second storage area stores compressed data belonging to "cold data." The method includes: receiving a first access request from a terminal device, the first access request being for requesting access to first data, the first data belonging to the "cold data"; decompressing the compressed data of the first data in the second storage area back to the first storage area, and sending the decompressed raw data of the first data to the terminal device.
[0009] For example, a home storage device can be a home NAS device.
[0010] In the above solution, data stored in home storage devices is categorized into cold data (rarely accessed) and hot data (frequently accessed). Cold and hot data are stored in different areas of the home storage device, with cold data being compressed. This indirectly increases the storage system's capacity with minimal impact on access time and does not degrade image access performance.
[0011] In one possible implementation, the first data is a document, video, image, or audio.
[0012] In one possible implementation, the first data is a first image, and the first storage area also stores a thumbnail of the first image; the first access request indicates the thumbnail of the first image. In the above implementation, storing the image thumbnail in the first storage area of the hot data allows users of the terminal device to intuitively obtain partial information about the image, and because the thumbnail is obtained through downsampling, it occupies less space.
[0013] In one possible implementation, the home storage device also stores hot or cold information of the first data, the hot or cold information indicating that the first data belongs to the cold data.
[0014] In the above solution, by storing hot and cold data information in home storage devices, it is possible to more quickly confirm whether the accessed data is cold data.
[0015] In one possible implementation, the method further includes:
[0016] After decompressing the compressed data of the first data in the second storage area back to the first storage area, the hot / cold information of the first data is updated, wherein the updated hot / cold information of the first data indicates that the first data belongs to hot data.
[0017] In the above scheme, timely updating of hot and cold data information can reduce compression problems caused by outdated hot and cold data.
[0018] In one possible implementation, the method further includes:
[0019] Obtain access information of second data in a first storage area within a first time period, wherein the access information includes one or more of the following: recent access time, access frequency, or access frequency;
[0020] If the access information of the second data meets the conditions for cold data, the original data of the second data in the first storage area is compressed into the second storage area.
[0021] In the above scheme, if the hot data stored in the first storage area is not accessed for a long time, the data can be promptly changed to cold data and compressed for storage, which can increase the storage space.
[0022] In one possible implementation, the second data is a second image, and the method further includes generating a thumbnail of the second image in the first storage area.
[0023] In the above implementation, generating thumbnails of compressed images in the first storage area of hot data in a timely manner allows users of terminal devices to intuitively obtain partial information about the images.
[0024] In one possible implementation, determining that the access information of the second data satisfies the conditions of the cold data includes one or more of the following: determining that the time difference between the current time and the most recent access time of the second data is greater than a time threshold; or determining that the access frequency of the second data is less than a frequency threshold; or determining that the access frequency of the second data is less than a number of times threshold.
[0025] In one possible implementation, the method further includes: receiving a write request from the terminal device, the write request including the original data of the third data and a privacy indication of the third data; when the privacy indication indicates that the third data belongs to privacy data, compressing the original data of the third data to obtain compressed data of the third data, and storing the compressed data of the third data in the second storage area.
[0026] Home storage devices may store data that is considered private by users, such as images of ID cards or driver's licenses. This data is generally not accessed frequently. Therefore, when storing such private data on home storage devices, users can label the data to indicate whether it is private. Home storage devices can compress private data locally when storing it, which can improve the security of the private data.
[0027] In one possible implementation, the home storage device further stores multiple relationship graphs, which are used to describe the association between at least two pieces of data stored in the home storage device; the first piece of data belongs to a first relationship graph; the first relationship graph is one of the multiple relationship graphs; the method further includes: after receiving a first access request from a terminal device, decompressing the compressed data of the data other than the first piece of data indicated by the first relationship graph in the second storage area to the first storage area.
[0028] In the above-mentioned scheme of this application, cold data is activated according to the relationship graph, ensuring that data that has not been accessed for a long time is compressed and stored. Furthermore, after cold data is accessed, other cold data in the relationship graph can be activated in advance. Since other data in the relationship graph are associated with the currently accessed data storage and may be accessed in the near future, activating them in advance can improve access speed.
[0029] In one possible implementation, the method further includes:
[0030] Before decompressing the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area, an idle time period is determined for the home storage device.
[0031] The above solution can reduce reliance on computing power by decompressing other cold data in the relationship graph during the idle time of home storage devices.
[0032] In one possible implementation, the home storage device is integrated into a home gateway.
[0033] In one possible implementation, a second access request is received from a terminal device, the second access request being for accessing fourth data. The home storage device is connected to cloud storage, the fourth data is cold data, and the fourth data is compressed and stored in the cloud storage. The home storage device obtains the compressed data of the fourth data from the cloud storage, decompresses the compressed data of the fourth data to obtain the original data of the fourth data, and sends the original data of the fourth data to the terminal device.
[0034] In one possible implementation, the home storage device stores the raw data of the fourth data in the first storage area.
[0035] In one possible implementation, the first piece of data is considered private data. Storing this private data locally on a home storage device can improve its security.
[0036] In one possible implementation, the fourth data is not considered privacy data.
[0037] Secondly, embodiments of this application provide a data access device applied to a home storage device, including an application unit, a storage unit, and a processing unit. The storage unit includes a first storage area and a second storage area: the first storage area stores raw data belonging to "hot data," and the second storage area stores compressed data belonging to "cold data," wherein...
[0038] The application unit is configured to receive a first access request from a terminal device, the first access request being used to request access to first data, the first data being the cold data;
[0039] The processing unit is used to decompress the compressed data of the first data in the second storage area back to the first storage area;
[0040] The application unit is further configured to send the original data of the first data obtained by decompression in the first storage area to the terminal device.
[0041] In one possible implementation, the application unit is further configured to determine that the first data is cold data and send a decompression request to the processing unit, the decompression request being used to request the decompression of the first data from the second storage area;
[0042] The processing unit is specifically configured to decompress the compressed data of the first data in the second storage area to the first storage area according to the decompression request.
[0043] In one possible implementation, the first data is a first image, and the first storage area also stores a thumbnail of the first image; the first access request indicates the thumbnail of the first image.
[0044] In one possible implementation, the storage unit also stores hot / cold information of the first data, the hot / cold information indicating that the first data belongs to the cold data;
[0045] The application unit is specifically used to query the hot and cold information of the first data from the storage unit to determine that the first data belongs to the cold data.
[0046] In one possible implementation, the application unit is further configured to update the hot / cold information of the first data after the processing unit decompresses the compressed data of the first data in the second storage area to the first storage area, wherein the updated hot / cold information of the first data indicates that the first data belongs to hot data.
[0047] In one possible implementation, the processing unit is further configured to obtain access information of second data in the first storage area within a first time period, the access information including one or more of the following: recent access time, access frequency, or access frequency.
[0048] When it is determined that the access information of the second data meets the conditions for cold data, the original data of the second data in the first storage area is compressed into the second storage area.
[0049] In one possible implementation, the second data is a second image, and the processing unit is further configured to generate a thumbnail of the second image and save the thumbnail of the second image to the first storage area.
[0050] In one possible implementation, the processing unit is specifically configured to determine whether the access information of the second data satisfies the conditions of the cold data based on one or more of the following:
[0051] Determine that the time difference between the current time and the most recent access time of the second data is greater than a time threshold; or,
[0052] Determine that the access frequency of the second data is less than a frequency threshold; or,
[0053] It is determined that the access frequency of the second data is less than the number of accesses threshold.
[0054] In one possible implementation, the application unit is further configured to receive a write request from the terminal device, the write request including the original data of the third data and a privacy indication of the third data, the privacy indication indicating that the third data belongs to privacy data;
[0055] The processing unit is further configured to compress and store the original data of the third data in the second storage area.
[0056] In one possible implementation, the home storage device further stores multiple relationship graphs, which are used to describe the association between at least two pieces of data stored in the home storage device; the first piece of data belongs to a first relationship graph; the first relationship graph is one of the multiple relationship graphs.
[0057] The processing unit is also used for
[0058] After decompressing the compressed data of the first data in the second storage area to the first storage area, decompress the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area.
[0059] In one possible implementation, the processing unit is further configured to: determine an idle time period reaching the home storage device before decompressing the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area.
[0060] Thirdly, embodiments of this application provide a home storage device, including: a processor and a memory; the processor and the memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the method in the first aspect or any optional implementation of the first aspect is executed.
[0061] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform: the method in the first aspect or any optional implementation of the first aspect.
[0062] Fifthly, embodiments of this application provide a chip, including: a processor for calling and running a computer program from a memory, causing an electronic device on which the chip is mounted to perform: the method of the first aspect or any optional implementation of the first aspect.
[0063] Based on the implementations provided in the above aspects, this application can be further combined to provide more implementations. Attached Figure Description
[0064] Figure 1A is a schematic diagram of the communication system in an embodiment of this application;
[0065] Figure 1B is a schematic diagram of the communication system in an embodiment of this application;
[0066] Figure 2 is a schematic flowchart of the data access method provided in an embodiment of this application;
[0067] Figure 3 is a schematic diagram of cold and heat separation provided in an embodiment of this application;
[0068] Figure 4 is a schematic diagram of access processing based on relation graphs provided in an embodiment of this application;
[0069] Figure 5 is a schematic diagram of the structure of a home storage device provided in an embodiment of this application;
[0070] Figure 6 is a schematic diagram of the structure of a home storage device provided in an embodiment of this application;
[0071] Figure 7 is a schematic diagram of the processing flow of a home storage device provided in an embodiment of this application;
[0072] Figure 8 is a schematic diagram of the structure of a home storage device provided in an embodiment of this application;
[0073] Figure 9 is a schematic diagram of the chip system structure provided in an embodiment of this application. Detailed Implementation
[0074] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0075] In the description of this application, unless otherwise stated, "multiple" refers to two or more. Additionally, " / " indicates that the related objects are in an "or" relationship; for example, A / B can represent A or B. "And / or" in this application merely describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, to clearly describe the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and are not necessarily different. It should also be noted that, unless specifically stated, the specific description of some technical features in one embodiment can also be used to explain the corresponding technical features mentioned in other embodiments.
[0076] The relevant concepts in the embodiments of this application will be introduced below.
[0077] Cold data refers to data that is rarely accessed and used. Cold data is accessed infrequently but needs to be stored for a long time. It is usually stored in slower storage media to save costs and storage space.
[0078] Hot data refers to data that is frequently accessed and used. Hot data requires fast read / write speeds and response times, so it is usually stored in high-speed storage media for quick access and processing.
[0079] Thumbnail: A smaller version of an image on a webpage or electronic device after being downsampled. Thumbnail data usually includes a hyperlink to the original image. Subsampling: Also known as downsampling, it can be simply understood as reducing the size of an image by decreasing the number of sampling points in the matrix.
[0080] A terminal refers to a terminal device located on or outside a home LAN, such as a computer, tablet, or smartphone. A terminal includes an input unit that receives user input and generates corresponding control commands, text content, or voice content based on user or system settings. For example, if the input unit is a touchscreen, it might generate an access command (or access request) to access the first image displayed in the user's photo album. Another example is a delete image command generated when the user long-presses the first image in the album and selects the "delete" option from the pop-up list. Yet another example is a rename image command generated when the user long-presses the first image in the image directory and selects the "rename" option from the pop-up list. In practice, the terminal's input unit can also be a voice input unit, which receives user voice input and generates corresponding control commands, text content, or voice content, but this will not be detailed here.
[0081] The home storage device involved in this application can be a network attached storage (NAS) device, in which case it can also be referred to as a home NAS device. A NAS device is a device specifically designed for storing and sharing files. A NAS device can be a standalone storage system connected to other devices, such as computers, laptops, smartphones, and smart TVs, via a local area network (LAN) or the Internet. A NAS device includes storage devices (e.g., disk arrays, tape drives, or removable storage media) and embedded system software that provides cross-platform file sharing capabilities. The home NAS device is located on the LAN side of the home gateway and connects to the external wide area network (WAN) through the home gateway.
[0082] A home gateway is a network interconnection device between a home local area network (LAN) and an external wide area network (WAN), used to enable communication between devices within the home LAN and devices outside the home LAN. A home gateway can be a general-purpose home gateway router, such as a customer premises equipment (CPE), an optical modem or optical network terminal (ONT), or a wireless access point (AP).
[0083] In one possible implementation, the home gateway has a built-in NAS unit providing NAS services. In this case, terminals can access files in the built-in NAS unit of the home gateway by accessing the home gateway. This implementation can be understood as the home storage device being built into the home gateway, or as the home storage device being integrated and deployed with the home gateway.
[0084] In another possible implementation, the home storage device is a standalone device located on the LAN side of the home gateway. In this case, by configuring the connection port between the home NAS device and the home gateway, the terminal can access files on the home NAS device through the home gateway. For example, by using port forwarding technology to map the IP port of the home NAS device to the home gateway, the remote terminal can communicate with the home gateway via a remote domain name and access the home NAS device through the home gateway.
[0085] In the embodiments of this application, the home NAS devices mentioned below can be either the NAS unit built into the home gateway or the independent device located on the LAN side of the home gateway.
[0086] Figure 1A is a schematic diagram of the communication system in an embodiment of this application. The communication system includes a home gateway 10, a home NAS device 20, and a terminal device 30. The home gateway 10 and the home NAS device 20 are located within a home local area network (LAN), while the network where the terminal device 30 is located can be a LAN or the Internet. For example, the Internet where the terminal device 30 is located can be: a Global System for Mobile Communication (GSM) network, a General Packet Radio Service (GPRS) network, a Code Division Multiple Access (CDMA) network, a Wideband Code Division Multiple Access (WCDMA) network, a Long Term Evolution (LTE) network, a Fifth Generation Mobile Communication System (5G) network, or a future communication network. The home NAS device may be built into the home gateway or be independent of the home gateway.
[0087] The home NAS device 20 can store data from various family members. This data can be one or more of the following: video data, image data, audio data, or document data. Document data can be in formats such as Word, PDF, TXT, RTF, XLSX, or PPTX. Audio data refers to data storing sound content, such as data in formats like MP3, CD, WAVE (*.WAV), WMA, and RealAudio. Video data refers to data storing various moving image content, such as data in formats like WMV, AVI, MP4, RM / RMVB, and KMV. Image data refers to data storing various tangible content, such as data in formats like JPEG, TIFF, BMP, GIF, and PNG.
[0088] In some implementation scenarios, home storage devices can also be connected to cloud storage, as shown in Figure 1B.
[0089] With the rapid growth of digital assets, the demand for home digital storage is also increasing rapidly. Therefore, storage capacity is the core competitiveness of storage devices. Currently, one approach used by families or individuals is to use an edge-cloud collaborative method. Although cloud storage has a large capacity and good scalability, retrieving photos or videos from the cloud can result in low performance and high latency due to network limitations.
[0090] Based on this, embodiments of this application provide a method for configuring a home storage device, in which the data stored in the home storage device is distinguished into cold data (rarely accessed) and hot data (frequently accessed). Cold data and hot data are stored in different areas of the home storage device, and cold data is compressed for storage, which can indirectly increase the capacity of the storage system with minimal impact on access time and without reducing the performance of accessing images.
[0091] For ease of distinction, the area in a home storage device used to store hot data is referred to as the first storage area, and the area in a home storage device used to store cold data is referred to as the second storage area.
[0092] Referring to Figure 2, this is a schematic flowchart of a data access method provided in an embodiment of this application. This method can be executed by a home storage device. As mentioned earlier, the home storage device can be connected to a home gateway, or it can be integrated within the home gateway. The first storage area of the home storage device stores raw data that is considered "hot data," and the second storage area stores compressed data that is considered "cold data." For example, referring to Figure 3, taking images as an example, the home storage device stores multiple images, including, as shown in Figure 3, travel photos 1, ID photos 1, etc. Frequently accessed data is considered "hot data," while data that is not accessed for a long time is considered "cold data." Referring to Figure 3, hot data includes travel photos 1-3, and cold data includes ID photos 1-3, mother's ID card, father's ID card, driver's license, household registration book, and marriage certificate.
[0093] S201, the home storage device receives a first access request from the terminal device. The first access request is used to request access to first data, which is cold data.
[0094] For example, the first data can be a document, video, image, or audio.
[0095] S202, the home storage device decompresses the compressed data of the first data in the second storage area to the first storage area, and sends the original data of the decompressed first data to the terminal device.
[0096] In this application, frequently accessed hot data is stored in the first storage area corresponding to the hot data, which enables fast access. Cold data with low user access frequency is compressed and stored in the second storage area corresponding to the cold data, which achieves high compression and increases storage space.
[0097] In some possible embodiments, if the data belonging to cold data is an image, a thumbnail of that image may also be stored in the first storage area. For example, if the first data is an image, for ease of description, this image will be referred to as the first image. The first storage area may also store a thumbnail of the first image. In this case, the first access request indicates the thumbnail of the first image.
[0098] For example, a terminal device can send a first access request to a home storage device through an application (APP). In this case, the home storage device can be understood as the server corresponding to the APP. The terminal device accesses the home storage device, which acts as the server, through the APP. For example, when the terminal device accesses the home storage device, it can display the files stored on the home storage device. For instance, the terminal device can display a thumbnail of the first image. Thus, in response to the user clicking the thumbnail of the first image, the terminal device sends the first access request to the home storage device.
[0099] In this embodiment, the data stored on the home storage device may include data that is relatively private to the user, such as images of ID cards, driver's licenses, etc. This data is generally not accessed frequently. Therefore, when this private data is stored on the home storage device, the user can mark the data to indicate whether it is private data.
[0100] In one possible implementation, the home storage device can compress and save privacy data. When the home storage device receives data, if the data is privacy data, it determines that the privacy data is cold data and compresses and saves it. For example, when the terminal device writes data to the home storage device, it can mark the privacy data. Taking the storage of third-party data as an example, the terminal device sends a write request to the home storage device, which includes the original data of the third-party data and a privacy indication of the third-party data. The home storage device then receives the write request. The privacy indication is used to indicate whether the third-party data is privacy data. When the home storage device determines that the privacy indication indicates that the third-party data is privacy data, it can compress the original data of the third-party data to a second storage area. Specifically, the original data of the third-party data is compressed to obtain compressed data of the third-party data, and then the compressed data of the third-party data is stored in the second storage area.
[0101] In one possible example, the user of the terminal device can mark the data to be stored as privacy data. For instance, the terminal device can mark a piece of data as privacy data when sending a write request to the home storage device. This privacy indicator is sent to the home storage device along with the write request; the privacy indicator indicates that the data is privacy data. If the data is not privacy data, the terminal device does not include the privacy indicator in the write request.
[0102] In another possible example, the user of the terminal device can mark the data to be stored as privacy data, for example, marking certain data as privacy data. When sending a write request to the home storage device, the terminal device can include a privacy indicator in the write request. The privacy indicator is used to indicate whether the data belongs to the privacy category; for example, the privacy indicator is a privacy identifier. When the privacy identifier takes a first value, it indicates that the data is privacy data; when the privacy identifier takes a second value, it indicates that the data is non-privacy data. The first value and the second value are different values; for example, the first value is 1 and the second value is 0. This application does not specifically limit the first value and the second value.
[0103] In some implementation scenarios, home storage devices can differentiate between hot and cold data based on one or more of the following access information: user access habits, recent access time, access frequency, or access history. For example, home storage devices can determine whether stored data is hot or cold data at regular intervals based on the access information of the stored data.
[0104] In one example, when data is written, except for privacy data, it is written as hot data to the first storage area. If it is not accessed for a long time, the hot data can be compressed into cold data and moved to the second storage area to free up storage space on the home storage device. Privacy data, on the other hand, is compressed into the second storage area as cold data when written.
[0105] In another example, if a piece of data that is considered cold data is accessed, then that cold data is changed to hot data.
[0106] In another example, for hot data in the first storage area, if access information determines that a certain data has not been accessed for a long time or has a low access frequency, that data can be compressed from the first storage area to the second storage area. For example, consider the second data. The second data is hot data, and its original data is stored in the first storage area. Access information for the second data in the first storage area is obtained within a first time period. This access information may include one or more of the following: recent access time, access frequency, or access duration. If the access information of the second data meets the conditions for cold data, the original data of the second data in the first storage area is compressed to the second storage area.
[0107] As an example, the first duration can be the detection cycle, such as one day, one week, several weeks, one month, or several months, etc.
[0108] For example, if access information includes the most recent access time, then the condition for cold data could be that the time difference between the current time and the most recent access time of the data is greater than a time threshold. Another example is that if access information includes access frequency, then the condition for cold data could be that the access frequency of the data is less than a frequency threshold. Yet another example is that if access information includes access count, then the condition for cold data could be that the access frequency of the data is less than a count threshold.
[0109] Frequency refers to the number of times something occurs within a unit of time. A higher frequency indicates more frequent occurrence. Recurrence frequency is the reciprocal of the time interval between two occurrences. For example, the access frequency within the first time period mentioned above could be the average access frequency. For instance, if something is accessed three times within the first time period, the frequency is calculated based on the time interval between two consecutive accesses, resulting in two access frequencies. The average of these two access frequencies is then calculated.
[0110] For example, access information includes access frequency. The home storage device counts the number of times data A (first storage area) is accessed within a first time period, thus determining the access frequency of data A. If the access frequency of data A is 1.5 times / day, and the access threshold is 1 time / day, the access frequency of data A is greater than the access threshold, and the home storage device determines that data A is hot data. The home storage device does not process data A. As another example, for data D in the first storage area, if the number of accesses within a first time period (e.g., two days) is 1, the determined access frequency is 0.5 times / day. The access frequency of data D is less than the access threshold, and the home storage device determines that data D is cold data. The original data of data D in the first storage area is compressed to the second storage area. That is, the original data of data D in the first storage area is compressed to obtain compressed data of data D, and the compressed data of data D is stored in the second storage area. Furthermore, the original data of data D in the first storage area is deleted.
[0111] In another possible scenario, if the access information is the most recent access time, the condition for "cold data" is that the time difference between the current time and the most recent access time of data C is greater than a time threshold. The time difference between the current time and the most recent access time of data C can also be called the lifetime. In other words, the lifetime is the length of time the data has not been accessed. Each time the data is accessed, the lifetime is reset to zero and a positive countdown begins. This lifetime can be updated in real time. If the lifetime of data C is less than or equal to the time threshold, the home storage device determines data C as hot data. For example, if the lifetime is 3 days and 2 hours, and the time threshold is 5 days, the home storage device determines data C as hot data. If the lifetime of data C is greater than the time threshold, the home storage device determines data C as cold data. For example, if the lifetime is 6 days and 4 hours, and the time threshold is 5 days, the home storage device determines data C as cold data.
[0112] In one possible implementation, the home storage device can also store hot or cold information of the stored data. This hot or cold information indicates whether the data is hot or cold.
[0113] For example, the temperature information can be stored in an information table. The information table may include multiple entries, such as temperature information and data identifiers.
[0114] Data identification information: used to identify the data, such as data attributes or data ID, etc.
[0115] Hot / cold information: Used to indicate whether the data is hot or cold. For example, the hot / cold information is a heat index. When the heat index is a first value, it indicates that the data is hot; when the heat index is a second value, it indicates that the data is cold. The first and second values are different numerical values; for example, the first value is 1 and the second value is 0. This application does not limit the first and second values.
[0116] In some possible implementation scenarios, the information table may also include, but is not limited to: address, number of accesses, last access time, or time to life. Address: The storage address of the corresponding data on the home storage device.
[0117] When a home storage device determines that data has changed from cold data to hot data, it updates the cold / hot information in its information table. For example, after receiving a first access request from a terminal device and decompressing compressed data of first data from a second storage area to the first storage area, the home storage device updates the cold / hot information of that first data in its information table. The updated cold / hot information of the first data indicates that the first data is hot data.
[0118] In addition, home storage devices can update the information in the information table in real time. For example, they can update the hot / cold status, access count, last access time, etc., in real time. Furthermore, if the original hot / cold status information differs from the updated information, the recorded hot / cold status information in the table will be replaced with the updated information, thus completing the information table update.
[0119] In some possible implementation scenarios, if the data is an image, and if an image changes from hot data to cold data, after compressing the image from the first storage area to the second storage area, a thumbnail of the image can also be generated in the first storage area for user access.
[0120] In some possible implementations, the data stored in home storage devices exhibits a clustering effect. For example, recently registering a household registration might require documents such as an ID card, household registration booklet, and birth certificate. Based on this, this data can be clustered. When a particular piece of cold data within a cluster is accessed, other cold data belonging to that data family can be decompressed to improve access efficiency.
[0121] Home storage devices can create relationship graphs based on the relationships between various data. The relationship graph describes the associations between at least two data items stored on the home storage device. A relationship graph, also known as a knowledge graph (KG), is a structured semantic knowledge base used to describe concepts and their relationships in the physical world in symbolic form. Its basic building blocks are "entity-relationship-entity" or "entity-attribute-attribute value" triples, as well as entities and their related attribute-value pairs. Entities are interconnected through relationships, forming a network-like knowledge structure.
[0122] For example, artificial intelligence methods can be used to create relationship graphs, such as through network models. Relationship graphs can be created by utilizing the relationships between data content, labels, etc. Taking images as an example, relationships between image labels or content similarity can be used to create a relationship graph. For instance, the network model can be a neural network model, such as a deep neural network (DNN), also known as a multi-layer neural network, which is a neural network with multiple hidden layers; another example is a convolutional neural network (CNN), a deep neural network with convolutional structures. As an example, graph convolutional networks (GCN), graph attention networks (GAT), or graph sample and aggregate (GraphSAGE) training can be used. This application does not limit the specific type of neural network involved.
[0123] This application does not specify the method for creating the relationship graph of data.
[0124] After creating a knowledge graph, a home storage device can store one or more relationship graphs. For example, the home storage device stores a first relationship graph. The first relationship graph is one of multiple relationship graphs. According to the relationship graph, cold data (data within this relationship graph that is not accessed for a long time) is compressed, while hot data is not compressed to ensure access speed. If a piece of cold data is accessed, when that data is decompressed, all other cold data in the relationship graph can also be decompressed. Or, if a piece of cold data is activated from cold data to hot data, all other cold data in the relationship graph can also be activated. For example, the activation action can be real-time, or the decompression (or activation) action can be performed during the idle time period of the home storage device, thereby reducing the dependence on computing power.
[0125] In some possible implementation scenarios, the same data may belong to one or more relation graphs. For example, an image may belong to multiple relation graphs. After the image is activated from cold data to hot data, cold data in the multiple relation graphs to which the image belongs can also be activated as hot data. It should be noted that the activation of cold data to hot data mentioned in this application can be understood as decompressing compressed data belonging to cold data from the second storage area to the first storage area, and can further change the cold / hot information of the data from indicating cold data to indicating hot data.
[0126] Taking the aforementioned first data belonging to the first relationship graph as an example, after receiving the first access request from the terminal device, the home storage device can decompress the compressed data of the first data in the second storage area to the first storage area, and can also decompress the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area.
[0127] For example, the idle time period of the home storage device can be used to decompress other cold data in the first relationship graph. Specifically, once the idle time period of the home storage device is determined, the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area can be decompressed to the first storage area. The idle time period of the home storage device can be preset, such as one set by the user. The idle time period can also be a time period determined by the home storage device based on the user access habits of the terminal device. For example, it can be statistically determined that the user does not access the home storage device during the time period from 11 pm to 7 am the next day. For example, the home storage device can statistically determine the idle time period at regular intervals, such as one month, three months, six months, or one year. Therefore, the time period from 11 pm to 7 am the next day can be used as the idle time period.
[0128] As an example, taking images as data, see Figure 4. The home storage device stores multiple images, including "Playful Photo 1," "ID Photo 1," etc. Using a knowledge graph, three relationship graphs are constructed based on the stored photos, as shown in Figure 4. Frequently accessed data is considered "hot data," while data not accessed for extended periods is considered "cold data." As shown in Figure 4, hot data includes "Playful Photo 1" through "Playful Photo 3," and cold data includes "ID Photo 1" through "ID Photo 3," "Mom's ID Card," "Dad's ID Card," "Driver's License," "Household Registration Book," and "Marriage Certificate." For example, if the home storage device receives an access request for Dad's ID card, it will decompress the compressed data of Dad's ID card from the second storage area to the first storage area. Then, it can further decompress other cold data from the relationship graph corresponding to Dad's ID card from the second storage area to the first storage area, as shown in Figure 4.
[0129] In the above-mentioned scheme of this application, cold data is activated according to the relationship graph, ensuring that data that has not been accessed for a long time is compressed and stored. Furthermore, after the cold data is accessed, other cold data in the relationship graph can be activated in advance, which can improve the access speed.
[0130] In some potential implementation scenarios, home storage devices can also store cold data in cloud storage. For example, in some scenarios where home storage devices lack sufficient storage space, some cold data can be compressed and stored in cloud storage. In other scenarios, cold data that constitutes privacy is compressed and stored locally on the home storage device. Other cold data that does not constitute privacy is compressed and stored in cloud storage.
[0131] In one possible implementation, the home storage device receives a second access request from a terminal device, the second access request being for accessing fourth data. The home storage device is connected to cloud storage, the fourth data is cold data, and the fourth data is compressed and stored in the cloud storage. The home storage device obtains the compressed data of the fourth data from the cloud storage, decompresses the compressed data of the fourth data to obtain the original data of the fourth data, and sends the original data of the fourth data to the terminal device.
[0132] In one possible implementation, the home storage device stores the raw data of the fourth data in the first storage area.
[0133] In one possible implementation, the first piece of data is considered privacy data. Storing this privacy data locally on a home storage device can improve its security. In another possible implementation, the fourth piece of data is not considered privacy data.
[0134] Figure 5 is a schematic diagram of a data access device framework provided in an embodiment of this application. The data access device is applied to a home storage device. The data access device can be used to implement the functions of the home storage device in the above method embodiments, and therefore can also achieve the beneficial effects of the above method embodiments. Referring to Figure 5, the data access device includes an application unit 510, a storage unit 520, and a processing unit 530. The storage unit 520 may include a first storage area and a second storage area.
[0135] Processing unit 530 classifies data based on access information, distinguishing whether the data is cold or hot data. Processing unit 530 also performs data compression and decompression. The processing unit can also create a relational graph.
[0136] Storage unit 520 is used to store hot data in a first storage area and cold data in a second storage area. The data access device stores frequently accessed data in the hot data area for fast access, while storing infrequently accessed data in the cold data area for high compression, maximizing storage space.
[0137] Application unit 510 is used to process access requests and identify whether the accessed data is cold data or hot data.
[0138] In some implementation scenarios, the processing unit 530 may include a decompression unit 531, a compression unit 532, and a classification unit 533. The decompression unit 531 is used to decompress the data. The compression unit 532 is used to compress the data. The classification unit 533 is used to classify the data and create a relationship graph based on the access information.
[0139] In one possible implementation, application unit 510 receives a first access request from a terminal device. The first access request requests access to first data, which belongs to the cold data. Referring to Figure 6, processing unit 530 decompresses the compressed data of the first data in the second storage area to the first storage area. In some implementations, decompression unit 531 may decompress the compressed data of the first data in the second storage area to the first storage area (S610). Application unit 510 sends the original data of the decompressed first data in the first storage area to the terminal device.
[0140] In one possible implementation, if application unit 510 determines that the first data is cold data, it sends a decompression request to processing unit 530. The decompression request requests the decompression of the first data from the second storage area. Processing unit 530, based on the decompression request, decompresses the compressed data of the first data from the second storage area to the first storage area. In some implementations, if application unit 510 determines that the first data is cold data, it sends a decompression request to decompression unit 531. Decompression unit 531 receives the decompression request and, based on the request, decompresses the compressed data of the first data from the second storage area to the first storage area.
[0141] In one possible implementation, the storage unit 520 also stores hot / cold information of the first data, indicating that the first data is cold data. The application unit 510 can query the hot / cold information of the first data from the storage unit 520 to determine that the first data is cold data.
[0142] In one possible implementation, after the decompression unit 531 decompresses the compressed data of the first data in the second storage area to the first storage area, the application unit 510 updates the hot / cold information of the first data, wherein the updated hot / cold information of the first data indicates that the first data belongs to hot data.
[0143] In one possible implementation, the processing unit 530 is further configured to acquire access information of the second data in the first storage area within a first duration, the access information including one or more of the following: recent access time, access frequency, or access frequency; when it is determined that the access information of the second data meets the conditions for cold data, the original data of the second data in the first storage area is compressed to the second storage area. In some implementation scenarios, referring to Figure 6, the classification unit 533 acquires the access information of the second data in the first storage area within a first duration (S621), and when it is determined that the conditions for cold data are met, it notifies the compression unit 532 to compress the original data of the second data in the first storage area to the second storage area (S622). The further compression unit 532 compresses the original data of the second data in the first storage area to obtain compressed data (S623), and stores the compressed data in the second storage area (S624).
[0144] It should be noted that the method described in this application for compressing the original data of a certain data in the first storage area to the second storage area can be as follows: compressing the original data of a certain data in the first storage area to obtain compressed data of the data, storing the compressed data of the data in the second storage area, and further deleting the original data of the data in the first storage area.
[0145] In one possible implementation, the second data is a second image. The processing unit 530 is further configured to generate a thumbnail of the second image and save the thumbnail of the second image to the first storage area. In some implementation scenarios, referring to FIG6, the compression unit 532 may also downsample the original data of the second image to obtain a thumbnail of the second image, and then save the thumbnail of the second image to the first storage area of the storage unit 520 (S630).
[0146] In one possible implementation, the processing unit 530 determines that the access information of the second data meets the conditions of cold data based on one or more of the following: determining that the time difference between the current time and the most recent access time of the second data is greater than a time threshold; or determining that the access frequency of the second data is less than a frequency threshold; or determining that the access frequency of the second data is less than a number of times threshold.
[0147] In one possible implementation, the application unit 510 is further configured to receive a write request from the terminal device, the write request including the original data of the third data and a privacy indication of the third data, the privacy indication indicating that the third data belongs to privacy data; the processing unit 530 is further configured to compress and store the original data of the third data in the second storage area. In some implementation scenarios, after receiving the write request, the application unit 510 can notify the compression unit 532 to compress the original data of the third data, so that the compression unit 532 stores the compressed original data of the third data in the second storage area of the storage unit 520.
[0148] In one possible implementation, the home storage device also stores multiple relationship graphs, which describe the association between at least two pieces of data stored in the home storage device; the first data belongs to a first relationship graph; the first relationship graph is one of multiple relationship graphs; the processing unit 530 is further configured to decompress the compressed data of the first data in the second storage area to the first storage area, and then decompress the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area. In some implementation scenarios, the decompression unit 531 decompresses the compressed data of the first data in the second storage area to the first storage area, and then decompresses the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area.
[0149] In one possible implementation, the processing unit 530 is further configured to determine an idle time period for the home storage device before decompressing the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area. In some implementations, the decompression unit 531 decompresses the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area only after determining that an idle time period has been reached on the home storage device.
[0150] For example, Figure 7 shows a schematic diagram of the hardware structure of a home storage device provided in this application. As shown in Figure 7, the home storage device may include a processor 710, an internal memory 720, and a wireless communication module 740, etc. In some implementation scenarios, the home storage device may also include an external memory interface 750, a universal serial bus (USB) interface 730, a power management module 760, etc.
[0151] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on home storage devices. In other embodiments of this application, home storage devices may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0152] Processor 710 may include one or more processing units. For example, processor 710 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, the home storage device may also include one or more processors 710. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0153] In some embodiments, the processor 710 may include one or more interfaces. These interfaces may include an inter-integrated circuit (I2C) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and / or a USB interface, etc. The USB interface 730 is a USB standard-compliant interface, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface 730 can be used to connect a charger to charge home storage devices, and can also be used for data transfer between home storage devices and peripheral devices.
[0154] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the home storage device. In other embodiments of this application, the home storage device may also employ different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.
[0155] In some implementations, the home storage device may also include an antenna, such as a first antenna, a second antenna, etc. The wireless communication function of the home storage device can be implemented through the first antenna, the second antenna, and the wireless communication module 740, etc.
[0156] The wireless communication module 740 can provide solutions for wireless communication applications in home storage devices, including Wi-Fi (including Wi-Fi sensing and Wi-Fi AP), Bluetooth (BT), and wireless data transmission modules (e.g., 433MHz, 868MHz, 10110MHz). The wireless communication module 740 can be one or more devices integrating at least one communication processing module.
[0157] The external storage interface 750 can be used to connect external storage cards, such as Micro SD cards, to expand the storage capacity of home storage devices. The external storage card communicates with the processor 710 through the external storage interface 750 to perform data storage functions. For example, images, videos, and other files can be saved on the external storage card.
[0158] The internal memory 720 may include a first storage area and a second storage area. In some embodiments, the internal memory 720 may also be used to store one or more computer programs, which include instructions. The processor 710 can cause the home storage device to perform data access methods, etc., provided in some embodiments of this application by executing the aforementioned instructions stored in the internal memory 720.
[0159] The internal memory 720 may include a code storage area and a data storage area. The code storage area may store the operating system. The data storage area may store hot data and cold data, etc. Furthermore, the internal memory 720 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc. In some embodiments, the processor 710 can cause the home storage device to perform the data access method provided in the embodiments of this application by executing instructions stored in the internal memory 720 and / or instructions stored in memory disposed in the processor 710.
[0160] It should be understood that the specific process of home storage devices performing the above-mentioned steps is described in the previous text in conjunction with Figures 2 to 6. For the sake of brevity, it will not be repeated here.
[0161] Figure 8 shows a schematic block diagram of another example of a home storage device provided in the embodiments of this application. This home storage device can correspond to the home storage device described in the various embodiments of the above methods, or it can be a chip or component applied to a home storage device. Furthermore, each module or module in the home storage device is used to perform the various actions or processing procedures performed by the home storage device described in the various embodiments of the above data access methods. As shown in Figure 8, the home storage device may include: a processing module 810, a communication module 820, and a storage module 830.
[0162] It should be understood that the specific process of each module in the home storage device performing the above-mentioned corresponding steps is described in the previous text in conjunction with the various embodiments in Figures 2 to 6. For the sake of brevity, it will not be repeated here.
[0163] For example, the functions of the processing unit 530 and the application unit 510 described above can be implemented by the processing module 810. The functions of the storage unit 520 can be implemented by the storage module 830.
[0164] Optionally, the communication module 820 may include a receiving module and a sending module, used to perform the steps of receiving and sending information in the foregoing method embodiments. The storage module 830 is used to store the instructions executed by the processing module 810 and the communication module 820, as well as hot data and cold data.
[0165] It should be understood that the communication module 820 may be a transceiver, an input / output interface, or an interface circuit, for example, it may be implemented by the wireless communication module 740 in the embodiment shown in FIG7. The storage module may be a memory, for example, it may be implemented by the external memory interface 750 and the internal memory 720 in the embodiment shown in FIG7. The processing module 810 may be the processor 710 in the embodiment shown in FIG7, or it may be implemented by the processor 710, the external memory interface 750, and the internal memory 720.
[0166] This application also provides a chip system, as shown in FIG9, which includes at least one processor 910 and at least one interface circuit 920. The processor 910 and the interface circuit 920 are interconnected via lines. For example, the interface circuit 920 can be used to receive signals from other devices (e.g., terminal devices). As another example, the interface circuit 920 can be used to send signals to other devices (e.g., processor 910). Exemplarily, the interface circuit 920 can read instructions stored in a memory and send those instructions to the processor 910. When the instructions are executed by the processor 910, the chip system can perform the various steps performed by the home storage device in the above example. Of course, the chip system may also include other discrete devices, which are not specifically limited in this application. The chip system is used to implement the processing functions of the home storage device, and the chip system can also be coupled to a memory to implement the storage functions of the aforementioned home storage device.
[0167] It should also be understood that the division of units in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, all units in the device can be implemented entirely through software calls from processing elements; all units can be implemented entirely in hardware; or some units can be implemented through software calls from processing elements, while others are implemented in hardware. For example, each unit can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as a program in memory, and its function can be called and executed by a processing element within the device. Here, the processing element can also be called a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above units can be implemented through integrated logic circuits in the processor element or through software calls from processing elements. In one example, a unit in any of the above devices can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), or a combination of at least two of these forms of integrated circuits. As another example, when a unit in the device can be implemented in the form of a processing element scheduler, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor capable of calling programs. Furthermore, these units can be integrated together to implement a system-on-a-chip (SOC).
[0168] The application also provides a computer-readable storage medium for storing computer program code, the computer program including instructions for executing any of the data access methods provided in the above-described embodiments. The readable medium may be a read-only memory (ROM) or a random access memory (RAM), and the application does not limit this.
[0169] This application also provides a computer program product including instructions that, when executed, cause a terminal and a server to perform corresponding operations in the data access method described above.
[0170] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory can be ROM, programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be RAM, which is used as an external cache. RAM has various different types, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM).
[0171] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.
[0172] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more flowchart illustrations and / or one or more block diagrams.
[0173] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A data access method, characterized in that, An application is made to a home storage device, the home storage device including a first storage area and a second storage area, the first storage area storing raw data belonging to hot data, and the second storage area storing compressed data belonging to cold data, the method comprising: Receive a first access request from a terminal device, the first access request being used to request access to first data, the first data belonging to the cold data; The compressed data of the first data in the second storage area is decompressed back to the first storage area, and the original data of the decompressed first data is sent to the terminal device.
2. The method as described in claim 1, characterized in that, The first data is a document, video, image, or audio.
3. The method as described in claim 2, characterized in that, The first data is the first image, and the first storage area also stores a thumbnail of the first image; the first access request indicates the thumbnail of the first image.
4. The method according to any one of claims 1-3, characterized in that, The home storage device also stores hot / cold information of the first data, the hot / cold information indicating that the first data belongs to the cold data.
5. The method as described in claim 4, characterized in that, The method further includes: After decompressing the compressed data of the first data in the second storage area back to the first storage area, the hot / cold information of the first data is updated, wherein the updated hot / cold information of the first data indicates that the first data belongs to hot data.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Obtain access information of second data in a first storage area within a first time period, wherein the access information includes one or more of the following: recent access time, access frequency, or access frequency; If the access information of the second data meets the conditions for cold data, the original data of the second data in the first storage area is compressed into the second storage area.
7. The method as described in claim 6, characterized in that, The second data is the second image, and the method further includes: A thumbnail of the second image is generated in the first storage area.
8. The method as described in claim 6 or 7, characterized in that, The access information of the second data is determined to meet the conditions of the cold data, including one or more of the following: Determine that the time difference between the current time and the most recent access time of the second data is greater than a time threshold; or, Determine that the access frequency of the second data is less than a frequency threshold; or, It is determined that the access frequency of the second data is less than the number of accesses threshold.
9. The method according to any one of claims 1-8, characterized in that, The method further includes: Receive a write request from the terminal device, the write request including the original data of the third data and the privacy indication of the third data; When the privacy indicator indicates that the third data belongs to privacy data, the original data of the third data is compressed to obtain the compressed data of the third data, and the compressed data of the third data is stored in the second storage area.
10. The method according to any one of claims 1-9, characterized in that, The home storage device also stores multiple relationship graphs, which are used to describe the association between at least two data items stored in the home storage device; The first data belongs to the first relation graph; The first relationship graph is one of the plurality of relationship graphs; The method further includes: Upon receiving the first access request from the terminal device, the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area is decompressed and returned to the first storage area.
11. The method as described in claim 10, characterized in that, The method further includes: Before decompressing the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area, an idle time period is determined for the home storage device.
12. The method according to any one of claims 1-11, characterized in that, The home storage device is integrated into the home gateway.
13. A data access device, characterized in that, This device, used in home storage applications, includes an application unit, a storage unit, and a processing unit. The storage unit comprises a first storage area and a second storage area: the first storage area stores raw data (considered "hot" data), and the second storage area stores compressed data (considered "cold" data). The application unit is configured to receive a first access request from a terminal device, the first access request being used to request access to first data, the first data being the cold data; The processing unit is used to decompress the compressed data of the first data in the second storage area back to the first storage area; The application unit is further configured to send the original data of the first data obtained by decompression in the first storage area to the terminal device.
14. The apparatus as claimed in claim 13, characterized in that, The application unit is further configured to determine that the first data is cold data and send a decompression request to the processing unit, wherein the decompression request is used to request the decompression of the first data from the second storage area; The processing unit is specifically configured to decompress the compressed data of the first data in the second storage area to the first storage area according to the decompression request.
15. The apparatus as claimed in claim 14, characterized in that, The first data is the first image, and the first storage area also stores a thumbnail of the first image; the first access request indicates the thumbnail of the first image.
16. The apparatus as claimed in claim 14 or 15, characterized in that, The storage unit also stores hot and cold information of the first data, the hot and cold information indicating that the first data belongs to the cold data; The application unit is specifically used to query the hot and cold information of the first data from the storage unit to determine that the first data belongs to the cold data.
17. The apparatus as claimed in claim 16, characterized in that, The application unit is further configured to update the hot / cold information of the first data after the processing unit decompresses the compressed data of the first data in the second storage area to the first storage area, wherein the updated hot / cold information of the first data indicates that the first data belongs to hot data.
18. The apparatus according to any one of claims 13-17, characterized in that, The processing unit is further configured to obtain access information of the second data in the first storage area within the first time period, the access information including one or more of the following: recent access time, access frequency, or access frequency; When it is determined that the access information of the second data meets the conditions for cold data, the original data of the second data in the first storage area is compressed into the second storage area.
19. The apparatus as claimed in claim 18, characterized in that, The second data is a second image. The processing unit is further configured to generate a thumbnail of the second image and save the thumbnail of the second image to the first storage area.
20. The apparatus as claimed in claim 18 or 19, characterized in that, The processing unit is specifically configured to determine, based on one or more of the following, whether the access information of the second data satisfies the condition of the cold data: Determine that the time difference between the current time and the most recent access time of the second data is greater than a time threshold; or, Determine that the access frequency of the second data is less than a frequency threshold; or, It is determined that the access frequency of the second data is less than the number of accesses threshold.
21. The apparatus according to any one of claims 13-20, characterized in that, The application unit is further configured to receive a write request from the terminal device, the write request including the original data of the third data and a privacy indication of the third data, the privacy indication indicating that the third data belongs to privacy data; The processing unit is further configured to compress and store the original data of the third data in the second storage area.
22. The apparatus according to any one of claims 13-21, characterized in that, The home storage device also stores multiple relationship graphs, which are used to describe the association between at least two pieces of data stored in the home storage device; the first piece of data belongs to a first relationship graph; the first relationship graph is one of the multiple relationship graphs. The processing unit is also used for After decompressing the compressed data of the first data in the second storage area to the first storage area, decompress the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area.
23. The apparatus as claimed in claim 22, characterized in that, The processing unit is further configured to: determine an idle time period reaching the home storage device before decompressing the compressed data of the data other than the first data indicated by the first relationship graph in the second storage area to the first storage area.
24. A home storage device, characterized in that, include: Processor and memory; The processor and memory are coupled, the memory storing program instructions, which are executed when the program instructions stored in the memory are executed by the processor: the method as described in any one of claims 1 to 12.
25. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 12.
26. A chip, characterized in that, Includes: a processor for retrieving and running a computer program from memory, causing an electronic device on which the chip is mounted to perform: the method as described in any one of claims 1 to 12.