Data processing method and apparatus, and device, storage medium and program product

By introducing a compression engine and extended memory into the extended device, and using the compression engine to compress the initial data of the main device, the problem of low storage data in the prior art is solved and efficient data storage is achieved.

WO2025181570A1PCT designated stage Publication Date: 2025-09-04CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/IB2025/050446
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-26
Filing Date
2025-01-16
Publication Date
2025-09-04

AI Technical Summary

Technical Problem

In the prior art, the process of storing initial data in memory to extended memory is complicated, resulting in low storage data efficiency.

Method used

By introducing a compression engine and extended memory into the extended device, the compression engine is used to compress the initial data of the main device, and the compressed data is obtained and stored in the extended memory, reducing the number of data copies between the main device and the extended device.

Benefits of technology

It improves the efficiency of storing data, reduces the interaction between the master device and the extended device, and improves the efficiency of data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2025050446_04092025_PF_FP_ABST
    Figure IB2025050446_04092025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present disclosure are a data processing method and apparatus, and a device, a storage medium and a program product, which are applied to an expansion device of a main device, the expansion device comprising a compression engine and an expansion memory. The method comprises: receiving a data storage request sent by a main device, wherein the data storage request comprises first initial data; compressing the first initial data by means of a compression engine, so as to obtain first compressed data; and storing the first compressed data in an expansion memory. The present disclosure improves the efficiency of data storage.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Data Processing Method, Apparatus, Device, Storage Medium, and Program Product This disclosure claims priority to Chinese Patent Application No. 202410211746.0, filed with the China Patent Office on February 26, 2024, entitled "Data Processing Method, Apparatus, Device, Storage Medium, and Program Product," the entire contents of which are incorporated herein by reference. Technical Field This disclosure relates to the field of computers, and more particularly to a data processing method, apparatus, device, storage medium, and program product. Background: Electronic devices may be provided with memory to store data. When the memory in an electronic device is insufficient, an expansion memory may be connected via a bus to expand the memory available to the electronic device. In related art, when initial data in the memory needs to be stored in the expansion memory, the initial data may be copied from the memory to a compression accelerator, which then compresses the initial data to obtain compressed data. The compressed data is then copied to the memory, and finally the compressed data in the memory is copied to the expansion memory. However, in the above process, the steps for storing the initial data in the memory into the extended memory are complex, resulting in low data storage efficiency. SUMMARY OF THE INVENTION Various aspects of the present disclosure provide a data processing method, apparatus, device, storage medium, and program product for improving data storage efficiency. In a first aspect, embodiments of the present disclosure provide a data processing method applied to an extension device of a master device, the extension device comprising a compression engine and extended memory. The method comprises: receiving a data storage request from the master device, the data storage request comprising first initial data; compressing the first initial data using the compression engine to obtain first compressed data; and storing the first compressed data in the extended memory. In one possible implementation, the extension device further comprises a temporary buffer, the data storage request being used to request writing the first initial data into the temporary buffer; compressing the first initial data using the compression engine to obtain first compressed data. The method comprises: upon completion of writing the first initial data into the temporary buffer by the master device, obtaining the first initial data from the temporary buffer using the compression engine; and compressing the first initial data to obtain the first compressed data. In a possible implementation, the expansion device is provided with multiple virtual address spaces, wherein the first initial data is written by the master device into the temporary cache through a first virtual address space, and the first virtual address space is an idle virtual address space among the multiple virtual address spaces.In one possible embodiment, after storing the first compressed data in the extended memory, the method further includes: determining a first actual storage space for the first compressed data in the extended memory; determining a mapping relationship between the first actual storage space and the first virtual address space, and storing the mapping relationship. In one possible embodiment, the method further includes: after the compression engine retrieves the first initial data from the temporary cache, sending a data storage response to the master device; wherein the data storage response indicates completion of storage of the first initial data and causes the master device to asynchronously store additional data to the extended device. In one possible embodiment, after the compression engine retrieves the first initial data from the temporary cache, the method further includes: deleting the first initial data from the temporary cache. In one possible embodiment, the method further includes: receiving a data read request from the master device; retrieving second compressed data from the extended memory based on the data read request; decompressing the second compressed data using the compression engine to obtain second initial data, and synchronizing the second initial data to the master device. In one possible implementation, the data read request includes an identifier of a second virtual address space; and obtaining the second compressed data from the extended memory based on the data read request includes: determining a second actual storage space based on the identifier of the second virtual address space; and obtaining the second compressed data from the extended memory based on the second actual storage space. In one possible implementation, synchronizing the second initial data to the master device includes: storing the second initial data in a temporary cache of the extended device; and sending a data read response to the master device, the data read response instructing the master device to read the second initial data from the temporary cache using the second virtual address space. In a second aspect, embodiments of the present disclosure provide a data processing device for an extended device of a master device, the extended device including a compression engine and extended memory. The device includes a receiving module, a processing module, and a storage module. The receiving module is configured to receive a data storage request from the master device, the data storage request including first initial data; the processing module is configured to compress the first initial data using the compression engine to obtain first compressed data; and the storage module is configured to store the first compressed data in the extended memory.In one possible embodiment, the expansion device further includes a temporary cache, and the data storage request is used to request writing the first initial data into the temporary cache. The processing module is specifically configured to: when the master device finishes writing the first initial data into the temporary cache, obtain the first initial data from the temporary cache via the compression engine; and compress the first initial data to obtain the first compressed data. In one possible embodiment, the expansion device is provided with multiple virtual address spaces, wherein the first initial data is written to the temporary cache by the master device via a first virtual address space, and the first virtual address space is an idle virtual address space among the multiple virtual address spaces. In one possible embodiment, after storing the first compressed data in the expansion memory, the apparatus further includes a determination module, wherein the determination module is configured to determine a first actual storage space in the expansion memory for the first compressed data; the determination module is further configured to determine a mapping relationship between the first actual storage space and the first virtual address space; and the storage module is further configured to store the mapping relationship. In one possible embodiment, the apparatus further includes: a sending module, configured to, after the compression engine obtains the first initial data from the temporary cache, send a data storage response to the master device; wherein the data storage response indicates completion of storage of the first initial data and causes the master device to asynchronously store additional data to the expansion device. In one possible embodiment, after the compression engine obtains the first initial data from the temporary cache, the apparatus further includes a deletion module; wherein the deletion module is configured to delete the first initial data from the temporary cache. In one possible embodiment, the apparatus further includes an acquisition module and a synchronization module; wherein the receiving module is further configured to receive a data read request from the master device; the acquisition module is configured to obtain second compressed data from the expansion memory based on the data read request; the processing module is configured to decompress the second compressed data using the compression engine to obtain second initial data; and the synchronization module is further configured to synchronize the second initial data with the master device. In a possible implementation, the data read request includes an identifier of the second virtual address space; the acquisition module is specifically configured to: determine a second actual storage space according to the identifier of the second virtual address space; and acquire the second compressed data in the extended memory according to the second actual storage space.In one possible implementation, the synchronization module is specifically configured to: store the second initial data in a temporary cache of the expansion device; and send a data read response to the master device, the data read response instructing the master device to read the second initial data from the temporary cache via the second virtual address space. In a third aspect, an embodiment of the present disclosure provides an expansion device, comprising: at least one processor; a memory, a compression engine, and an extended memory communicatively connected to the at least one processor; the compression engine is configured to perform compression and / or decompression processing on data; and the extended memory is configured to store data; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the expansion device to perform any of the methods described in the first aspect. In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, the computer-readable storage medium storing computer-executable instructions, which, when executed by the processor, are configured to implement any of the methods described in the first aspect. In a fifth aspect, an embodiment of the present disclosure provides a computer program product, comprising a computer program, which, when executed by the processor, implements any of the methods described in the first aspect. Embodiments of the present disclosure provide a data processing method, apparatus, device, storage medium, and program product. An expansion device can receive a data storage request from a master device and, using a compression engine, compress first initial data to obtain first compressed data. The expansion device can then store the first compressed data in an extended memory. Because the expansion device can both compress the first initial data using the compression engine and store the first compressed data in the extended memory, compared to existing technologies, only one data copy is required between the master device and the expansion device, reducing interaction between the master and expansion devices and thereby improving data storage efficiency. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings described herein are provided to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are provided to explain the present disclosure and are not intended to unduly limit the present disclosure.In the accompanying drawings: Figure 1 is a schematic diagram of a scenario provided by an exemplary embodiment of the present disclosure; Figure 2 is a schematic diagram of a data processing method in the related art; Figure 3 is a flowchart of a data processing method provided by an exemplary embodiment of the present disclosure; Figure 4 is a flowchart of another data processing method provided by an exemplary embodiment of the present disclosure; Figure 5 is a process diagram of a data processing method provided by an exemplary embodiment of the present disclosure; Figure 6 is a flowchart of yet another data processing method provided by an exemplary embodiment of the present disclosure; Figure 7 is a process diagram of yet another data processing method provided by an exemplary embodiment of the present disclosure; Figure 8 is a schematic diagram of the structure of a data processing device provided by an exemplary embodiment of the present disclosure; Figure 9 is a schematic diagram of the structure of another data processing device provided by an exemplary embodiment of the present disclosure; Figure 10 is a schematic diagram of the structure of an expansion device provided by an exemplary embodiment of the present disclosure. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, storage, and display, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of the relevant data must comply with relevant laws, regulations, and standards, and corresponding operation portals are provided for users to choose to authorize or reject. To further clarify the objectives, technical solutions, and advantages of the present disclosure, the technical solutions of the present disclosure will be described clearly and completely below in conjunction with specific embodiments of the present disclosure and the corresponding drawings. It should be understood that the described embodiments represent only a portion of the embodiments of the present disclosure, and are not exhaustive. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present disclosure without inventive effort are within the scope of protection of the present disclosure. Figure 1 is a schematic diagram of a scenario provided by an exemplary embodiment of the present disclosure. Referring to Figure 1 , a main device and an expansion device are provided. The main device may include initial data. The expansion device may compress the initial data in the main device to obtain compressed data, and then store the compressed data. In related art, when initial data in memory needs to be stored in extended memory, the initial data can be copied from the memory to a compression accelerator, which then compresses the initial data to obtain compressed data. The compressed data is then copied to the memory, and finally the compressed data in the memory is copied to the extended memory. However, in this process, the steps for storing the initial data in the memory to the extended memory are complex, resulting in low data storage efficiency. In an embodiment of the present disclosure, the expansion device may include a compression engine and an expansion memory. The expansion device may compress the first initial data in the main device using the compression engine to obtain first compressed data, and store the first compressed data in the expansion memory.Because the expansion device can both compress the first initial data using the compression engine and store the first compressed data in the expansion memory, compared to the prior art, only one data copy is required between the main device and the expansion device, reducing interaction between the main device and the expansion device and thus improving data storage efficiency. The following describes a data processing method in the related art with reference to Figure 2. Figure 2 is a schematic diagram of a data processing method in the related art. Referring to Figure 2, a main device, expansion memory, and a compression accelerator are included. The main device may include main memory and a processor (CPU). The main memory stores the initial data. The compression accelerator can be used to compress the data. The expansion memory can be used to store the data. In step 1, the CPU can send a compression instruction to the compression accelerator via a peripheral component interconnect (PCI) bus or a memory-mapped input / output (MMI0) bus to instruct the compression accelerator to perform the compression task. The compression instruction may include the starting address and memory length corresponding to the specified memory, the compression algorithm, and the compression granularity. In step 2, the compression accelerator may read the initial data from the host device using direct memory access (DMA) technology based on the compression instruction and copy the initial data to the compression accelerator. In step 3, the compression accelerator may compress the initial data to obtain compressed data. In step 4, the compression accelerator may copy the compressed data to the main memory using DMA for storage. In step 5, the CPU may transfer the compressed data from the main memory to the extended memory via a bus for storage. In the related art shown in FIG2 , the host device, the compression accelerator, and the extended memory are three independent devices. Two data copies are required between the host device and the compression accelerator, and one data copy is required between the host device and the extended memory, for a total of three data copies, to store the compressed data in the extended memory, resulting in low data storage efficiency. The technical solutions presented in this disclosure are described in detail below through specific embodiments. It should be noted that the following embodiments may exist independently or in combination, and identical or similar content will not be repeated in different embodiments. FIG3 is a flow chart illustrating a data processing method provided by an exemplary embodiment of this disclosure. Referring to FIG3 , the method may include:

[0002] S301. Receive a data storage request sent by a master device. The execution subject of the embodiments of the present disclosure may be an expansion device or a data processing device within the expansion device. The data processing device may be implemented via software or a combination of software and hardware. For ease of understanding, the following description uses the expansion device as an example. The master device may include a main memory and a CPU. The main memory may store first initial data. The master device may have a corresponding expansion device. The expansion device may include a compression engine and extended memory. The compression engine may be used to compress data; the extended memory may be used to store data. The extended memory and the main memory may be different types of memory. The data storage request may include the first initial data. The data storage request is used to request that the first initial data be written to the expansion device. The size of the first initial data is the same as the size of a memory page. The size of a memory page may be any of the following:

[0003] 4 kilobytes (KB), 16 KB, 2 megabytes (MB), 1 gigabyte (GB), etc. For example, if the main memory includes multiple memory pages, and the size of each memory page is 4 KB, the size of the first initial data can be 4 KB. The main device can send a data storage request to the expansion device, so that the expansion device receives the data storage request sent by the main device. For example, the expansion device can receive data storage request 1 sent by the main device, and the data storage request 1 can include initial data of size 4 KB.

[0004] S302. The compression engine compresses the first initial data to obtain first compressed data. Optionally, the expansion device may further include a temporary cache. Since the expansion device also includes the temporary cache, the data storage request may be used to request writing the first initial data to the temporary cache. The size of the temporary cache is the same as the size of the first initial data, that is, the size of the temporary cache is also the same as the size of a memory page in the main memory. For example, if the size of a memory page is 4 KB, the size of the temporary cache may be 4 KB. In an optional embodiment, the compression engine may compress the first initial data to obtain the first compressed data in the following manner: when the master device finishes writing the first initial data to the temporary cache, the compression engine retrieves the first initial data from the temporary cache; and compresses the first initial data to obtain the first compressed data. The master device may write the first initial data in the data storage request to the temporary cache of the expansion device. When the master device finishes writing the first initial data to the temporary cache, the expansion device may retrieve the first initial data from the temporary cache through the compression engine and compress the first initial data through the compression engine to obtain the first compressed data. For example, if data storage request 1 includes initial data 1 of 4 KB in size, the master device may write the initial data 1 into the temporary cache. When the master device finishes writing the initial data 1 into the temporary cache, the expansion device may obtain the initial data 1 from the temporary cache through the compression engine and compress the initial data 1 to obtain compressed data 1. Assume that the size of the compressed data 1 is 2 KB.

[0005] S303. Storing the first compressed data in the extended memory. Optionally, the extended memory in the extended device and the main memory in the master device may be different types of memory. Optionally, the extended device may determine a first actual storage space in the extended memory using a memory allocation function (malloc) based on the size of the first compressed data, and store the first compressed data in the first actual storage space. The size of the first actual storage space is the same as the size of the first compressed data. For example, if the size of compressed data 1 is 2 KB, the extended device may determine a 2 KB actual storage space 1 in the extended memory using the malloc function, and store the 2 KB compressed data in the actual storage space 1. In the disclosed embodiment, the extended device may receive a data storage request sent by the master device and, using a compression engine, compress the first initial data to obtain the first compressed data. The first compressed data may then be stored in the extended memory. Because the extended device can both compress the first initial data using the compression engine and store the first compressed data in the extended memory, compared to existing technologies, only one data copy is required between the master device and the extended device, reducing interaction between the master device and the extended device, thereby improving data storage efficiency. The technical solution of the present disclosure includes two processes: storing data in an expansion device and reading data from the expansion device. The process of storing data in an expansion device is described in detail below with reference to Figures 4 and 5 ; the process of reading data from the expansion device is described in detail with reference to Figures 6 and 7 . Figure 4 is a flow chart illustrating another data processing method provided by an exemplary embodiment of the present disclosure. Referring to Figure 4 , the method may include:

[0006] S401: Receive a data storage request sent by a master device. It should be noted that the execution process of step S401 can refer to step S301 and will not be repeated here.

[0007] S402. When the master device finishes writing the first initial data into the temporary cache, the compression engine retrieves the first initial data from the temporary cache. Optionally, the expansion device may be provided with multiple virtual address spaces. Each virtual address space has the same size. The size of any virtual address space is the same as the size of the first initial data, that is, the size of any virtual address space is the same as the size of a memory page in the main memory. For example, if the size of a memory page is 4 KB, the size of any virtual address space can be 4 KB. Continuously, the multiple virtual address spaces may be contiguous or discontiguous. It should be emphasized that since the size of the temporary cache is the same as the size of a memory page in the main memory, and the size of any virtual address space is the same as the size of a memory page in the main memory, the size of the temporary cache is the same as the size of the first virtual address space. For example, if the size of a memory page is 4 KB, the size of the temporary cache can be 4 KB, and the size of any virtual address space can also be 4 KB. The data storage request can be used to write the first initial data into the temporary cache. Optionally, the data storage request may also include an identifier of the first virtual address space. Optionally, the identifier of the first virtual address space may be the starting address of the first virtual address space. For example, if the first virtual address space is virtual address space 1, the identifier of virtual address space 1 may be address A, where address A is the starting address of virtual address space 1. The data storage request may also be used to request that first initial data be written to the temporary cache via the first virtual address space. The first initial data may be written to the temporary cache by the master device via the first virtual address space, where the first virtual address space is an idle virtual address space among multiple virtual address spaces. The master device may sequentially write the first initial data to the temporary cache of the expansion device via the first virtual address space. After the last byte of the first virtual address space is written to the temporary cache, the expansion device may determine that the master device has completed writing the first initial data to the temporary cache. The expansion device may obtain the first initial data from the temporary cache via the compression engine. For example, if the first virtual address space is virtual address space 1, the master device can write 4K of initial data 1 to the temporary cache through virtual address space 1, and after writing data to the temporary cache through the last byte of virtual address space 1, the expansion device can obtain the 4K of initial data from the temporary cache through the compression engine.

[0008] S403. After the compression engine obtains the first initial data from the temporary cache, the expansion device sends a data storage response to the master device. The data storage response indicates completion of the first initial data storage and enables the master device to asynchronously store additional data to the expansion device. For example, after the compression engine obtains 4 KB of initial data 1 from the temporary cache, the expansion device may send data storage response 1 to the master device, enabling the master device to asynchronously store 4 KB of first initial data 2 to the expansion device.

[0009] S404. After the compression engine obtains the first initial data from the temporary cache, the expansion device deletes the first initial data from the temporary cache. Optionally, after the compression engine obtains data from the temporary cache, the expansion device may delete the first initial data from the temporary cache, so that the temporary cache can be used to store other data that the master device is sending to the expansion device. For example, after the compression engine obtains 4 KB of initial data 1 from the temporary cache, the expansion device may delete the 4 KB of initial data 1 from the temporary cache, so that the master device can asynchronously write the 4 KB of first initial data 2 to the temporary cache. It should be noted that steps S403 and S404 can be executed in any order and may be executed simultaneously.

[0010] S405. Compress the first initial data to obtain first compressed data. For example, the expansion device may compress the 4 KB initial data 1 using a compression engine to obtain compressed data 1. Assume that the size of the compressed data 1 is 2 KB.

[0011] S406. Store the first compressed data in the extended memory. It should be noted that the execution process of step S406 can refer to step S303 and will not be repeated here.

[0012] S407. Determine a first actual storage space for the first compressed data in the extended memory. Optionally, the first actual storage space can be represented by the starting address and storage length of the first actual storage space. For example, if the first actual storage space is actual storage space 1, the starting address of actual storage space 1 is address B, and the storage length is 2 KB, then actual storage space 1 can be represented as address B + storage length 2 KB. For example, the extended memory device can determine that the first actual storage space for the compressed data 1 in the extended memory is actual storage space 1. Assume that actual storage space 1 can be determined to be address B + storage length 2 KB.

[0013] S408. Determine a mapping relationship between the first actual storage space and the first virtual address space, and store the mapping relationship. Because the main device stores the first initial data in the expansion device via the first virtual address space, and the expansion device compresses the first initial data using a compression engine to obtain the first compressed data, and then stores the compressed data in the first actual storage space of the expansion memory, there is a one-to-one correspondence between the first virtual address space and the first actual storage space. The expansion device may determine a mapping relationship between the first actual storage space and the first virtual address space, and store the mapping relationship. For example, if the first virtual address space is virtual address space 1, the first actual storage space is actual storage space 1, and actual storage space 1 can be represented as address B + storage length 2 KB, the expansion device may determine mapping relationship 1 as: virtual address space 1 corresponds to actual storage space 1, i.e., address B + storage length 2 KB, and store the mapping relationship. Optionally, the mapping relationship may include identifiers of multiple virtual address spaces and the identifier of the actual storage space corresponding to each virtual address space identifier. The identifier of the virtual address space can be represented by the starting address of the virtual address space, and the identifier of the actual storage space can be represented by the starting address and storage length of the actual storage space. For example, the mapping relationship can be shown in Table 1: Table 1 In the technical solution disclosed herein, the expansion device can organically integrate a compression engine with extended memory. Specifically, the extended memory expands the main memory of the master device, while the compression engine compresses data, improving storage efficiency. It should be noted that the master device's writing of initial data to the expansion device's temporary buffer can occur asynchronously with the expansion device's compression and storage of the initial data, further improving the master device's data storage efficiency in the expansion device. If the master device needs to read the initial data while the expansion device is compressing and storing it, the master device's data read request will be blocked until the initial data is stored. However, this scenario is unlikely to occur because the expansion device primarily stores infrequently used data in the master device, making it safe to avoid. In this embodiment of the disclosure, the expansion device can receive a data storage request from the master device and, when the master device finishes writing the first initial data to the temporary buffer, retrieve the first initial data from the temporary buffer using the compression engine. After the compression engine retrieves the first initial data from the temporary buffer, the expansion device can send a data storage response to the master device and delete the first initial data from the temporary buffer. The expansion device can compress the first initial data to obtain first compressed data, and store the first compressed data in the extended memory. The expansion device can also determine a first actual storage space for the first compressed data in the extended memory, determine a mapping relationship between the first actual storage space and the first virtual address space, and store the mapping relationship. Because the expansion device can both compress the first initial data using the compression engine and store the first compressed data in the extended memory, compared to the prior art, only one data copy is required between the host device and the expansion device, reducing interaction between the host device and the expansion device, thereby improving data storage efficiency. It should be noted that the various processing steps (S401-S408) shown in the embodiment of FIG. 4 do not constitute a specific limitation on the data processing process. In other embodiments of the present disclosure, the data processing process may include more or fewer steps than the embodiment of FIG. 4 . For example, the data processing process may include some of the steps in the embodiment of FIG. 4 , or some steps in the embodiment of FIG. 4 may be replaced by steps with equivalent functions, or some steps in the embodiment of FIG. 4 may be split into multiple steps. The following further illustrates the process of storing data in an expansion device using a specific example, based on the embodiment shown in FIG4 and in conjunction with FIG5. FIG5 is a schematic diagram of a data processing method provided by an exemplary embodiment of the present disclosure. Referring to FIG5 , a main device and an expansion device are included. The main device may include main memory and a CPU. The main memory may include multiple memory pages.Memory page 1 may store 4KB of initial data. The expansion device may include a temporary cache, a compression engine, and extended memory. In step 1, the master device may send a data storage request 1 to the expansion device. The data storage request 1 may include the 4KB of initial data. The data storage request may also include address A, which is the starting address of virtual address space 1. The data storage request 1 may be used to request that the 4KB of initial data be written to the temporary cache via virtual address space 1. In step 2, after the master device finishes writing the 4KB of initial data 1 to the temporary cache, the expansion device may obtain the 4KB of initial data from the temporary cache via the compression engine. Optionally, after the master device obtains the 4KB of initial data 1 from the temporary cache via the compression engine, the expansion device may send a data storage response 1 to the master device, allowing the master device to asynchronously store the 4KB of initial data 2 to the expansion device. The expansion device may also delete the 4KB of initial data 1 from the temporary cache, allowing the master device to asynchronously write the 4KB of initial data 2 to the temporary cache. In step 3, the expansion device may compress the 4KB initial data 1 using the compression engine to obtain 2KB of compressed data 1. In step 4, the expansion device may determine a 2KB actual storage space 1 in the extended memory and store the 2KB of compressed data 1 in the actual storage space 1. Optionally, the expansion device may also determine a mapping relationship between the actual storage space 1 and the virtual address space 1 and store this mapping relationship. In an embodiment of the present disclosure, the expansion device may receive a data storage request sent by the master device and, when the master device finishes writing the first initial data to the temporary cache, retrieve the first initial data from the temporary cache using the compression engine. After the compression engine retrieves the first initial data from the temporary cache, the expansion device may send a data storage response to the master device and may also delete the first initial data from the temporary cache. The expansion device may compress the first initial data to obtain first compressed data and store the first compressed data in the extended memory. The expansion device may also determine a first actual storage space in the extended memory for the first compressed data, determine a mapping relationship between the first actual storage space and the first virtual address space, and store this mapping relationship. Because the expansion device can both compress the first initial data using the compression engine and store the first compressed data in the expansion memory, compared to existing technologies, only one data copy is required between the main device and the expansion device, reducing interaction between the main device and the expansion device and thus improving data storage efficiency. Figure 6 is a flowchart illustrating another data processing method provided by an exemplary embodiment of the present disclosure.Referring to FIG6 , the method may include:

[0014] S601. Receive a data read request sent by the master device. The data read request may include a second virtual address space. The data read request may be used to obtain initial data from a temporary cache of the extension device through the second virtual address space. Optionally, the identifier of the second virtual address space may be the starting address of the second virtual address space. The master device may send a data read request to the extension device, and the extension device may receive the data read request sent by the master device. For example, the master device may send a data read request 1 to the extension device. If the second virtual address space is virtual address space 1, data read request 1 may include address A, which may be the starting address of virtual address space 1. The extension device may receive the data read request sent by the master device.

[0015] S602. Obtain the second compressed data from the extended memory in accordance with the data read request. In an optional embodiment, the second compressed data can be obtained from the extended memory in accordance with the data read request in the following manner: determining the second actual storage space based on the second virtual address space; and obtaining the second compressed data from the extended memory based on the second actual storage space. Because a mapping relationship exists between virtual address spaces and actual storage spaces, the expansion device can determine the identifier of the second actual storage space based on the identifier of the second virtual address space in the mapping relationship, and then determine the second actual storage space based on the identifier of the second actual storage space. For example, if data read request 1 may include address A, where address A is the starting address of virtual address space 1, and if the mapping relationship is as shown in Table 1, the expansion device can determine, based on address A in the mapping relationship, that the corresponding second actual storage space is actual storage space 1. The identifier of actual storage space 1 is address B + storage length 2 KB. The expansion device can then determine the actual storage space 1 in the extended memory based on address B + storage length 2 KB. The expansion device can obtain the second compressed data from actual storage space 1. The second compressed data can be compressed data 1.

[0016] S603: Decompress the second compressed data using the compression engine to obtain second initial data, and synchronize the second initial data to the master device. In an optional embodiment, the second initial data can be synchronized to the master device in the following manner: store the second initial data in a temporary buffer of the expansion device; and send a data read response to the master device. The data read response can be used to instruct the master device to read the second initial data from the temporary buffer using the second virtual address space. For example, if the second compressed data is compressed data 1, the expansion device can decompress compressed data 1 using the compression engine to obtain the second initial data. Assume that the second initial data is initial data 1. The expansion device can store initial data 1 in the temporary buffer and send data read response 1 to the master device. If the second virtual address space is virtual address space 1, data read response 1 can be used to instruct the master device to sequentially read initial data 1 from the temporary buffer using virtual address space 1. It should be noted that in the technical solution of the present disclosure, the compression and decompression processes performed by the compression engine on the expansion device can be performed at the same data granularity. In an embodiment of the present disclosure, an expansion device can receive a data read request from a master device and, based on the data read request, retrieve second compressed data from an extended memory. The compression engine can then decompress the second compressed data to obtain second initial data, and synchronize the second initial data with the master device. Because the expansion device can both store the second compressed data in the extended memory and decompress the second compressed data using the compression engine, the master device can retrieve the second initial data from the expansion device through a single data copy. Compared to existing technologies, only one data copy is required with the master device, reducing interactions between the master and expansion devices and improving data retrieval efficiency. The following further illustrates the aforementioned process of reading data from an expansion device using a specific example, based on the embodiment shown in FIG6 and in conjunction with FIG7. FIG7 is a schematic diagram of another data processing method provided by an exemplary embodiment of the present disclosure. Referring to FIG7 , a master device and an expansion device are included. The master device may include main memory and a CPU. The main memory may include multiple memory pages. The expansion device may include a temporary cache, a compression engine, and extended memory. In step ①, the master device may send a data read request 1 to the expansion device. The data read request 1 may include address A, which is the starting address of virtual address space 1. The data storage request 1 may be used to request to obtain initial data from the temporary cache via virtual address space 1.In step 2, the expansion device can determine, based on address A in the mapping relationship, that the corresponding second actual storage space is actual storage space 1. Actual storage space 1 is identified by address B + storage length 2 KB. The expansion device can then determine the actual storage space 1 in the extended memory based on address B + storage length 2 KB. The expansion device can obtain 2 KB of compressed data 1 from actual storage space 1. In step 3, the expansion device can decompress the 2 KB of compressed data 1 using the compression engine to obtain 4 KB of initial data 1. In step 4, the expansion device can store the 4 KB of initial data 1 in a temporary cache. In step 5, the expansion device can send a data read request 1 to the master device, causing the master device to read the initial data from the temporary cache using virtual address space 1. The master device can obtain the 4 KB of initial data 1 from the temporary cache and store the initial data 1 in memory page 1 of the main memory. In an embodiment of the present disclosure, the expansion device can receive a data read request from the master device and, based on the data read request, retrieve the second compressed data from the expansion memory. The compression engine can then decompress the second compressed data to obtain the second initial data, and synchronize the second initial data with the master device. Because the expansion device can both store the second compressed data in the expansion memory and decompress the second compressed data using the compression engine to obtain the second initial data, the master device can retrieve the second initial data from the expansion device through a single data copy. Compared to existing technologies, this only requires a single data copy with the master device, reducing interactions between the master and expansion device and improving data acquisition efficiency. Figure 8 is a schematic structural diagram of a data processing device provided by an embodiment of the present disclosure. Referring to FIG. 8 , the data processing device 10 may be applied to an expansion device of a master device. The data processing device 10 may include: a receiving module 11, a processing module 12, and a storage module 13. The receiving module 11 is configured to receive a data storage request sent by the master device, wherein the data storage request includes first initial data; the processing module 12 is configured to compress the first initial data using the compression engine to obtain first compressed data; and the storage module 13 is configured to store the first compressed data in the expansion memory.In one possible embodiment, the expansion device further includes a temporary cache, and the data storage request is used to request writing the first initial data in the temporary cache; the processing module 12 is specifically used to: when the main device finishes writing the first initial data in the temporary cache, obtain the first initial data in the temporary cache through the compression engine; compress the first initial data to obtain the first compressed data. In one possible embodiment, a plurality of virtual address spaces are provided in the expansion device, wherein the first initial data is written to the temporary cache by the main device through the first virtual address space, and the first virtual address space is a virtual address space in an idle state among the plurality of virtual address spaces. The data processing device provided in the embodiment of the present disclosure can execute the technical solution shown in the above-mentioned method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here. Figure 9 is a structural schematic diagram of another data processing device provided in the embodiment of the present disclosure. Referring to FIG. 9 , based on the embodiment shown in FIG. 8 , the data processing device 10 may further include a determination module 14, wherein the determination module 14 is configured to determine a first actual storage space for the first compressed data in the extended memory; the determination module 14 is further configured to determine a mapping relationship between the first actual storage space and the first virtual address space; and the storage module 13 is further configured to store the mapping relationship. The data processing device provided in the embodiments of the present disclosure may implement the technical solutions shown in the above-mentioned method embodiments, and their implementation principles and beneficial effects are similar and will not be further described here. In one possible implementation, the data processing device 10 further includes a sending module 15, configured to, after the compression engine obtains the first initial data from the temporary cache, send a data storage response to the master device; the data storage response indicates completion of the first initial data storage and enables the master device to asynchronously store additional data to the extended device. In one possible implementation, after the compression engine obtains the first initial data from the temporary cache, the device further includes a deletion module 16, configured to delete the first initial data from the temporary cache.In one possible embodiment, the apparatus further includes an acquisition module 17 and a synchronization module 18, wherein the receiving module 11 is further configured to receive a data read request sent by the master device; the acquisition module 17 is configured to, based on the data read request, acquire the second compressed data from the extended memory; the processing module 12 is configured to decompress the second compressed data using the compression engine to obtain second initial data; and the synchronization module 18 is further configured to synchronize the second initial data with the master device. In one possible embodiment, the data read request includes an identifier of a second virtual address space; the acquisition module 17 is specifically configured to: determine a second actual storage space based on the identifier of the second virtual address space; and acquire the second compressed data from the extended memory based on the second actual storage space. In one possible embodiment, the synchronization module 18 is specifically configured to: store the second initial data in a temporary cache of the extended device; and send a data read response to the master device, wherein the data read response instructs the master device to read the second initial data from the temporary cache via the second virtual address space. The data processing device provided in the embodiments of the present disclosure can implement the technical solutions described in the above-mentioned method embodiments. Its implementation principles and beneficial effects are similar and will not be further elaborated here. The exemplary embodiments of the present disclosure provide a schematic structural diagram of an expansion device. See Figure 10. The expansion device 20 may include a processor 21, a memory 22, a compression engine 23, and an extended memory 24. For example, the processor 21, the memory 22, the compression engine 23, and the extended memory 24 are interconnected via a bus 25. The memory 22 stores computer-executable instructions; the compression engine 23 is used to compress and / or decompress data; and the extended memory 24 is used to store data. The processor 21 executes the computer-executable instructions stored in the memory 22, causing the expansion device 20 to perform the method described in the above-mentioned method embodiments. Accordingly, the embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions. When executed by a processor, the computer-executable instructions are used to implement the method described in the above-mentioned method embodiments. Accordingly, embodiments of the present disclosure may also provide a computer program product, including a computer program. When executed by a processor, the computer program may implement the method described in the above method embodiment. Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as a method, system, or computer program product.Therefore, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts 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, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, such that execution of the instructions by the processor of the computer or other programmable data processing device produces means for implementing the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means that implement the functions specified in one or more flows in a flowchart and / or one or more blocks in a block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing the computer or other programmable device to execute a series of operational steps to produce a computer-implemented process, such that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows in a flowchart and / or one or more blocks in a block diagram. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-volatile memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory. Memory is an example of computer-readable media. Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may be implemented using any method or technology for information storage. The information may be computer-readable instructions, data structures, program modules or other data.Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves. It should also be noted that the terms "comprises," "comprising," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements may include not only those elements but also other elements not expressly listed or inherent to such process, method, article, or apparatus. In the absence of further limitations, elements defined by the phrase "comprising a..." do not preclude the presence of other identical elements in the process, method, product, or device comprising the elements. The foregoing description is merely an embodiment of the present disclosure and is not intended to limit the present disclosure. Persons skilled in the art will readily appreciate that various modifications and variations of the present disclosure are possible. Any modifications, equivalent substitutions, improvements, and the like made within the spirit and principles of the present disclosure are intended to be encompassed by the claims of the present disclosure.

Claims

Claims 1. A data processing method, wherein: An expansion device applied to a master device, the expansion device including a compression engine and an expansion memory, the method comprising: receiving a data storage request sent by the master device, the data storage request including first initial data; compressing the first initial data using the compression engine to obtain first compressed data; and storing the first compressed data in the expansion memory.

2. The method according to claim 1, wherein: The expansion device further includes a temporary cache, and the data storage request is used to request writing the first initial data into the temporary cache; Compressing the first initial data by the compression engine to obtain first compressed data includes: obtaining the first initial data from the temporary buffer by the compression engine when the master device finishes writing the first initial data into the temporary buffer; The first initial data is compressed to obtain the first compressed data.

3. The method according to claim 2, wherein: The expansion device is provided with a plurality of virtual address spaces, wherein the first initial data is written by the master device into the temporary cache through a first virtual address space, and the first virtual address space is an idle virtual address space among the plurality of virtual address spaces.

4. The method according to claim 3, wherein: After storing the first compressed data in the extended memory, the method further includes: determining a first actual storage space of the first compressed data in the extended memory; determining a mapping relationship between the first actual storage space and the first virtual address space, and storing the mapping relationship.

5. The method according to any one of claims 2 to 4, wherein: The method further includes: after obtaining the first initial data in the temporary cache through the compression engine, sending a data storage response to the master device; wherein the data storage response is used to indicate completion of the first initial data storage, and the data storage response is used to enable the master device to asynchronously store other data to the expansion device.

6. The method according to any one of claims 2 to 5, wherein: After obtaining the first initial data from the temporary cache by the compression engine, the method further includes: deleting the first initial data from the temporary cache.

7. The method according to any one of claims 1 to 6, wherein: The method further includes: receiving a data read request sent by the master device; obtaining second compressed data in the extended memory according to the data read request; decompressing the second compressed data by the compression engine to obtain second initial data, and synchronizing the second initial data to the master device.

8. The method according to claim 7, wherein: The data read request includes an identifier of the second virtual address space; Acquiring second compressed data from the extended memory according to the data read request includes: determining a second actual storage space according to the identifier of the second virtual address space; According to the second actual storage space, the second compressed data is obtained in the extended memory.

9. The method according to claim 8, wherein: Synchronizing the second initial data to the master device includes: storing the second initial data in a temporary cache of the expansion device; and sending a data read response to the master device, where the data read response is used to instruct the master device to read the second initial data in the temporary cache through the second virtual address space.

10. A data processing device, wherein: An expansion device applied to a master device includes a compression engine and an extended memory. The apparatus comprises: a receiving module, a processing module, and a storage module. The receiving module is configured to receive a data storage request sent by the master device, wherein the data storage request includes first initial data; the processing module is configured to compress the first initial data using the compression engine to obtain first compressed data; and the storage module is configured to store the first compressed data in the extended memory.

11. An expansion device, wherein: include: at least one processor; and a memory, a compression engine, and an extended memory communicatively connected to the at least one processor; the compression engine is configured to compress and / or decompress data; The extended memory is used to store data; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the expansion device to perform the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product, comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Data processing method and device, equipment, storage medium and program product

    CN120540577A

  • Data storage method and device based on virtual memory, equipment and a storage medium.

    CN112764925A

  • Storage device and method for controlling storage device

    US20160004642A1

  • Priority-based access of compressed memory lines in memory in a processor-based system

    US20170269851A1